зеркало из https://github.com/mozilla/gecko-dev.git
Bug 982960 - Add GLContext support for draw_range_elements. r=kamidphish
This commit is contained in:
Родитель
64a40ca5d4
Коммит
18eef3b4d4
|
@ -138,6 +138,7 @@ static const char *sExtensionNames[] = {
|
|||
"GL_ARB_half_float_pixel",
|
||||
"GL_EXT_frag_depth",
|
||||
"GL_OES_compressed_ETC1_RGB8_texture",
|
||||
"GL_EXT_draw_range_elements",
|
||||
nullptr
|
||||
};
|
||||
|
||||
|
@ -1073,6 +1074,20 @@ GLContext::InitWithPrefix(const char *prefix, bool trygl)
|
|||
}
|
||||
}
|
||||
|
||||
if (IsSupported(GLFeature::draw_range_elements)) {
|
||||
SymLoadStruct imageSymbols[] = {
|
||||
{ (PRFuncPtr*) &mSymbols.fDrawRangeElements, { "DrawRangeElementsEXT", "DrawRangeElements", nullptr } },
|
||||
{ nullptr, { nullptr } },
|
||||
};
|
||||
|
||||
if (!LoadSymbols(&imageSymbols[0], trygl, prefix)) {
|
||||
NS_ERROR("GL supports draw_range_elements without supplying its functions.");
|
||||
|
||||
MarkUnsupported(GLFeature::draw_range_elements);
|
||||
mSymbols.fDrawRangeElements = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
// Load developer symbols, don't fail if we can't find them.
|
||||
SymLoadStruct auxSymbols[] = {
|
||||
{ (PRFuncPtr*) &mSymbols.fGetTexImage, { "GetTexImage", nullptr } },
|
||||
|
|
|
@ -87,6 +87,7 @@ MOZ_BEGIN_ENUM_CLASS(GLFeature)
|
|||
depth_texture,
|
||||
draw_buffers,
|
||||
draw_instanced,
|
||||
draw_range_elements,
|
||||
element_index_uint,
|
||||
ES2_compatibility,
|
||||
ES3_compatibility,
|
||||
|
@ -419,6 +420,7 @@ public:
|
|||
ARB_half_float_pixel,
|
||||
EXT_frag_depth,
|
||||
OES_compressed_ETC1_RGB8_texture,
|
||||
EXT_draw_range_elements,
|
||||
Extensions_Max,
|
||||
Extensions_End
|
||||
};
|
||||
|
@ -2228,6 +2230,17 @@ public:
|
|||
AfterGLDrawCall();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Feature draw_range_elements
|
||||
public:
|
||||
void fDrawRangeElements(GLenum mode, GLuint start, GLuint end,
|
||||
GLsizei count, GLenum type, const GLvoid* indices)
|
||||
{
|
||||
BEFORE_GL_CALL;
|
||||
ASSERT_SYMBOL_PRESENT(fDrawRangeElements);
|
||||
mSymbols.fDrawRangeElements(mode, start, end, count, type, indices);
|
||||
AFTER_GL_CALL;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Package XXX_framebuffer_blit
|
||||
|
@ -2698,7 +2711,7 @@ protected:
|
|||
// storage to support DebugMode on an arbitrary thread.
|
||||
static unsigned sCurrentGLContextTLS;
|
||||
#endif
|
||||
|
||||
|
||||
ScopedDeletePtr<GLBlitHelper> mBlitHelper;
|
||||
ScopedDeletePtr<GLBlitTextureImageHelper> mBlitTextureImageHelper;
|
||||
ScopedDeletePtr<GLReadTexImageHelper> mReadTexImageHelper;
|
||||
|
|
|
@ -84,6 +84,15 @@ static const FeatureInfo sFeatureInfoArr[] = {
|
|||
GLContext::Extensions_End
|
||||
}
|
||||
},
|
||||
{
|
||||
"draw_range_elements",
|
||||
200, // OpenGL version
|
||||
300, // OpenGL ES version
|
||||
{
|
||||
GLContext::EXT_draw_range_elements,
|
||||
GLContext::Extensions_End
|
||||
}
|
||||
},
|
||||
{
|
||||
"element_index_uint",
|
||||
200, // OpenGL version
|
||||
|
|
|
@ -493,6 +493,10 @@ struct GLContextSymbols
|
|||
PFNGLOBJECTPTRLABEL fObjectPtrLabel;
|
||||
typedef void (GLAPIENTRY * PFNGLGETOBJECTPTRLABEL) (const GLvoid* ptr, GLsizei bufSize, GLsizei* length, GLchar* label);
|
||||
PFNGLGETOBJECTPTRLABEL fGetObjectPtrLabel;
|
||||
|
||||
// draw_range_elements
|
||||
typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTS) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid* indices);
|
||||
PFNGLDRAWRANGEELEMENTS fDrawRangeElements;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче