Bug 1048745 - WebGL2 - GL symbols for uniformui & non-square uniform matrix.; r=jgilbert

--HG--
extra : rebase_source : bd47b6bbde06ba7f8a945aa55f751d8a3c074946
extra : source : 5b135f5f9492b2606c593ad0c800488f6a51274c
This commit is contained in:
Dan Glastonbury 2014-09-23 15:33:55 +10:00
parent 124f503f5f
commit 9aa93c1e81
4 changed files with 187 additions and 0 deletions

View File

@ -1148,6 +1148,46 @@ GLContext::InitWithPrefix(const char *prefix, bool trygl)
}
}
if (IsSupported(GLFeature::uniform_matrix_nonsquare)) {
SymLoadStruct umnSymbols[] = {
{ (PRFuncPtr*) &mSymbols.fUniformMatrix2x3fv, { "UniformMatrix2x3fv", nullptr } },
{ (PRFuncPtr*) &mSymbols.fUniformMatrix2x4fv, { "UniformMatrix2x4fv", nullptr } },
{ (PRFuncPtr*) &mSymbols.fUniformMatrix3x2fv, { "UniformMatrix3x2fv", nullptr } },
{ (PRFuncPtr*) &mSymbols.fUniformMatrix3x4fv, { "UniformMatrix3x4fv", nullptr } },
{ (PRFuncPtr*) &mSymbols.fUniformMatrix4x2fv, { "UniformMatrix4x2fv", nullptr } },
{ (PRFuncPtr*) &mSymbols.fUniformMatrix4x3fv, { "UniformMatrix4x3fv", nullptr } },
END_SYMBOLS
};
if (!LoadSymbols(&umnSymbols[0], trygl, prefix)) {
NS_ERROR("GL supports uniform matrix with non-square dim without supplying its functions.");
MarkUnsupported(GLFeature::uniform_matrix_nonsquare);
ClearSymbols(umnSymbols);
}
}
if (IsSupported(GLFeature::uniform_uint)) {
SymLoadStruct uuSymbols[] = {
{ (PRFuncPtr*) &mSymbols.fUniform1ui, { "Uniform1ui", nullptr } },
{ (PRFuncPtr*) &mSymbols.fUniform2ui, { "Uniform2ui", nullptr } },
{ (PRFuncPtr*) &mSymbols.fUniform3ui, { "Uniform3ui", nullptr } },
{ (PRFuncPtr*) &mSymbols.fUniform4ui, { "Uniform4ui", nullptr } },
{ (PRFuncPtr*) &mSymbols.fUniform1uiv, { "Uniform1uiv", nullptr } },
{ (PRFuncPtr*) &mSymbols.fUniform2uiv, { "Uniform2uiv", nullptr } },
{ (PRFuncPtr*) &mSymbols.fUniform3uiv, { "Uniform3uiv", nullptr } },
{ (PRFuncPtr*) &mSymbols.fUniform4uiv, { "Uniform4uiv", nullptr } },
END_SYMBOLS
};
if (!LoadSymbols(&uuSymbols[0], trygl, prefix)) {
NS_ERROR("GL support uniform with GLuint without supplying its functions.");
MarkUnsupported(GLFeature::uniform_uint);
ClearSymbols(uuSymbols);
}
}
if (IsExtensionSupported(KHR_debug)) {
SymLoadStruct extSymbols[] = {
{ (PRFuncPtr*) &mSymbols.fDebugMessageControl, { "DebugMessageControl", "DebugMessageControlKHR", nullptr } },

View File

@ -116,6 +116,8 @@ MOZ_BEGIN_ENUM_CLASS(GLFeature)
texture_non_power_of_two,
transform_feedback,
uniform_buffer_object,
uniform_matrix_nonsquare,
uniform_uint,
vertex_array_object,
EnumMax
MOZ_END_ENUM_CLASS(GLFeature)
@ -1716,6 +1718,20 @@ public:
AFTER_GL_CALL;
}
void fUniform1ui(GLint location, GLuint v0) {
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fUniform1ui);
mSymbols.fUniform1ui(location, v0);
AFTER_GL_CALL;
}
void fUniform1uiv(GLint location, GLsizei count, const GLuint* value) {
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fUniform1uiv);
mSymbols.fUniform1uiv(location, count, value);
AFTER_GL_CALL;
}
void fUniform2f(GLint location, GLfloat v0, GLfloat v1) {
BEFORE_GL_CALL;
mSymbols.fUniform2f(location, v0, v1);
@ -1740,6 +1756,20 @@ public:
AFTER_GL_CALL;
}
void fUniform2ui(GLint location, GLuint v0, GLuint v1) {
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fUniform2ui);
mSymbols.fUniform2ui(location, v0, v1);
AFTER_GL_CALL;
}
void fUniform2uiv(GLint location, GLsizei count, const GLuint* value) {
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fUniform2uiv);
mSymbols.fUniform2uiv(location, count, value);
AFTER_GL_CALL;
}
void fUniform3f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2) {
BEFORE_GL_CALL;
mSymbols.fUniform3f(location, v0, v1, v2);
@ -1764,6 +1794,20 @@ public:
AFTER_GL_CALL;
}
void fUniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2) {
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fUniform3ui);
mSymbols.fUniform3ui(location, v0, v1, v2);
AFTER_GL_CALL;
}
void fUniform3uiv(GLint location, GLsizei count, const GLuint* value) {
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fUniform3uiv);
mSymbols.fUniform3uiv(location, count, value);
AFTER_GL_CALL;
}
void fUniform4f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) {
BEFORE_GL_CALL;
mSymbols.fUniform4f(location, v0, v1, v2, v3);
@ -1788,24 +1832,80 @@ public:
AFTER_GL_CALL;
}
void fUniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) {
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fUniform4ui);
mSymbols.fUniform4ui(location, v0, v1, v2, v3);
AFTER_GL_CALL;
}
void fUniform4uiv(GLint location, GLsizei count, const GLuint* value) {
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fUniform4uiv);
mSymbols.fUniform4uiv(location, count, value);
AFTER_GL_CALL;
}
void fUniformMatrix2fv(GLint location, GLsizei count, realGLboolean transpose, const GLfloat* value) {
BEFORE_GL_CALL;
mSymbols.fUniformMatrix2fv(location, count, transpose, value);
AFTER_GL_CALL;
}
void fUniformMatrix2x3fv(GLint location, GLsizei count, realGLboolean transpose, const GLfloat* value) {
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fUniformMatrix2x3fv);
mSymbols.fUniformMatrix2x3fv(location, count, transpose, value);
AFTER_GL_CALL;
}
void fUniformMatrix2x4fv(GLint location, GLsizei count, realGLboolean transpose, const GLfloat* value) {
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fUniformMatrix2x4fv);
mSymbols.fUniformMatrix2x4fv(location, count, transpose, value);
AFTER_GL_CALL;
}
void fUniformMatrix3fv(GLint location, GLsizei count, realGLboolean transpose, const GLfloat* value) {
BEFORE_GL_CALL;
mSymbols.fUniformMatrix3fv(location, count, transpose, value);
AFTER_GL_CALL;
}
void fUniformMatrix3x2fv(GLint location, GLsizei count, realGLboolean transpose, const GLfloat* value) {
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fUniformMatrix3x2fv);
mSymbols.fUniformMatrix3x2fv(location, count, transpose, value);
AFTER_GL_CALL;
}
void fUniformMatrix3x4fv(GLint location, GLsizei count, realGLboolean transpose, const GLfloat* value) {
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fUniformMatrix3x4fv);
mSymbols.fUniformMatrix3x4fv(location, count, transpose, value);
AFTER_GL_CALL;
}
void fUniformMatrix4fv(GLint location, GLsizei count, realGLboolean transpose, const GLfloat* value) {
BEFORE_GL_CALL;
mSymbols.fUniformMatrix4fv(location, count, transpose, value);
AFTER_GL_CALL;
}
void fUniformMatrix4x2fv(GLint location, GLsizei count, realGLboolean transpose, const GLfloat* value) {
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fUniformMatrix4x2fv);
mSymbols.fUniformMatrix4x2fv(location, count, transpose, value);
AFTER_GL_CALL;
}
void fUniformMatrix4x3fv(GLint location, GLsizei count, realGLboolean transpose, const GLfloat* value) {
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fUniformMatrix4x3fv);
mSymbols.fUniformMatrix4x3fv(location, count, transpose, value);
AFTER_GL_CALL;
}
void fUseProgram(GLuint program) {
BEFORE_GL_CALL;
mSymbols.fUseProgram(program);

View File

@ -485,6 +485,24 @@ static const FeatureInfo sFeatureInfoArr[] = {
GLContext::Extensions_End
}
},
{
"uniform_matrix_nonsquare",
210, // OpenGL version
300, // OpenGL ES version
GLContext::Extension_None,
{
GLContext::Extensions_End
}
},
{
"uniform_uint",
300, // OpenGL version
300, // OpenGL ES version
GLContext::Extension_None,
{
GLContext::Extensions_End
}
},
{
"vertex_array_object",
300, // OpenGL version

View File

@ -229,6 +229,10 @@ struct GLContextSymbols
PFNGLUNIFORM1IPROC fUniform1i;
typedef void (GLAPIENTRY * PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint* value);
PFNGLUNIFORM1IVPROC fUniform1iv;
typedef void (GLAPIENTRY * PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0);
PFNGLUNIFORM1UIPROC fUniform1ui;
typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint* value);
PFNGLUNIFORM1UIVPROC fUniform1uiv;
typedef void (GLAPIENTRY * PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1);
PFNGLUNIFORM2FPROC fUniform2f;
typedef void (GLAPIENTRY * PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat* value);
@ -237,6 +241,10 @@ struct GLContextSymbols
PFNGLUNIFORM2IPROC fUniform2i;
typedef void (GLAPIENTRY * PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint* value);
PFNGLUNIFORM2IVPROC fUniform2iv;
typedef void (GLAPIENTRY * PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1);
PFNGLUNIFORM2UIPROC fUniform2ui;
typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint* value);
PFNGLUNIFORM2UIVPROC fUniform2uiv;
typedef void (GLAPIENTRY * PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
PFNGLUNIFORM3FPROC fUniform3f;
typedef void (GLAPIENTRY * PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat* value);
@ -245,6 +253,10 @@ struct GLContextSymbols
PFNGLUNIFORM3IPROC fUniform3i;
typedef void (GLAPIENTRY * PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint* value);
PFNGLUNIFORM3IVPROC fUniform3iv;
typedef void (GLAPIENTRY * PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2);
PFNGLUNIFORM3UIPROC fUniform3ui;
typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint* value);
PFNGLUNIFORM3UIVPROC fUniform3uiv;
typedef void (GLAPIENTRY * PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
PFNGLUNIFORM4FPROC fUniform4f;
typedef void (GLAPIENTRY * PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat* value);
@ -253,12 +265,29 @@ struct GLContextSymbols
PFNGLUNIFORM4IPROC fUniform4i;
typedef void (GLAPIENTRY * PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint* value);
PFNGLUNIFORM4IVPROC fUniform4iv;
typedef void (GLAPIENTRY * PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
PFNGLUNIFORM4UIPROC fUniform4ui;
typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint* value);
PFNGLUNIFORM4UIVPROC fUniform4uiv;
typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, realGLboolean transpose, const GLfloat* value);
PFNGLUNIFORMMATRIX2FVPROC fUniformMatrix2fv;
typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, realGLboolean transpose, const GLfloat* value);
PFNGLUNIFORMMATRIX2X3FVPROC fUniformMatrix2x3fv;
typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, realGLboolean transpose, const GLfloat* value);
PFNGLUNIFORMMATRIX2X4FVPROC fUniformMatrix2x4fv;
typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, realGLboolean transpose, const GLfloat* value);
PFNGLUNIFORMMATRIX3FVPROC fUniformMatrix3fv;
typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, realGLboolean transpose, const GLfloat* value);
PFNGLUNIFORMMATRIX3X2FVPROC fUniformMatrix3x2fv;
typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, realGLboolean transpose, const GLfloat* value);
PFNGLUNIFORMMATRIX3X4FVPROC fUniformMatrix3x4fv;
typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, realGLboolean transpose, const GLfloat* value);
PFNGLUNIFORMMATRIX4FVPROC fUniformMatrix4fv;
typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, realGLboolean transpose, const GLfloat* value);
PFNGLUNIFORMMATRIX4X2FVPROC fUniformMatrix4x2fv;
typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, realGLboolean transpose, const GLfloat* value);
PFNGLUNIFORMMATRIX4X3FVPROC fUniformMatrix4x3fv;
typedef void (GLAPIENTRY * PFNGLUSEPROGRAMPROC) (GLuint program);
PFNGLUSEPROGRAMPROC fUseProgram;
typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPROC) (GLuint program);