mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1048745 - WebGL2 - GL symbols for VertexAttribI.; r=jgilbert
--HG-- extra : rebase_source : 57ceb97a1f21c85427c8108ea7ff41f93fe24789 extra : source : 0d1c61620e601c851f61cd062e42204c2e50e3e0
This commit is contained in:
parent
bf3a35dfd6
commit
86c66d6f5a
@ -1112,6 +1112,28 @@ GLContext::InitWithPrefix(const char *prefix, bool trygl)
|
||||
}
|
||||
}
|
||||
|
||||
if (IsSupported(GLFeature::integer_vertex_attribs)) {
|
||||
SymLoadStruct integerVASymbols[] = {
|
||||
{ (PRFuncPtr*) &mSymbols.fVertexAttribI4i, { "VertexAttribI4i", nullptr } },
|
||||
{ (PRFuncPtr*) &mSymbols.fVertexAttribI4iv, { "VertexAttribI4iv", nullptr } },
|
||||
{ (PRFuncPtr*) &mSymbols.fVertexAttribI4ui, { "VertexAttribI4ui", nullptr } },
|
||||
{ (PRFuncPtr*) &mSymbols.fVertexAttribI4uiv, { "VertexAttribI4uiv", nullptr } },
|
||||
{ (PRFuncPtr*) &mSymbols.fVertexAttribIPointer, { "VertexAttribIPointer", nullptr } },
|
||||
{ nullptr, { nullptr } }
|
||||
};
|
||||
|
||||
if (!LoadSymbols(integerVASymbols, trygl, prefix)) {
|
||||
NS_ERROR("GL supports integer vertex attribs without supplying its functions.");
|
||||
|
||||
MarkUnsupported(GLFeature::integer_vertex_attribs);
|
||||
mSymbols.fVertexAttribI4i = nullptr;
|
||||
mSymbols.fVertexAttribI4iv = nullptr;
|
||||
mSymbols.fVertexAttribI4ui = nullptr;
|
||||
mSymbols.fVertexAttribI4uiv = nullptr;
|
||||
mSymbols.fVertexAttribIPointer = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
if (IsSupported(GLFeature::map_buffer_range)) {
|
||||
SymLoadStruct mapBufferRangeSymbols[] = {
|
||||
{ (PRFuncPtr*) &mSymbols.fMapBufferRange, { "MapBufferRange", nullptr } },
|
||||
|
@ -97,6 +97,7 @@ MOZ_BEGIN_ENUM_CLASS(GLFeature)
|
||||
get_query_object_iv,
|
||||
instanced_arrays,
|
||||
instanced_non_arrays,
|
||||
integer_vertex_attribs,
|
||||
map_buffer_range,
|
||||
occlusion_query,
|
||||
occlusion_query_boolean,
|
||||
@ -1978,6 +1979,46 @@ public:
|
||||
AFTER_GL_CALL;
|
||||
}
|
||||
|
||||
void fVertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w)
|
||||
{
|
||||
BEFORE_GL_CALL;
|
||||
ASSERT_SYMBOL_PRESENT(fVertexAttribI4i);
|
||||
mSymbols.fVertexAttribI4i(index, x, y, z, w);
|
||||
AFTER_GL_CALL;
|
||||
}
|
||||
|
||||
void fVertexAttribI4iv(GLuint index, const GLint* v)
|
||||
{
|
||||
BEFORE_GL_CALL;
|
||||
ASSERT_SYMBOL_PRESENT(fVertexAttribI4iv);
|
||||
mSymbols.fVertexAttribI4iv(index, v);
|
||||
AFTER_GL_CALL;
|
||||
}
|
||||
|
||||
void fVertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w)
|
||||
{
|
||||
BEFORE_GL_CALL;
|
||||
ASSERT_SYMBOL_PRESENT(fVertexAttribI4ui);
|
||||
mSymbols.fVertexAttribI4ui(index, x, y, z, w);
|
||||
AFTER_GL_CALL;
|
||||
}
|
||||
|
||||
void fVertexAttribI4uiv(GLuint index, const GLuint* v)
|
||||
{
|
||||
BEFORE_GL_CALL;
|
||||
ASSERT_SYMBOL_PRESENT(fVertexAttribI4uiv);
|
||||
mSymbols.fVertexAttribI4uiv(index, v);
|
||||
AFTER_GL_CALL;
|
||||
}
|
||||
|
||||
void fVertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid* offset)
|
||||
{
|
||||
BEFORE_GL_CALL;
|
||||
ASSERT_SYMBOL_PRESENT(fVertexAttribIPointer);
|
||||
mSymbols.fVertexAttribIPointer(index, size, type, stride, offset);
|
||||
AFTER_GL_CALL;
|
||||
}
|
||||
|
||||
void fCompileShader(GLuint shader) {
|
||||
BEFORE_GL_CALL;
|
||||
mSymbols.fCompileShader(shader);
|
||||
@ -1985,13 +2026,15 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void raw_fCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) {
|
||||
void raw_fCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
|
||||
{
|
||||
BEFORE_GL_CALL;
|
||||
mSymbols.fCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
|
||||
AFTER_GL_CALL;
|
||||
}
|
||||
|
||||
void raw_fCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
|
||||
void raw_fCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
|
||||
{
|
||||
BEFORE_GL_CALL;
|
||||
mSymbols.fCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
|
||||
AFTER_GL_CALL;
|
||||
|
@ -259,6 +259,14 @@ static const FeatureInfo sFeatureInfoArr[] = {
|
||||
* has no such restriction.
|
||||
*/
|
||||
},
|
||||
{
|
||||
"integer_vertex_attribs",
|
||||
300, // OpenGL version
|
||||
300, // OpenGL ES version
|
||||
{
|
||||
GLContext::Extensions_End
|
||||
}
|
||||
},
|
||||
{
|
||||
"map_buffer_range",
|
||||
300, // OpenGL version
|
||||
|
@ -602,6 +602,18 @@ struct GLContextSymbols
|
||||
PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC fGetActiveUniformBlockName;
|
||||
typedef void (GLAPIENTRY * PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
|
||||
PFNGLUNIFORMBLOCKBINDINGPROC fUniformBlockBinding;
|
||||
|
||||
// vertex attrib - integer
|
||||
typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w);
|
||||
PFNGLVERTEXATTRIBI4IPROC fVertexAttribI4i;
|
||||
typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint* v);
|
||||
PFNGLVERTEXATTRIBI4IVPROC fVertexAttribI4iv;
|
||||
typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
|
||||
PFNGLVERTEXATTRIBI4UIPROC fVertexAttribI4ui;
|
||||
typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint* v);
|
||||
PFNGLVERTEXATTRIBI4UIVPROC fVertexAttribI4uiv;
|
||||
typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid* ptr);
|
||||
PFNGLVERTEXATTRIBIPOINTERPROC fVertexAttribIPointer;
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user