mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibWeb/WebGL2: Implement uniform{1,2,3,4}uiv
This commit is contained in:
parent
59bea36a59
commit
35763ffe53
|
|
@ -341,10 +341,10 @@ interface mixin WebGL2RenderingContextBase {
|
|||
undefined uniform3ui(WebGLUniformLocation? location, GLuint v0, GLuint v1, GLuint v2);
|
||||
undefined uniform4ui(WebGLUniformLocation? location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
|
||||
|
||||
[FIXME] undefined uniform1uiv(WebGLUniformLocation? location, Uint32List data, optional unsigned long long srcOffset = 0, optional GLuint srcLength = 0);
|
||||
[FIXME] undefined uniform2uiv(WebGLUniformLocation? location, Uint32List data, optional unsigned long long srcOffset = 0, optional GLuint srcLength = 0);
|
||||
[FIXME] undefined uniform3uiv(WebGLUniformLocation? location, Uint32List data, optional unsigned long long srcOffset = 0, optional GLuint srcLength = 0);
|
||||
[FIXME] undefined uniform4uiv(WebGLUniformLocation? location, Uint32List data, optional unsigned long long srcOffset = 0, optional GLuint srcLength = 0);
|
||||
undefined uniform1uiv(WebGLUniformLocation? location, Uint32List data, optional unsigned long long srcOffset = 0, optional GLuint srcLength = 0);
|
||||
undefined uniform2uiv(WebGLUniformLocation? location, Uint32List data, optional unsigned long long srcOffset = 0, optional GLuint srcLength = 0);
|
||||
undefined uniform3uiv(WebGLUniformLocation? location, Uint32List data, optional unsigned long long srcOffset = 0, optional GLuint srcLength = 0);
|
||||
undefined uniform4uiv(WebGLUniformLocation? location, Uint32List data, optional unsigned long long srcOffset = 0, optional GLuint srcLength = 0);
|
||||
undefined uniformMatrix3x2fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data, optional unsigned long long srcOffset = 0, optional GLuint srcLength = 0);
|
||||
undefined uniformMatrix4x2fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data, optional unsigned long long srcOffset = 0, optional GLuint srcLength = 0);
|
||||
|
||||
|
|
|
|||
|
|
@ -188,6 +188,62 @@ void WebGL2RenderingContextImpl::uniform4ui(GC::Root<WebGLUniformLocation> locat
|
|||
glUniform4ui(location ? location->handle() : 0, v0, v1, v2, v3);
|
||||
}
|
||||
|
||||
void WebGL2RenderingContextImpl::uniform1uiv(GC::Root<WebGLUniformLocation> location, Uint32List values, WebIDL::UnsignedLongLong src_offset, WebIDL::UnsignedLong src_length)
|
||||
{
|
||||
m_context->make_current();
|
||||
|
||||
if (!location)
|
||||
return;
|
||||
|
||||
auto span = SET_ERROR_VALUE_IF_ERROR(span_from_uint32_list(values, src_offset, src_length), GL_INVALID_VALUE);
|
||||
glUniform1uiv(location->handle(), span.size(), span.data());
|
||||
}
|
||||
|
||||
void WebGL2RenderingContextImpl::uniform2uiv(GC::Root<WebGLUniformLocation> location, Uint32List values, WebIDL::UnsignedLongLong src_offset, WebIDL::UnsignedLong src_length)
|
||||
{
|
||||
m_context->make_current();
|
||||
|
||||
if (!location)
|
||||
return;
|
||||
|
||||
auto span = SET_ERROR_VALUE_IF_ERROR(span_from_uint32_list(values, src_offset, src_length), GL_INVALID_VALUE);
|
||||
if (span.size() % 2 != 0) [[unlikely]] {
|
||||
set_error(GL_INVALID_VALUE);
|
||||
return;
|
||||
}
|
||||
glUniform2uiv(location->handle(), span.size() / 2, span.data());
|
||||
}
|
||||
|
||||
void WebGL2RenderingContextImpl::uniform3uiv(GC::Root<WebGLUniformLocation> location, Uint32List values, WebIDL::UnsignedLongLong src_offset, WebIDL::UnsignedLong src_length)
|
||||
{
|
||||
m_context->make_current();
|
||||
|
||||
if (!location)
|
||||
return;
|
||||
|
||||
auto span = SET_ERROR_VALUE_IF_ERROR(span_from_uint32_list(values, src_offset, src_length), GL_INVALID_VALUE);
|
||||
if (span.size() % 3 != 0) [[unlikely]] {
|
||||
set_error(GL_INVALID_VALUE);
|
||||
return;
|
||||
}
|
||||
glUniform3uiv(location->handle(), span.size() / 3, span.data());
|
||||
}
|
||||
|
||||
void WebGL2RenderingContextImpl::uniform4uiv(GC::Root<WebGLUniformLocation> location, Uint32List values, WebIDL::UnsignedLongLong src_offset, WebIDL::UnsignedLong src_length)
|
||||
{
|
||||
m_context->make_current();
|
||||
|
||||
if (!location)
|
||||
return;
|
||||
|
||||
auto span = SET_ERROR_VALUE_IF_ERROR(span_from_uint32_list(values, src_offset, src_length), GL_INVALID_VALUE);
|
||||
if (span.size() % 4 != 0) [[unlikely]] {
|
||||
set_error(GL_INVALID_VALUE);
|
||||
return;
|
||||
}
|
||||
glUniform4uiv(location->handle(), span.size() / 4, span.data());
|
||||
}
|
||||
|
||||
void WebGL2RenderingContextImpl::uniform_matrix3x2fv(GC::Root<WebGLUniformLocation> location, bool transpose, Float32List data, WebIDL::UnsignedLongLong src_offset, WebIDL::UnsignedLong src_length)
|
||||
{
|
||||
m_context->make_current();
|
||||
|
|
|
|||
|
|
@ -43,6 +43,10 @@ public:
|
|||
void uniform2ui(GC::Root<WebGLUniformLocation> location, WebIDL::UnsignedLong v0, WebIDL::UnsignedLong v1);
|
||||
void uniform3ui(GC::Root<WebGLUniformLocation> location, WebIDL::UnsignedLong v0, WebIDL::UnsignedLong v1, WebIDL::UnsignedLong v2);
|
||||
void uniform4ui(GC::Root<WebGLUniformLocation> location, WebIDL::UnsignedLong v0, WebIDL::UnsignedLong v1, WebIDL::UnsignedLong v2, WebIDL::UnsignedLong v3);
|
||||
void uniform1uiv(GC::Root<WebGLUniformLocation> location, Uint32List v, WebIDL::UnsignedLongLong src_offset, WebIDL::UnsignedLong src_length);
|
||||
void uniform2uiv(GC::Root<WebGLUniformLocation> location, Uint32List v, WebIDL::UnsignedLongLong src_offset, WebIDL::UnsignedLong src_length);
|
||||
void uniform3uiv(GC::Root<WebGLUniformLocation> location, Uint32List v, WebIDL::UnsignedLongLong src_offset, WebIDL::UnsignedLong src_length);
|
||||
void uniform4uiv(GC::Root<WebGLUniformLocation> location, Uint32List v, WebIDL::UnsignedLongLong src_offset, WebIDL::UnsignedLong src_length);
|
||||
void uniform_matrix3x2fv(GC::Root<WebGLUniformLocation> location, bool transpose, Float32List data, WebIDL::UnsignedLongLong src_offset, WebIDL::UnsignedLong src_length);
|
||||
void uniform_matrix4x2fv(GC::Root<WebGLUniformLocation> location, bool transpose, Float32List data, WebIDL::UnsignedLongLong src_offset, WebIDL::UnsignedLong src_length);
|
||||
void uniform_matrix2x3fv(GC::Root<WebGLUniformLocation> location, bool transpose, Float32List data, WebIDL::UnsignedLongLong src_offset, WebIDL::UnsignedLong src_length);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user