зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1048741 - WebGL2 - GL symbols for texture storage.; r=jgilbert
This commit is contained in:
Родитель
8ffb3014ac
Коммит
9bea11e617
|
@ -95,6 +95,7 @@ static const char *sExtensionNames[] = {
|
|||
"GL_ARB_texture_float",
|
||||
"GL_ARB_texture_non_power_of_two",
|
||||
"GL_ARB_texture_rectangle",
|
||||
"GL_ARB_texture_storage",
|
||||
"GL_ARB_transform_feedback2",
|
||||
"GL_ARB_uniform_buffer_object",
|
||||
"GL_ARB_vertex_array_object",
|
||||
|
@ -930,6 +931,22 @@ GLContext::InitWithPrefix(const char *prefix, bool trygl)
|
|||
}
|
||||
}
|
||||
|
||||
if (IsSupported(GLFeature::texture_storage)) {
|
||||
SymLoadStruct coreSymbols[] = {
|
||||
{ (PRFuncPtr*) &mSymbols.fTexStorage2D, { "TexStorage2D", nullptr } },
|
||||
{ (PRFuncPtr*) &mSymbols.fTexStorage3D, { "TexStorage3D", nullptr } },
|
||||
END_SYMBOLS
|
||||
};
|
||||
|
||||
if (!LoadSymbols(coreSymbols, trygl, prefix)) {
|
||||
NS_ERROR("GL supports texture storage without supplying its functions.");
|
||||
|
||||
MarkUnsupported(GLFeature::texture_storage);
|
||||
MarkExtensionUnsupported(ARB_texture_storage);
|
||||
ClearSymbols(coreSymbols);
|
||||
}
|
||||
}
|
||||
|
||||
// ARB_transform_feedback2/NV_transform_feedback2 is a
|
||||
// superset of EXT_transform_feedback/NV_transform_feedback
|
||||
// and adds glPauseTransformFeedback &
|
||||
|
|
|
@ -118,6 +118,7 @@ MOZ_BEGIN_ENUM_CLASS(GLFeature)
|
|||
texture_half_float,
|
||||
texture_half_float_linear,
|
||||
texture_non_power_of_two,
|
||||
texture_storage,
|
||||
transform_feedback2,
|
||||
uniform_buffer_object,
|
||||
uniform_matrix_nonsquare,
|
||||
|
@ -374,6 +375,7 @@ public:
|
|||
ARB_texture_float,
|
||||
ARB_texture_non_power_of_two,
|
||||
ARB_texture_rectangle,
|
||||
ARB_texture_storage,
|
||||
ARB_transform_feedback2,
|
||||
ARB_uniform_buffer_object,
|
||||
ARB_vertex_array_object,
|
||||
|
@ -3066,6 +3068,23 @@ public:
|
|||
AFTER_GL_CALL;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Core GL 4.2, GL ES 3.0 & Extension ARB_texture_storage/EXT_texture_storage
|
||||
void fTexStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
|
||||
{
|
||||
BEFORE_GL_CALL;
|
||||
ASSERT_SYMBOL_PRESENT(fTexStorage2D);
|
||||
mSymbols.fTexStorage2D(target, levels, internalformat, width, height);
|
||||
AFTER_GL_CALL;
|
||||
}
|
||||
|
||||
void fTexStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
|
||||
{
|
||||
BEFORE_GL_CALL;
|
||||
ASSERT_SYMBOL_PRESENT(fTexStorage3D);
|
||||
mSymbols.fTexStorage3D(target, levels, internalformat, width, height, depth);
|
||||
AFTER_GL_CALL;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// 3D Textures
|
||||
|
|
|
@ -508,6 +508,20 @@ static const FeatureInfo sFeatureInfoArr[] = {
|
|||
GLContext::Extensions_End
|
||||
}
|
||||
},
|
||||
{
|
||||
"texture_storage",
|
||||
420, // OpenGL version
|
||||
300, // OpenGL ES version
|
||||
GLContext::ARB_texture_storage,
|
||||
{
|
||||
/*
|
||||
* Not including GL_EXT_texture_storage here because it
|
||||
* doesn't guarantee glTexStorage3D, which is required for
|
||||
* WebGL 2.
|
||||
*/
|
||||
GLContext::Extensions_End
|
||||
}
|
||||
},
|
||||
{
|
||||
"transform_feedback2",
|
||||
400, // OpenGL version
|
||||
|
|
|
@ -580,6 +580,12 @@ struct GLContextSymbols
|
|||
typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat *params);
|
||||
PFNGLGETSAMPLERPARAMETERFVPROC fGetSamplerParameterfv;
|
||||
|
||||
// texture_storage
|
||||
typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
PFNGLTEXSTORAGE2DPROC fTexStorage2D;
|
||||
typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
|
||||
PFNGLTEXSTORAGE3DPROC fTexStorage3D;
|
||||
|
||||
// uniform_buffer_object
|
||||
typedef void (GLAPIENTRY * PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount,
|
||||
const GLchar* const* uniformNames, GLuint* uniformIndices);
|
||||
|
|
Загрузка…
Ссылка в новой задаче