mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-27 07:34:20 +00:00
bug 903481 - step 2 - [WebGL 2.0] transform feedback: add symbols in GLContext - r=jgilbert
This commit is contained in:
parent
2e13b97e43
commit
4f2b0458e0
@ -654,6 +654,95 @@ GLContext::InitWithPrefix(const char *prefix, bool trygl)
|
||||
}
|
||||
}
|
||||
|
||||
if (IsExtensionSupported(XXX_transform_feedback)) {
|
||||
SymLoadStruct transformFeedbackSymbols[] = {
|
||||
{ (PRFuncPtr*) &mSymbols.fBindBufferBase,
|
||||
{ "BindBufferBase",
|
||||
"BindBufferBaseEXT",
|
||||
"BindBufferBaseNV",
|
||||
nullptr
|
||||
}
|
||||
},
|
||||
{ (PRFuncPtr*) &mSymbols.fBindBufferRange,
|
||||
{ "BindBufferRange",
|
||||
"BindBufferRangeEXT",
|
||||
"BindBufferRangeNV",
|
||||
nullptr
|
||||
}
|
||||
},
|
||||
{ (PRFuncPtr*) &mSymbols.fBeginTransformFeedback,
|
||||
{ "BeginTransformFeedback",
|
||||
"BeginTransformFeedbackEXT",
|
||||
"BeginTransformFeedbackNV",
|
||||
nullptr
|
||||
}
|
||||
},
|
||||
{ (PRFuncPtr*) &mSymbols.fEndTransformFeedback,
|
||||
{ "EndTransformFeedback",
|
||||
"EndTransformFeedbackEXT",
|
||||
"EndTransformFeedbackNV",
|
||||
nullptr
|
||||
}
|
||||
},
|
||||
{ (PRFuncPtr*) &mSymbols.fTransformFeedbackVaryings,
|
||||
{ "TransformFeedbackVaryings",
|
||||
"TransformFeedbackVaryingsEXT",
|
||||
"TransformFeedbackVaryingsNV",
|
||||
nullptr
|
||||
}
|
||||
},
|
||||
{ (PRFuncPtr*) &mSymbols.fGetTransformFeedbackVarying,
|
||||
{ "GetTransformFeedbackVarying",
|
||||
"GetTransformFeedbackVaryingEXT",
|
||||
"GetTransformFeedbackVaryingNV",
|
||||
nullptr
|
||||
}
|
||||
},
|
||||
{ (PRFuncPtr*) &mSymbols.fGetIntegeri_v,
|
||||
{ "GetIntegeri_v",
|
||||
"GetIntegerIndexedvEXT",
|
||||
"GetIntegerIndexedvNV",
|
||||
nullptr
|
||||
}
|
||||
},
|
||||
{ nullptr, { nullptr } },
|
||||
};
|
||||
|
||||
if (!LoadSymbols(transformFeedbackSymbols, trygl, prefix)) {
|
||||
NS_ERROR("GL supports transform feedback without supplying its functions.");
|
||||
|
||||
MarkExtensionGroupUnsupported(XXX_transform_feedback);
|
||||
MarkExtensionGroupUnsupported(XXX_bind_buffer_offset);
|
||||
mSymbols.fBindBufferBase = nullptr;
|
||||
mSymbols.fBindBufferRange = nullptr;
|
||||
mSymbols.fBeginTransformFeedback = nullptr;
|
||||
mSymbols.fEndTransformFeedback = nullptr;
|
||||
mSymbols.fTransformFeedbackVaryings = nullptr;
|
||||
mSymbols.fGetTransformFeedbackVarying = nullptr;
|
||||
mSymbols.fGetIntegeri_v = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
if (IsExtensionSupported(XXX_bind_buffer_offset)) {
|
||||
SymLoadStruct bindBufferOffsetSymbols[] = {
|
||||
{ (PRFuncPtr*) &mSymbols.fBindBufferOffset,
|
||||
{ "BindBufferOffset",
|
||||
"BindBufferOffsetEXT",
|
||||
"BindBufferOffsetNV",
|
||||
nullptr
|
||||
}
|
||||
},
|
||||
{ nullptr, { nullptr } },
|
||||
};
|
||||
|
||||
if (!LoadSymbols(bindBufferOffsetSymbols, trygl, prefix)) {
|
||||
NS_ERROR("GL supports BindBufferOffset without supplying its function.");
|
||||
|
||||
MarkExtensionGroupUnsupported(XXX_bind_buffer_offset);
|
||||
mSymbols.fBindBufferOffset = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
if (IsExtensionSupported(XXX_query_objects)) {
|
||||
SymLoadStruct queryObjectsSymbols[] = {
|
||||
{ (PRFuncPtr*) &mSymbols.fBeginQuery, { "BeginQuery", "BeginQueryEXT", nullptr } },
|
||||
|
@ -474,6 +474,7 @@ public:
|
||||
* This enum should be sorted by name.
|
||||
*/
|
||||
enum GLExtensionGroup {
|
||||
XXX_bind_buffer_offset,
|
||||
XXX_depth_texture,
|
||||
XXX_draw_buffers,
|
||||
XXX_draw_instanced,
|
||||
@ -2034,6 +2035,18 @@ public:
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Package XXX_bind_buffer_offset
|
||||
public:
|
||||
void fBindBufferOffset(GLenum target, GLuint index, GLuint buffer, GLintptr offset)
|
||||
{
|
||||
BEFORE_GL_CALL;
|
||||
ASSERT_SYMBOL_PRESENT(fBindBufferOffset);
|
||||
mSymbols.fBindBufferOffset(target, index, buffer, offset);
|
||||
AFTER_GL_CALL;
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Package XXX_draw_buffers
|
||||
public:
|
||||
@ -2187,6 +2200,66 @@ public:
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Package XXX_transform_feedback
|
||||
public:
|
||||
void fBindBufferBase(GLenum target, GLuint index, GLuint buffer)
|
||||
{
|
||||
BEFORE_GL_CALL;
|
||||
ASSERT_SYMBOL_PRESENT(fBindBufferBase);
|
||||
mSymbols.fBindBufferBase(target, index, buffer);
|
||||
AFTER_GL_CALL;
|
||||
}
|
||||
|
||||
void fBindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)
|
||||
{
|
||||
BEFORE_GL_CALL;
|
||||
ASSERT_SYMBOL_PRESENT(fBindBufferRange);
|
||||
mSymbols.fBindBufferRange(target, index, buffer, offset, size);
|
||||
AFTER_GL_CALL;
|
||||
}
|
||||
|
||||
void fBeginTransformFeedback(GLenum primitiveMode)
|
||||
{
|
||||
BEFORE_GL_CALL;
|
||||
ASSERT_SYMBOL_PRESENT(fBeginTransformFeedback);
|
||||
mSymbols.fBeginTransformFeedback(primitiveMode);
|
||||
AFTER_GL_CALL;
|
||||
}
|
||||
|
||||
void fEndTransformFeedback()
|
||||
{
|
||||
BEFORE_GL_CALL;
|
||||
ASSERT_SYMBOL_PRESENT(fEndTransformFeedback);
|
||||
mSymbols.fEndTransformFeedback();
|
||||
AFTER_GL_CALL;
|
||||
}
|
||||
|
||||
void fTransformFeedbackVaryings(GLuint program, GLsizei count, const GLchar* const* varyings, GLenum bufferMode)
|
||||
{
|
||||
BEFORE_GL_CALL;
|
||||
ASSERT_SYMBOL_PRESENT(fTransformFeedbackVaryings);
|
||||
mSymbols.fTransformFeedbackVaryings(program, count, varyings, bufferMode);
|
||||
AFTER_GL_CALL;
|
||||
}
|
||||
|
||||
void fGetTransformFeedbackVarying(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, GLchar* name)
|
||||
{
|
||||
BEFORE_GL_CALL;
|
||||
ASSERT_SYMBOL_PRESENT(fGetTransformFeedbackVarying);
|
||||
mSymbols.fGetTransformFeedbackVarying(program, index, bufSize, length, size, type, name);
|
||||
AFTER_GL_CALL;
|
||||
}
|
||||
|
||||
void fGetIntegeri_v(GLenum param, GLuint index, GLint* values)
|
||||
{
|
||||
BEFORE_GL_CALL;
|
||||
ASSERT_SYMBOL_PRESENT(fGetIntegeri_v);
|
||||
mSymbols.fGetIntegeri_v(param, index, values);
|
||||
AFTER_GL_CALL;
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Package XXX_vertex_array_object
|
||||
public:
|
||||
|
@ -27,6 +27,16 @@ struct ExtensionGroupInfo
|
||||
};
|
||||
|
||||
static const ExtensionGroupInfo sExtensionGroupInfoArr[] = {
|
||||
{
|
||||
"XXX_bind_buffer_offset",
|
||||
0, // OpenGL version
|
||||
0, // OpenGL ES version
|
||||
{
|
||||
GLContext::EXT_transform_feedback,
|
||||
GLContext::NV_transform_feedback,
|
||||
GLContext::Extensions_End
|
||||
}
|
||||
},
|
||||
{
|
||||
"XXX_depth_texture",
|
||||
200, // OpenGL version
|
||||
|
@ -419,6 +419,29 @@ struct GLContextSymbols
|
||||
// ARB_instanced_array
|
||||
typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISOR) (GLuint index, GLuint divisor);
|
||||
PFNGLVERTEXATTRIBDIVISOR fVertexAttribDivisor;
|
||||
|
||||
// EXT_transform_feedback / OpenGL (ES) 3.0
|
||||
typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASE) (GLenum target, GLuint index, GLuint buffer);
|
||||
PFNGLBINDBUFFERBASE fBindBufferBase;
|
||||
typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGE) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
|
||||
PFNGLBINDBUFFERRANGE fBindBufferRange;
|
||||
|
||||
typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACK) (GLenum primitiveMode);
|
||||
PFNGLBEGINTRANSFORMFEEDBACK fBeginTransformFeedback;
|
||||
typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACK) (void);
|
||||
PFNGLENDTRANSFORMFEEDBACK fEndTransformFeedback;
|
||||
|
||||
typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGS) (GLuint program, GLsizei count, const GLchar* const* varyings, GLenum bufferMode);
|
||||
PFNGLTRANSFORMFEEDBACKVARYINGS fTransformFeedbackVaryings;
|
||||
typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYING) (GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, GLchar* name);
|
||||
PFNGLGETTRANSFORMFEEDBACKVARYING fGetTransformFeedbackVarying;
|
||||
|
||||
typedef void (GLAPIENTRY * PFNGLGETINTEGERI_V) (GLenum param, GLuint index, GLint* values);
|
||||
PFNGLGETINTEGERI_V fGetIntegeri_v;
|
||||
|
||||
// EXT_transform_feedback only
|
||||
typedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSET) (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
|
||||
PFNGLBINDBUFFEROFFSET fBindBufferOffset;
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user