GL3: Remove GL_NV_occlusion_query

--HG--
branch : opengl3
hg/feature/opengl3
kaetemi 11 years ago
parent 2139f39c43
commit 118d6e0966

@ -1664,7 +1664,7 @@ void CDriverGL3::checkTextureOn() const
bool CDriverGL3::supportOcclusionQuery() const
{
H_AUTO_OGL(CDriverGL3_supportOcclusionQuery)
return _Extensions.NVOcclusionQuery;
return true;
}
// ***************************************************************************
@ -1695,10 +1695,9 @@ bool CDriverGL3::supportFrameBufferObject() const
IOcclusionQuery *CDriverGL3::createOcclusionQuery()
{
H_AUTO_OGL(CDriverGL3_createOcclusionQuery)
nlassert(_Extensions.NVOcclusionQuery);
GLuint id;
nglGenOcclusionQueriesNV(1, &id);
nglGenQueries(1, &id);
if (id == 0) return NULL;
COcclusionQueryGL3 *oqgl = new COcclusionQueryGL3;
oqgl->Driver = this;
@ -1722,7 +1721,7 @@ void CDriverGL3::deleteOcclusionQuery(IOcclusionQuery *oq)
oqgl->Driver = NULL;
nlassert(oqgl->ID != 0);
GLuint id = oqgl->ID;
nglDeleteOcclusionQueriesNV(1, &id);
nglDeleteQueries(1, &id);
_OcclusionQueryList.erase(oqgl->Iterator);
if (oqgl == _CurrentOcclusionQuery)
{
@ -1740,7 +1739,7 @@ void COcclusionQueryGL3::begin()
nlassert(Driver);
nlassert(Driver->_CurrentOcclusionQuery == NULL); // only one query at a time
nlassert(ID);
nglBeginOcclusionQueryNV(ID);
nglBeginQuery(GL_SAMPLES_PASSED, ID); // FIXME or GL_ANY_SAMPLES_PASSED
Driver->_CurrentOcclusionQuery = this;
OcclusionType = NotAvailable;
VisibleCount = 0;
@ -1755,7 +1754,7 @@ void COcclusionQueryGL3::end()
nlassert(Driver);
nlassert(Driver->_CurrentOcclusionQuery == this); // only one query at a time
nlassert(ID);
nglEndOcclusionQueryNV();
nglEndQuery(GL_SAMPLES_PASSED);
Driver->_CurrentOcclusionQuery = NULL;
}
@ -1768,18 +1767,13 @@ IOcclusionQuery::TOcclusionType COcclusionQueryGL3::getOcclusionType()
nlassert(Driver);
nlassert(ID);
nlassert(Driver->_CurrentOcclusionQuery != this); // can't query result between a begin/end pair!
if (OcclusionType == NotAvailable)
{
GLuint result;
// retrieve result
nglGetOcclusionQueryuivNV(ID, GL_PIXEL_COUNT_AVAILABLE_NV, &result);
if (result != GL_FALSE)
{
nglGetOcclusionQueryuivNV(ID, GL_PIXEL_COUNT_NV, &result);
nglGetQueryObjectuiv(ID, GL_QUERY_RESULT, &result);
OcclusionType = result != 0 ? NotOccluded : Occluded;
VisibleCount = (uint) result;
// Note : we could return the exact number of pixels that passed the z-test, but this value is not supported by all implementation (Direct3D ...)
}
}
return OcclusionType;

@ -181,18 +181,6 @@ NEL_PFNGLPROGRAMLOCALPARAMETER4FVARBPROC nglGetProgramLocalParameter4fvARB;
//NEL_PFNGLGETPROGRAMSTRINGARBPROC nglGetProgramStringARB;
//NEL_PFNGLISPROGRAMARBPROC nglIsProgramARB;
// GL_ARB_vertex_buffer_object
PFNGLBINDBUFFERPROC nglBindBuffer;
PFNGLDELETEBUFFERSPROC nglDeleteBuffers;
PFNGLGENBUFFERSPROC nglGenBuffers;
PFNGLISBUFFERPROC nglIsBuffer;
PFNGLBUFFERDATAPROC nglBufferData;
PFNGLBUFFERSUBDATAPROC nglBufferSubData;
PFNGLGETBUFFERSUBDATAPROC nglGetBufferSubData;
PFNGLMAPBUFFERPROC nglMapBuffer;
PFNGLUNMAPBUFFERPROC nglUnmapBuffer;
PFNGLGETBUFFERPARAMETERIVPROC nglGetBufferParameteriv;
PFNGLGETBUFFERPOINTERVPROC nglGetBufferPointerv;
// GL_ARB_vertex_program
PFNGLVERTEXATTRIB1SARBPROC nglVertexAttrib1sARB;
@ -258,7 +246,7 @@ PFNGLGETVERTEXATTRIBIVARBPROC nglGetVertexAttribivARB;
PFNGLGETVERTEXATTRIBPOINTERVARBPROC nglGetVertexAttribPointervARB;
PFNGLISPROGRAMARBPROC nglIsProgramARB;
// GL_ARB_Shader_Object
// Core
PFNGLATTACHSHADERPROC nglAttachShader;
PFNGLCOMPILESHADERPROC nglCompileShader;
PFNGLCREATEPROGRAMPROC nglCreateProgram;
@ -309,6 +297,27 @@ PFNGLUNIFORM2UIVPROC nglUniform2uiv;
PFNGLUNIFORM3UIVPROC nglUniform3uiv;
PFNGLUNIFORM4UIVPROC nglUniform4uiv;
PFNGLBINDBUFFERPROC nglBindBuffer;
PFNGLDELETEBUFFERSPROC nglDeleteBuffers;
PFNGLGENBUFFERSPROC nglGenBuffers;
PFNGLISBUFFERPROC nglIsBuffer;
PFNGLBUFFERDATAPROC nglBufferData;
PFNGLBUFFERSUBDATAPROC nglBufferSubData;
PFNGLGETBUFFERSUBDATAPROC nglGetBufferSubData;
PFNGLMAPBUFFERPROC nglMapBuffer;
PFNGLUNMAPBUFFERPROC nglUnmapBuffer;
PFNGLGETBUFFERPARAMETERIVPROC nglGetBufferParameteriv;
PFNGLGETBUFFERPOINTERVPROC nglGetBufferPointerv;
PFNGLGENQUERIESPROC nglGenQueries;
PFNGLDELETEQUERIESPROC nglDeleteQueries;
PFNGLISQUERYPROC nglIsQuery;
PFNGLBEGINQUERYPROC nglBeginQuery;
PFNGLENDQUERYPROC nglEndQuery;
PFNGLGETQUERYIVPROC nglGetQueryiv;
PFNGLGETQUERYOBJECTIVPROC nglGetQueryObjectiv;
PFNGLGETQUERYOBJECTUIVPROC nglGetQueryObjectuiv;
// GL_ARB_separate_shader_objects
PFNGLUSEPROGRAMSTAGESPROC nglUseProgramStages;
PFNGLACTIVESHADERPROGRAMPROC nglActiveShaderProgram;
@ -371,15 +380,6 @@ PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC nglProgramUniformMatrix4x3dv;
PFNGLVALIDATEPROGRAMPIPELINEPROC nglValidateProgramPipeline;
PFNGLGETPROGRAMPIPELINEINFOLOGPROC nglGetProgramPipelineInfoLog;
// NV_occlusion_query
NEL_PFNGLGENOCCLUSIONQUERIESNVPROC nglGenOcclusionQueriesNV;
NEL_PFNGLDELETEOCCLUSIONQUERIESNVPROC nglDeleteOcclusionQueriesNV;
NEL_PFNGLISOCCLUSIONQUERYNVPROC nglIsOcclusionQueryNV;
NEL_PFNGLBEGINOCCLUSIONQUERYNVPROC nglBeginOcclusionQueryNV;
NEL_PFNGLENDOCCLUSIONQUERYNVPROC nglEndOcclusionQueryNV;
NEL_PFNGLGETOCCLUSIONQUERYIVNVPROC nglGetOcclusionQueryivNV;
NEL_PFNGLGETOCCLUSIONQUERYUIVNVPROC nglGetOcclusionQueryuivNV;
// GL_EXT_framebuffer_object
NEL_PFNGLISRENDERBUFFEREXTPROC nglIsRenderbufferEXT;
NEL_PFNGLISFRAMEBUFFEREXTPROC nglIsFramebufferEXT;
@ -693,46 +693,6 @@ static bool setupEXTBlendColor(const char *glext)
return true;
}
// ***************************************************************************
static bool setupARBVertexBufferObject(const char *glext)
{
H_AUTO_OGL(setupARBVertexBufferObject);
CHECK_EXT("GL_ARB_vertex_buffer_object");
CHECK_ADDRESS(PFNGLBINDBUFFERPROC, glBindBuffer);
CHECK_ADDRESS(PFNGLDELETEBUFFERSPROC, glDeleteBuffers);
CHECK_ADDRESS(PFNGLGENBUFFERSPROC, glGenBuffers);
CHECK_ADDRESS(PFNGLISBUFFERPROC, glIsBuffer);
CHECK_ADDRESS(PFNGLBUFFERDATAPROC, glBufferData);
CHECK_ADDRESS(PFNGLBUFFERSUBDATAPROC, glBufferSubData);
CHECK_ADDRESS(PFNGLGETBUFFERSUBDATAPROC, glGetBufferSubData);
CHECK_ADDRESS(PFNGLMAPBUFFERPROC, glMapBuffer);
CHECK_ADDRESS(PFNGLUNMAPBUFFERPROC, glUnmapBuffer);
CHECK_ADDRESS(PFNGLGETBUFFERPARAMETERIVPROC, glGetBufferParameteriv);
CHECK_ADDRESS(PFNGLGETBUFFERPOINTERVPROC, glGetBufferPointerv);
return true;
}
// ***************************************************************************
static bool setupNVOcclusionQuery(const char *glext)
{
H_AUTO_OGL(setupNVOcclusionQuery);
CHECK_EXT("GL_NV_occlusion_query");
CHECK_ADDRESS(NEL_PFNGLGENOCCLUSIONQUERIESNVPROC, glGenOcclusionQueriesNV);
CHECK_ADDRESS(NEL_PFNGLDELETEOCCLUSIONQUERIESNVPROC, glDeleteOcclusionQueriesNV);
CHECK_ADDRESS(NEL_PFNGLISOCCLUSIONQUERYNVPROC, glIsOcclusionQueryNV);
CHECK_ADDRESS(NEL_PFNGLBEGINOCCLUSIONQUERYNVPROC, glBeginOcclusionQueryNV);
CHECK_ADDRESS(NEL_PFNGLENDOCCLUSIONQUERYNVPROC, glEndOcclusionQueryNV);
CHECK_ADDRESS(NEL_PFNGLGETOCCLUSIONQUERYIVNVPROC, glGetOcclusionQueryivNV);
CHECK_ADDRESS(NEL_PFNGLGETOCCLUSIONQUERYUIVNVPROC, glGetOcclusionQueryuivNV);
return true;
}
// ***************************************************************************
static bool setupNVTextureRectangle(const char *glext)
{
@ -824,10 +784,8 @@ static bool setupPackedDepthStencil(const char *glext)
return true;
}
static bool setupARBShaderObjects(const char *glext)
static bool setupCore(const char *glext)
{
CHECK_EXT("GL_ARB_shader_objects");
CHECK_ADDRESS(PFNGLATTACHSHADERPROC, glAttachShader);
CHECK_ADDRESS(PFNGLCOMPILESHADERPROC, glCompileShader);
CHECK_ADDRESS(PFNGLCREATEPROGRAMPROC, glCreateProgram);
@ -878,6 +836,27 @@ static bool setupARBShaderObjects(const char *glext)
CHECK_ADDRESS(PFNGLUNIFORM3UIVPROC, glUniform3uiv);
CHECK_ADDRESS(PFNGLUNIFORM4UIVPROC, glUniform4uiv);
CHECK_ADDRESS(PFNGLBINDBUFFERPROC, glBindBuffer);
CHECK_ADDRESS(PFNGLDELETEBUFFERSPROC, glDeleteBuffers);
CHECK_ADDRESS(PFNGLGENBUFFERSPROC, glGenBuffers);
CHECK_ADDRESS(PFNGLISBUFFERPROC, glIsBuffer);
CHECK_ADDRESS(PFNGLBUFFERDATAPROC, glBufferData);
CHECK_ADDRESS(PFNGLBUFFERSUBDATAPROC, glBufferSubData);
CHECK_ADDRESS(PFNGLGETBUFFERSUBDATAPROC, glGetBufferSubData);
CHECK_ADDRESS(PFNGLMAPBUFFERPROC, glMapBuffer);
CHECK_ADDRESS(PFNGLUNMAPBUFFERPROC, glUnmapBuffer);
CHECK_ADDRESS(PFNGLGETBUFFERPARAMETERIVPROC, glGetBufferParameteriv);
CHECK_ADDRESS(PFNGLGETBUFFERPOINTERVPROC, glGetBufferPointerv);
CHECK_ADDRESS(PFNGLGENQUERIESPROC, glGenQueries);
CHECK_ADDRESS(PFNGLDELETEQUERIESPROC, glDeleteQueries);
CHECK_ADDRESS(PFNGLISQUERYPROC, glIsQuery);
CHECK_ADDRESS(PFNGLBEGINQUERYPROC, glBeginQuery);
CHECK_ADDRESS(PFNGLENDQUERYPROC, glEndQuery);
CHECK_ADDRESS(PFNGLGETQUERYIVPROC, glGetQueryiv);
CHECK_ADDRESS(PFNGLGETQUERYOBJECTIVPROC, glGetQueryObjectiv);
CHECK_ADDRESS(PFNGLGETQUERYOBJECTUIVPROC, glGetQueryObjectuiv);
return true;
}
@ -985,15 +964,12 @@ void registerGlExtensions(CGlExtensions &ext)
DebugLog->displayRaw("\n");
}
// Check GL_ARB_shader_objects
ext.ARBShaderObjects = setupARBShaderObjects(glext);
// Check 3.30 Core
setupCore(glext);
// Check GL_ARB_separate_shader_objects
ext.ARBSeparateShaderObjects = setupARBSeparateShaderObjects(glext);
// Check GL_ARB_vertex_buffer_object
ext.ARBVertexBufferObject = setupARBVertexBufferObject(glext);
// Check ARBMultiTexture
ext.ARBMultiTexture= setupARBMultiTexture(glext);
if (ext.ARBMultiTexture)
@ -1031,9 +1007,6 @@ void registerGlExtensions(CGlExtensions &ext)
// Check EXTBlendColor
ext.EXTBlendColor= setupEXTBlendColor(glext);
// Check NV_occlusion_query
ext.NVOcclusionQuery = setupNVOcclusionQuery(glext);
// Check GL_NV_texture_rectangle
ext.NVTextureRectangle = setupNVTextureRectangle(glext);

