Bug 1048720 - WebGL2 - GL symbols for Samplers.; r=jgilbert

--HG--
extra : rebase_source : e166bb27c051843bc469389fddd8fce8ef425ad3
extra : source : 2203b912f17e2f501f9bf65343dfadb05256dfd8
This commit is contained in:
Dan Glastonbury 2014-09-23 15:45:34 +10:00
Родитель ddbb723a3f
Коммит ceeef21bbf
4 изменённых файлов: 142 добавлений и 0 удалений

Просмотреть файл

@ -89,6 +89,7 @@ static const char *sExtensionNames[] = {
"GL_ARB_occlusion_query2",
"GL_ARB_pixel_buffer_object",
"GL_ARB_robustness",
"GL_ARB_sampler_objects",
"GL_ARB_sync",
"GL_ARB_texture_float",
"GL_ARB_texture_non_power_of_two",
@ -900,6 +901,29 @@ GLContext::InitWithPrefix(const char *prefix, bool trygl)
}
}
if (IsSupported(GLFeature::sampler_objects)) {
SymLoadStruct samplerObjectsSymbols[] = {
{ (PRFuncPtr*) &mSymbols.fGenSamplers, { "GenSamplers", nullptr } },
{ (PRFuncPtr*) &mSymbols.fDeleteSamplers, { "DeleteSamplers", nullptr } },
{ (PRFuncPtr*) &mSymbols.fIsSampler, { "IsSampler", nullptr } },
{ (PRFuncPtr*) &mSymbols.fBindSampler, { "BindSampler", nullptr } },
{ (PRFuncPtr*) &mSymbols.fSamplerParameteri, { "SamplerParameteri", nullptr } },
{ (PRFuncPtr*) &mSymbols.fSamplerParameteriv, { "SamplerParameteriv", nullptr } },
{ (PRFuncPtr*) &mSymbols.fSamplerParameterf, { "SamplerParameterf", nullptr } },
{ (PRFuncPtr*) &mSymbols.fSamplerParameterfv, { "SamplerParameterfv", nullptr } },
{ (PRFuncPtr*) &mSymbols.fGetSamplerParameteriv, { "GetSamplerParameteriv", nullptr } },
{ (PRFuncPtr*) &mSymbols.fGetSamplerParameterfv, { "GetSamplerParameterfv", nullptr } },
END_SYMBOLS
};
if (!LoadSymbols(samplerObjectsSymbols, trygl, prefix)) {
NS_ERROR("GL supports sampler objects without supplying its functions.");
MarkUnsupported(GLFeature::sampler_objects);
ClearSymbols(samplerObjectsSymbols);
}
}
if (IsSupported(GLFeature::transform_feedback)) {
SymLoadStruct coreSymbols[] = {
{ (PRFuncPtr*) &mSymbols.fBindBufferBase, { "BindBufferBase", nullptr } },

Просмотреть файл

@ -107,6 +107,7 @@ MOZ_BEGIN_ENUM_CLASS(GLFeature)
renderbuffer_color_half_float,
robustness,
sRGB,
sampler_objects,
standard_derivatives,
texture_float,
texture_float_linear,
@ -362,6 +363,7 @@ public:
ARB_occlusion_query2,
ARB_pixel_buffer_object,
ARB_robustness,
ARB_sampler_objects,
ARB_sync,
ARB_texture_float,
ARB_texture_non_power_of_two,
@ -2704,6 +2706,91 @@ public:
}
// -----------------------------------------------------------------------------
// Core GL & Extension ARB_sampler_objects
public:
void fGenSamplers(GLsizei count, GLuint *samplers)
{
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fGenSamplers);
mSymbols.fGenSamplers(count, samplers);
AFTER_GL_CALL;
}
void fDeleteSamplers(GLsizei count, const GLuint *samplers)
{
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fDeleteSamplers);
mSymbols.fDeleteSamplers(count, samplers);
AFTER_GL_CALL;
}
realGLboolean fIsSampler(GLuint sampler)
{
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fIsSampler);
realGLboolean result = mSymbols.fIsSampler(sampler);
AFTER_GL_CALL;
return result;
}
void fBindSampler(GLuint unit, GLuint sampler)
{
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fBindSampler);
mSymbols.fBindSampler(unit, sampler);
AFTER_GL_CALL;
}
void fSamplerParameteri(GLuint sampler, GLenum pname, GLint param)
{
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fSamplerParameteri);
mSymbols.fSamplerParameteri(sampler, pname, param);
AFTER_GL_CALL;
}
void fSamplerParameteriv(GLuint sampler, GLenum pname, const GLint *param)
{
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fSamplerParameteriv);
mSymbols.fSamplerParameteriv(sampler, pname, param);
AFTER_GL_CALL;
}
void fSamplerParameterf(GLuint sampler, GLenum pname, GLfloat param)
{
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fSamplerParameterf);
mSymbols.fSamplerParameterf(sampler, pname, param);
AFTER_GL_CALL;
}
void fSamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat *param)
{
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fSamplerParameterfv);
mSymbols.fSamplerParameterfv(sampler, pname, param);
AFTER_GL_CALL;
}
void fGetSamplerParameteriv(GLuint sampler, GLenum pname, GLint *params)
{
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fGetSamplerParameteriv);
mSymbols.fGetSamplerParameteriv(sampler, pname, params);
AFTER_GL_CALL;
}
void fGetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat *params)
{
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fGetSamplerParameterfv);
mSymbols.fGetSamplerParameterfv(sampler, pname, params);
AFTER_GL_CALL;
}
// -----------------------------------------------------------------------------
// Core GL & Extension ARB_uniform_buffer_object
public:

Просмотреть файл

@ -380,6 +380,15 @@ static const FeatureInfo sFeatureInfoArr[] = {
GLContext::Extensions_End
}
},
{
"sampler_objects",
330, // OpenGL version
300, // OpenGL ES version
GLContext::ARB_sampler_objects,
{
GLContext::Extensions_End
}
},
{
"standard_derivatives",
200, // OpenGL version

Просмотреть файл

@ -534,6 +534,28 @@ struct GLContextSymbols
typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length);
PFNGLFLUSHMAPPEDBUFFERRANGEPROC fFlushMappedBufferRange;
// sampler_object
typedef void (GLAPIENTRY * PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers);
PFNGLGENSAMPLERSPROC fGenSamplers;
typedef void (GLAPIENTRY * PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint *samplers);
PFNGLDELETESAMPLERSPROC fDeleteSamplers;
typedef realGLboolean (GLAPIENTRY * PFNGLISSAMPLERPROC) (GLuint sampler);
PFNGLISSAMPLERPROC fIsSampler;
typedef void (GLAPIENTRY * PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler);
PFNGLBINDSAMPLERPROC fBindSampler;
typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param);
PFNGLSAMPLERPARAMETERIPROC fSamplerParameteri;
typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint *param);
PFNGLSAMPLERPARAMETERIVPROC fSamplerParameteriv;
typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param);
PFNGLSAMPLERPARAMETERFPROC fSamplerParameterf;
typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat *param);
PFNGLSAMPLERPARAMETERFVPROC fSamplerParameterfv;
typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint *params);
PFNGLGETSAMPLERPARAMETERIVPROC fGetSamplerParameteriv;
typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat *params);
PFNGLGETSAMPLERPARAMETERFVPROC fGetSamplerParameterfv;
// uniform_buffer_object
typedef void (GLAPIENTRY * PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount,
const GLchar* const* uniformNames, GLuint* uniformIndices);