Bug 1048562 - Add support for NV_fence to GLContext. - r=mattwoodrow

This commit is contained in:
Jeff Gilbert 2014-08-04 22:09:20 -07:00
Родитель b120db058e
Коммит 8ac2792c6c
3 изменённых файлов: 99 добавлений и 0 удалений

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

@ -143,6 +143,7 @@ static const char *sExtensionNames[] = {
"GL_OES_compressed_ETC1_RGB8_texture",
"GL_EXT_draw_range_elements",
"GL_EXT_shader_texture_lod",
"GL_NV_fence",
nullptr
};
@ -1075,6 +1076,26 @@ GLContext::InitWithPrefix(const char *prefix, bool trygl)
}
}
if (IsExtensionSupported(NV_fence)) {
SymLoadStruct extSymbols[] = {
{ (PRFuncPtr*) &mSymbols.fGenFences, { "GenFencesNV", nullptr } },
{ (PRFuncPtr*) &mSymbols.fDeleteFences, { "DeleteFencesNV", nullptr } },
{ (PRFuncPtr*) &mSymbols.fSetFence, { "SetFenceNV", nullptr } },
{ (PRFuncPtr*) &mSymbols.fTestFence, { "TestFenceNV", nullptr } },
{ (PRFuncPtr*) &mSymbols.fFinishFence, { "FinishFenceNV", nullptr } },
{ (PRFuncPtr*) &mSymbols.fIsFence, { "IsFenceNV", nullptr } },
{ (PRFuncPtr*) &mSymbols.fGetFenceiv, { "GetFenceivNV", nullptr } },
END_SYMBOLS
};
if (!LoadSymbols(&extSymbols[0], trygl, prefix)) {
NS_ERROR("GL supports NV_fence without supplying its functions.");
MarkExtensionUnsupported(NV_fence);
ClearSymbols(extSymbols);
}
}
// Load developer symbols, don't fail if we can't find them.
SymLoadStruct auxSymbols[] = {
{ (PRFuncPtr*) &mSymbols.fGetTexImage, { "GetTexImage", nullptr } },

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

@ -412,6 +412,7 @@ public:
OES_compressed_ETC1_RGB8_texture,
EXT_draw_range_elements,
EXT_shader_texture_lod,
NV_fence,
Extensions_Max,
Extensions_End
};
@ -2501,6 +2502,67 @@ public:
return ret;
}
// -----------------------------------------------------------------------------
// Extension NV_fence
public:
void fGenFences(GLsizei n, GLuint* fences)
{
ASSERT_SYMBOL_PRESENT(fGenFences);
BEFORE_GL_CALL;
mSymbols.fGenFences(n, fences);
AFTER_GL_CALL;
}
void fDeleteFences(GLsizei n, const GLuint* fences)
{
ASSERT_SYMBOL_PRESENT(fDeleteFences);
BEFORE_GL_CALL;
mSymbols.fDeleteFences(n, fences);
AFTER_GL_CALL;
}
void fSetFence(GLuint fence, GLenum condition)
{
ASSERT_SYMBOL_PRESENT(fSetFence);
BEFORE_GL_CALL;
mSymbols.fSetFence(fence, condition);
AFTER_GL_CALL;
}
realGLboolean fTestFence(GLuint fence)
{
ASSERT_SYMBOL_PRESENT(fTestFence);
BEFORE_GL_CALL;
realGLboolean ret = mSymbols.fTestFence(fence);
AFTER_GL_CALL;
return ret;
}
void fFinishFence(GLuint fence)
{
ASSERT_SYMBOL_PRESENT(fFinishFence);
BEFORE_GL_CALL;
mSymbols.fFinishFence(fence);
AFTER_GL_CALL;
}
realGLboolean fIsFence(GLuint fence)
{
ASSERT_SYMBOL_PRESENT(fIsFence);
BEFORE_GL_CALL;
realGLboolean ret = mSymbols.fIsFence(fence);
AFTER_GL_CALL;
return ret;
}
void fGetFenceiv(GLuint fence, GLenum pname, GLint* params)
{
ASSERT_SYMBOL_PRESENT(fGetFenceiv);
BEFORE_GL_CALL;
mSymbols.fGetFenceiv(fence, pname, params);
AFTER_GL_CALL;
}
// -----------------------------------------------------------------------------
// Constructor

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

@ -497,6 +497,22 @@ struct GLContextSymbols
// draw_range_elements
typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTS) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid* indices);
PFNGLDRAWRANGEELEMENTS fDrawRangeElements;
// NV_fence
typedef void (GLAPIENTRY * pfnGenFencesT) (GLsizei n, GLuint* fences);
pfnGenFencesT fGenFences;
typedef void (GLAPIENTRY * pfnDeleteFencesT) (GLsizei n, const GLuint* fences);
pfnDeleteFencesT fDeleteFences;
typedef void (GLAPIENTRY * pfnSetFenceT) (GLuint fence, GLenum condition);
pfnSetFenceT fSetFence;
typedef realGLboolean (GLAPIENTRY * pfnTestFenceT) (GLuint fence);
pfnTestFenceT fTestFence;
typedef void (GLAPIENTRY * pfnFinishFenceT) (GLuint fence);
pfnFinishFenceT fFinishFence;
typedef realGLboolean (GLAPIENTRY * pfnIsFenceT) (GLuint fence);
pfnIsFenceT fIsFence;
typedef void (GLAPIENTRY * pfnGetFenceivT) (GLuint fence, GLenum pname, GLint* params);
pfnGetFenceivT fGetFenceiv;
};
}