@ -36,9 +36,7 @@ struct CGlExtensions
std::string GLVersion;
// Required Extensions.
bool ARBShaderObjects;
bool ARBSeparateShaderObjects;
bool ARBVertexBufferObject;
bool ARBMultiTexture;
uint NbTextureStages;
@ -48,7 +46,6 @@ struct CGlExtensions
bool EXTVertexWeighting;
bool EXTSeparateSpecularColor;
bool ARBTextureCubeMap;
bool NVOcclusionQuery;
bool NVTextureRectangle;
bool EXTTextureRectangle;
bool ARBTextureRectangle;
@ -111,7 +108,6 @@ public:
ARBTextureRectangle = false;
ARBTextureNonPowerOfTwo = false;
ARBMultisample = false;
NVOcclusionQuery = false;
FrameBufferObject = false;
FrameBufferBlit = false;
FrameBufferMultisample = false;
@ -149,7 +145,6 @@ public:
result += EXTSeparateSpecularColor ? "EXTSeparateSpecularColor " : "";
result += EXTSecondaryColor ? "EXTSecondaryColor " : "";
result += EXTBlendColor ? "EXTBlendColor " : "";
result += NVOcclusionQuery ? "NVOcclusionQuery " : "";
result += NVStateVARWithoutFlush ? "NVStateVARWithoutFlush " : "";
result += ARBMultisample ? "ARBMultisample " : "";
@ -342,22 +337,6 @@ extern NEL_PFNGLGETPROGRAMIVARBPROC nglGetProgramivARB;
extern NEL_PFNGLGETPROGRAMSTRINGARBPROC nglGetProgramStringARB;
extern NEL_PFNGLISPROGRAMARBPROC nglIsProgramARB;
// GL_ARB_vertex_buffer_object
//==================================
extern PFNGLBINDBUFFERPROC nglBindBuffer;
extern PFNGLDELETEBUFFERSPROC nglDeleteBuffers;
extern PFNGLGENBUFFERSPROC nglGenBuffers;
extern PFNGLISBUFFERPROC nglIsBuffer;
extern PFNGLBUFFERDATAPROC nglBufferData;
extern PFNGLBUFFERSUBDATAPROC nglBufferSubData;
extern PFNGLGETBUFFERSUBDATAPROC nglGetBufferSubData;
extern PFNGLMAPBUFFERPROC nglMapBuffer;
extern PFNGLUNMAPBUFFERPROC nglUnmapBuffer;
extern PFNGLGETBUFFERPARAMETERIVPROC nglGetBufferParameteriv;
extern PFNGLGETBUFFERPOINTERVPROC nglGetBufferPointerv;
// GL_ARB_vertex_program
//==================================
extern PFNGLVERTEXATTRIB1SARBPROC nglVertexAttrib1sARB;
@ -423,7 +402,7 @@ extern PFNGLGETVERTEXATTRIBIVARBPROC nglGetVertexAttribivARB;
extern PFNGLGETVERTEXATTRIBPOINTERVARBPROC nglGetVertexAttribPointervARB;
extern PFNGLISPROGRAMARBPROC nglIsProgramARB;
// GL_ARB_Shader_Object
// Core
extern PFNGLATTACHSHADERPROC nglAttachShader;
extern PFNGLCOMPILESHADERPROC nglCompileShader;
extern PFNGLCREATEPROGRAMPROC nglCreateProgram;
@ -474,6 +453,27 @@ extern PFNGLUNIFORM2UIVPROC nglUniform2uiv;
extern PFNGLUNIFORM3UIVPROC nglUniform3uiv;
extern PFNGLUNIFORM4UIVPROC nglUniform4uiv;
extern PFNGLBINDBUFFERPROC nglBindBuffer;
extern PFNGLDELETEBUFFERSPROC nglDeleteBuffers;
extern PFNGLGENBUFFERSPROC nglGenBuffers;
extern PFNGLISBUFFERPROC nglIsBuffer;
extern PFNGLBUFFERDATAPROC nglBufferData;
extern PFNGLBUFFERSUBDATAPROC nglBufferSubData;
extern PFNGLGETBUFFERSUBDATAPROC nglGetBufferSubData;
extern PFNGLMAPBUFFERPROC nglMapBuffer;
extern PFNGLUNMAPBUFFERPROC nglUnmapBuffer;
extern PFNGLGETBUFFERPARAMETERIVPROC nglGetBufferParameteriv;
extern PFNGLGETBUFFERPOINTERVPROC nglGetBufferPointerv;
extern PFNGLGENQUERIESPROC nglGenQueries;
extern PFNGLDELETEQUERIESPROC nglDeleteQueries;
extern PFNGLISQUERYPROC nglIsQuery;
extern PFNGLBEGINQUERYPROC nglBeginQuery;
extern PFNGLENDQUERYPROC nglEndQuery;
extern PFNGLGETQUERYIVPROC nglGetQueryiv;
extern PFNGLGETQUERYOBJECTIVPROC nglGetQueryObjectiv;
extern PFNGLGETQUERYOBJECTUIVPROC nglGetQueryObjectuiv;
// GL_ARB_separate_shader_objects
extern PFNGLUSEPROGRAMSTAGESPROC nglUseProgramStages;
extern PFNGLACTIVESHADERPROGRAMPROC nglActiveShaderProgram;
@ -536,18 +536,6 @@ extern PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC nglProgramUniformMatrix4x3dv;
extern PFNGLVALIDATEPROGRAMPIPELINEPROC nglValidateProgramPipeline;
extern PFNGLGETPROGRAMPIPELINEINFOLOGPROC nglGetProgramPipelineInfoLog;
// GL_NV_occlusion_query
//==================================
extern NEL_PFNGLGENOCCLUSIONQUERIESNVPROC nglGenOcclusionQueriesNV;
extern NEL_PFNGLDELETEOCCLUSIONQUERIESNVPROC nglDeleteOcclusionQueriesNV;
extern NEL_PFNGLISOCCLUSIONQUERYNVPROC nglIsOcclusionQueryNV;
extern NEL_PFNGLBEGINOCCLUSIONQUERYNVPROC nglBeginOcclusionQueryNV;
extern NEL_PFNGLENDOCCLUSIONQUERYNVPROC nglEndOcclusionQueryNV;
extern NEL_PFNGLGETOCCLUSIONQUERYIVNVPROC nglGetOcclusionQueryivNV;
extern NEL_PFNGLGETOCCLUSIONQUERYUIVNVPROC nglGetOcclusionQueryuivNV;
#ifdef NL_OS_WINDOWS
// Pbuffer extension

@ -193,19 +193,6 @@ typedef GLvoid (APIENTRY * NEL_PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint
typedef GLvoid (APIENTRY * NEL_PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
#ifndef NL_GL_NV_occlusion_query
#define NL_GL_NV_occlusion_query 1
typedef GLvoid (APIENTRY * NEL_PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids);
typedef GLvoid (APIENTRY * NEL_PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids);
typedef GLboolean (APIENTRY * NEL_PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id);
typedef GLvoid (APIENTRY * NEL_PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id);
typedef GLvoid (APIENTRY * NEL_PFNGLENDOCCLUSIONQUERYNVPROC) ();
typedef GLvoid (APIENTRY * NEL_PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params);
typedef GLvoid (APIENTRY * NEL_PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params);
#endif /* GL_NV_occlusion_query */
#ifndef NL_GL_ARB_multisample
#define NL_GL_ARB_multisample 1
typedef GLvoid (APIENTRY * NEL_PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert);

Loading…
Cancel
Save