mesa/main: New feature FEATURE_queryobj.
It merges FEATURE_ARB_occlusion_query and FEATURE_EXT_timer_query, and follows the feature conventions.
This commit is contained in:
@@ -83,9 +83,7 @@
|
|||||||
#include "pixelstore.h"
|
#include "pixelstore.h"
|
||||||
#include "points.h"
|
#include "points.h"
|
||||||
#include "polygon.h"
|
#include "polygon.h"
|
||||||
#if FEATURE_ARB_occlusion_query || FEATURE_EXT_timer_query
|
|
||||||
#include "queryobj.h"
|
#include "queryobj.h"
|
||||||
#endif
|
|
||||||
#include "readpix.h"
|
#include "readpix.h"
|
||||||
#include "scissor.h"
|
#include "scissor.h"
|
||||||
#include "state.h"
|
#include "state.h"
|
||||||
@@ -625,16 +623,7 @@ _mesa_init_exec_table(struct _glapi_table *exec)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* ARB 29. GL_ARB_occlusion_query */
|
/* ARB 29. GL_ARB_occlusion_query */
|
||||||
#if FEATURE_ARB_occlusion_query
|
_mesa_init_queryobj_dispatch(exec);
|
||||||
SET_GenQueriesARB(exec, _mesa_GenQueriesARB);
|
|
||||||
SET_DeleteQueriesARB(exec, _mesa_DeleteQueriesARB);
|
|
||||||
SET_IsQueryARB(exec, _mesa_IsQueryARB);
|
|
||||||
SET_BeginQueryARB(exec, _mesa_BeginQueryARB);
|
|
||||||
SET_EndQueryARB(exec, _mesa_EndQueryARB);
|
|
||||||
SET_GetQueryivARB(exec, _mesa_GetQueryivARB);
|
|
||||||
SET_GetQueryObjectivARB(exec, _mesa_GetQueryObjectivARB);
|
|
||||||
SET_GetQueryObjectuivARB(exec, _mesa_GetQueryObjectuivARB);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* ARB 37. GL_ARB_draw_buffers */
|
/* ARB 37. GL_ARB_draw_buffers */
|
||||||
#if FEATURE_draw_read_buffer
|
#if FEATURE_draw_read_buffer
|
||||||
@@ -744,11 +733,6 @@ _mesa_init_exec_table(struct _glapi_table *exec)
|
|||||||
SET_GenerateMipmapEXT(exec, _mesa_GenerateMipmapEXT);
|
SET_GenerateMipmapEXT(exec, _mesa_GenerateMipmapEXT);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if FEATURE_EXT_timer_query
|
|
||||||
SET_GetQueryObjecti64vEXT(exec, _mesa_GetQueryObjecti64vEXT);
|
|
||||||
SET_GetQueryObjectui64vEXT(exec, _mesa_GetQueryObjectui64vEXT);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if FEATURE_EXT_framebuffer_blit
|
#if FEATURE_EXT_framebuffer_blit
|
||||||
SET_BlitFramebufferEXT(exec, _mesa_BlitFramebufferEXT);
|
SET_BlitFramebufferEXT(exec, _mesa_BlitFramebufferEXT);
|
||||||
#endif
|
#endif
|
||||||
|
@@ -116,9 +116,7 @@
|
|||||||
#include "pixelstore.h"
|
#include "pixelstore.h"
|
||||||
#include "points.h"
|
#include "points.h"
|
||||||
#include "polygon.h"
|
#include "polygon.h"
|
||||||
#if FEATURE_ARB_occlusion_query
|
|
||||||
#include "queryobj.h"
|
#include "queryobj.h"
|
||||||
#endif
|
|
||||||
#if FEATURE_ARB_sync
|
#if FEATURE_ARB_sync
|
||||||
#include "syncobj.h"
|
#include "syncobj.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -694,9 +692,7 @@ init_attrib_groups(GLcontext *ctx)
|
|||||||
_mesa_init_point( ctx );
|
_mesa_init_point( ctx );
|
||||||
_mesa_init_polygon( ctx );
|
_mesa_init_polygon( ctx );
|
||||||
_mesa_init_program( ctx );
|
_mesa_init_program( ctx );
|
||||||
#if FEATURE_ARB_occlusion_query
|
_mesa_init_queryobj( ctx );
|
||||||
_mesa_init_query( ctx );
|
|
||||||
#endif
|
|
||||||
#if FEATURE_ARB_sync
|
#if FEATURE_ARB_sync
|
||||||
_mesa_init_sync( ctx );
|
_mesa_init_sync( ctx );
|
||||||
#endif
|
#endif
|
||||||
@@ -990,9 +986,7 @@ _mesa_free_context_data( GLcontext *ctx )
|
|||||||
_mesa_free_colortables_data( ctx );
|
_mesa_free_colortables_data( ctx );
|
||||||
_mesa_free_program_data(ctx);
|
_mesa_free_program_data(ctx);
|
||||||
_mesa_free_shader_state(ctx);
|
_mesa_free_shader_state(ctx);
|
||||||
#if FEATURE_ARB_occlusion_query
|
_mesa_free_queryobj_data(ctx);
|
||||||
_mesa_free_query_data(ctx);
|
|
||||||
#endif
|
|
||||||
#if FEATURE_ARB_sync
|
#if FEATURE_ARB_sync
|
||||||
_mesa_free_sync_data(ctx);
|
_mesa_free_sync_data(ctx);
|
||||||
#endif
|
#endif
|
||||||
|
@@ -4856,7 +4856,7 @@ save_ProgramStringARB(GLenum target, GLenum format, GLsizei len,
|
|||||||
#endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
|
#endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
|
||||||
|
|
||||||
|
|
||||||
#if FEATURE_ARB_occlusion_query
|
#if FEATURE_queryobj
|
||||||
|
|
||||||
static void GLAPIENTRY
|
static void GLAPIENTRY
|
||||||
save_BeginQueryARB(GLenum target, GLuint id)
|
save_BeginQueryARB(GLenum target, GLuint id)
|
||||||
@@ -4890,7 +4890,7 @@ save_EndQueryARB(GLenum target)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* FEATURE_ARB_occlusion_query */
|
#endif /* FEATURE_queryobj */
|
||||||
|
|
||||||
|
|
||||||
static void GLAPIENTRY
|
static void GLAPIENTRY
|
||||||
@@ -7155,7 +7155,7 @@ execute_list(GLcontext *ctx, GLuint list)
|
|||||||
n[6].f));
|
n[6].f));
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if FEATURE_ARB_occlusion_query
|
#if FEATURE_queryobj
|
||||||
case OPCODE_BEGIN_QUERY_ARB:
|
case OPCODE_BEGIN_QUERY_ARB:
|
||||||
CALL_BeginQueryARB(ctx->Exec, (n[1].e, n[2].ui));
|
CALL_BeginQueryARB(ctx->Exec, (n[1].e, n[2].ui));
|
||||||
break;
|
break;
|
||||||
@@ -8924,7 +8924,7 @@ _mesa_init_dlist_table(struct _glapi_table *table)
|
|||||||
SET_UnmapBufferARB(table, _mesa_UnmapBufferARB);
|
SET_UnmapBufferARB(table, _mesa_UnmapBufferARB);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if FEATURE_ARB_occlusion_query
|
#if FEATURE_queryobj
|
||||||
SET_BeginQueryARB(table, save_BeginQueryARB);
|
SET_BeginQueryARB(table, save_BeginQueryARB);
|
||||||
SET_EndQueryARB(table, save_EndQueryARB);
|
SET_EndQueryARB(table, save_EndQueryARB);
|
||||||
SET_GenQueriesARB(table, _mesa_GenQueriesARB);
|
SET_GenQueriesARB(table, _mesa_GenQueriesARB);
|
||||||
|
@@ -215,7 +215,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx)
|
|||||||
ctx->Extensions.ARB_imaging = GL_TRUE;
|
ctx->Extensions.ARB_imaging = GL_TRUE;
|
||||||
ctx->Extensions.ARB_map_buffer_range = GL_TRUE;
|
ctx->Extensions.ARB_map_buffer_range = GL_TRUE;
|
||||||
ctx->Extensions.ARB_multitexture = GL_TRUE;
|
ctx->Extensions.ARB_multitexture = GL_TRUE;
|
||||||
#if FEATURE_ARB_occlusion_query
|
#if FEATURE_queryobj
|
||||||
ctx->Extensions.ARB_occlusion_query = GL_TRUE;
|
ctx->Extensions.ARB_occlusion_query = GL_TRUE;
|
||||||
#endif
|
#endif
|
||||||
ctx->Extensions.ARB_point_sprite = GL_TRUE;
|
ctx->Extensions.ARB_point_sprite = GL_TRUE;
|
||||||
|
@@ -83,6 +83,7 @@
|
|||||||
#define FEATURE_histogram _HAVE_FULL_GL
|
#define FEATURE_histogram _HAVE_FULL_GL
|
||||||
#define FEATURE_pixel_transfer _HAVE_FULL_GL
|
#define FEATURE_pixel_transfer _HAVE_FULL_GL
|
||||||
#define FEATURE_point_size_array 0
|
#define FEATURE_point_size_array 0
|
||||||
|
#define FEATURE_queryobj _HAVE_FULL_GL
|
||||||
#define FEATURE_rastpos _HAVE_FULL_GL
|
#define FEATURE_rastpos _HAVE_FULL_GL
|
||||||
#define FEATURE_texgen _HAVE_FULL_GL
|
#define FEATURE_texgen _HAVE_FULL_GL
|
||||||
#define FEATURE_texture_fxt1 _HAVE_FULL_GL
|
#define FEATURE_texture_fxt1 _HAVE_FULL_GL
|
||||||
@@ -91,7 +92,6 @@
|
|||||||
#define FEATURE_vertex_array_byte 0
|
#define FEATURE_vertex_array_byte 0
|
||||||
#define FEATURE_es2_glsl 0
|
#define FEATURE_es2_glsl 0
|
||||||
|
|
||||||
#define FEATURE_ARB_occlusion_query _HAVE_FULL_GL
|
|
||||||
#define FEATURE_ARB_fragment_program _HAVE_FULL_GL
|
#define FEATURE_ARB_fragment_program _HAVE_FULL_GL
|
||||||
#define FEATURE_ARB_framebuffer_object _HAVE_FULL_GL
|
#define FEATURE_ARB_framebuffer_object _HAVE_FULL_GL
|
||||||
#define FEATURE_ARB_map_buffer_range _HAVE_FULL_GL
|
#define FEATURE_ARB_map_buffer_range _HAVE_FULL_GL
|
||||||
@@ -109,7 +109,6 @@
|
|||||||
#define FEATURE_EXT_framebuffer_object _HAVE_FULL_GL
|
#define FEATURE_EXT_framebuffer_object _HAVE_FULL_GL
|
||||||
#define FEATURE_EXT_pixel_buffer_object _HAVE_FULL_GL
|
#define FEATURE_EXT_pixel_buffer_object _HAVE_FULL_GL
|
||||||
#define FEATURE_EXT_texture_sRGB _HAVE_FULL_GL
|
#define FEATURE_EXT_texture_sRGB _HAVE_FULL_GL
|
||||||
#define FEATURE_EXT_timer_query _HAVE_FULL_GL
|
|
||||||
#define FEATURE_ATI_fragment_shader _HAVE_FULL_GL
|
#define FEATURE_ATI_fragment_shader _HAVE_FULL_GL
|
||||||
#define FEATURE_NV_fence _HAVE_FULL_GL
|
#define FEATURE_NV_fence _HAVE_FULL_GL
|
||||||
#define FEATURE_NV_fragment_program _HAVE_FULL_GL
|
#define FEATURE_NV_fragment_program _HAVE_FULL_GL
|
||||||
|
@@ -29,6 +29,10 @@
|
|||||||
#include "imports.h"
|
#include "imports.h"
|
||||||
#include "queryobj.h"
|
#include "queryobj.h"
|
||||||
#include "mtypes.h"
|
#include "mtypes.h"
|
||||||
|
#include "glapi/dispatch.h"
|
||||||
|
|
||||||
|
|
||||||
|
#if FEATURE_queryobj
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -216,7 +220,7 @@ _mesa_IsQueryARB(GLuint id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GLAPIENTRY
|
static void GLAPIENTRY
|
||||||
_mesa_BeginQueryARB(GLenum target, GLuint id)
|
_mesa_BeginQueryARB(GLenum target, GLuint id)
|
||||||
{
|
{
|
||||||
struct gl_query_object *q;
|
struct gl_query_object *q;
|
||||||
@@ -236,7 +240,6 @@ _mesa_BeginQueryARB(GLenum target, GLuint id)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#if FEATURE_EXT_timer_query
|
|
||||||
case GL_TIME_ELAPSED_EXT:
|
case GL_TIME_ELAPSED_EXT:
|
||||||
if (!ctx->Extensions.EXT_timer_query) {
|
if (!ctx->Extensions.EXT_timer_query) {
|
||||||
_mesa_error(ctx, GL_INVALID_ENUM, "glBeginQueryARB(target)");
|
_mesa_error(ctx, GL_INVALID_ENUM, "glBeginQueryARB(target)");
|
||||||
@@ -247,7 +250,6 @@ _mesa_BeginQueryARB(GLenum target, GLuint id)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
_mesa_error(ctx, GL_INVALID_ENUM, "glBeginQueryARB(target)");
|
_mesa_error(ctx, GL_INVALID_ENUM, "glBeginQueryARB(target)");
|
||||||
return;
|
return;
|
||||||
@@ -285,17 +287,15 @@ _mesa_BeginQueryARB(GLenum target, GLuint id)
|
|||||||
if (target == GL_SAMPLES_PASSED_ARB) {
|
if (target == GL_SAMPLES_PASSED_ARB) {
|
||||||
ctx->Query.CurrentOcclusionObject = q;
|
ctx->Query.CurrentOcclusionObject = q;
|
||||||
}
|
}
|
||||||
#if FEATURE_EXT_timer_query
|
|
||||||
else if (target == GL_TIME_ELAPSED_EXT) {
|
else if (target == GL_TIME_ELAPSED_EXT) {
|
||||||
ctx->Query.CurrentTimerObject = q;
|
ctx->Query.CurrentTimerObject = q;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
ctx->Driver.BeginQuery(ctx, q);
|
ctx->Driver.BeginQuery(ctx, q);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GLAPIENTRY
|
static void GLAPIENTRY
|
||||||
_mesa_EndQueryARB(GLenum target)
|
_mesa_EndQueryARB(GLenum target)
|
||||||
{
|
{
|
||||||
struct gl_query_object *q;
|
struct gl_query_object *q;
|
||||||
@@ -313,7 +313,6 @@ _mesa_EndQueryARB(GLenum target)
|
|||||||
q = ctx->Query.CurrentOcclusionObject;
|
q = ctx->Query.CurrentOcclusionObject;
|
||||||
ctx->Query.CurrentOcclusionObject = NULL;
|
ctx->Query.CurrentOcclusionObject = NULL;
|
||||||
break;
|
break;
|
||||||
#if FEATURE_EXT_timer_query
|
|
||||||
case GL_TIME_ELAPSED_EXT:
|
case GL_TIME_ELAPSED_EXT:
|
||||||
if (!ctx->Extensions.EXT_timer_query) {
|
if (!ctx->Extensions.EXT_timer_query) {
|
||||||
_mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)");
|
_mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)");
|
||||||
@@ -322,7 +321,6 @@ _mesa_EndQueryARB(GLenum target)
|
|||||||
q = ctx->Query.CurrentTimerObject;
|
q = ctx->Query.CurrentTimerObject;
|
||||||
ctx->Query.CurrentTimerObject = NULL;
|
ctx->Query.CurrentTimerObject = NULL;
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
_mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)");
|
_mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)");
|
||||||
return;
|
return;
|
||||||
@@ -354,7 +352,6 @@ _mesa_GetQueryivARB(GLenum target, GLenum pname, GLint *params)
|
|||||||
}
|
}
|
||||||
q = ctx->Query.CurrentOcclusionObject;
|
q = ctx->Query.CurrentOcclusionObject;
|
||||||
break;
|
break;
|
||||||
#if FEATURE_EXT_timer_query
|
|
||||||
case GL_TIME_ELAPSED_EXT:
|
case GL_TIME_ELAPSED_EXT:
|
||||||
if (!ctx->Extensions.EXT_timer_query) {
|
if (!ctx->Extensions.EXT_timer_query) {
|
||||||
_mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)");
|
_mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)");
|
||||||
@@ -362,7 +359,6 @@ _mesa_GetQueryivARB(GLenum target, GLenum pname, GLint *params)
|
|||||||
}
|
}
|
||||||
q = ctx->Query.CurrentTimerObject;
|
q = ctx->Query.CurrentTimerObject;
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
_mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryivARB(target)");
|
_mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryivARB(target)");
|
||||||
return;
|
return;
|
||||||
@@ -462,12 +458,10 @@ _mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if FEATURE_EXT_timer_query
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* New with GL_EXT_timer_query
|
* New with GL_EXT_timer_query
|
||||||
*/
|
*/
|
||||||
void GLAPIENTRY
|
static void GLAPIENTRY
|
||||||
_mesa_GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params)
|
_mesa_GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params)
|
||||||
{
|
{
|
||||||
struct gl_query_object *q = NULL;
|
struct gl_query_object *q = NULL;
|
||||||
@@ -504,7 +498,7 @@ _mesa_GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params)
|
|||||||
/**
|
/**
|
||||||
* New with GL_EXT_timer_query
|
* New with GL_EXT_timer_query
|
||||||
*/
|
*/
|
||||||
void GLAPIENTRY
|
static void GLAPIENTRY
|
||||||
_mesa_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params)
|
_mesa_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params)
|
||||||
{
|
{
|
||||||
struct gl_query_object *q = NULL;
|
struct gl_query_object *q = NULL;
|
||||||
@@ -537,19 +531,35 @@ _mesa_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* FEATURE_EXT_timer_query */
|
|
||||||
|
void
|
||||||
|
_mesa_init_queryobj_dispatch(struct _glapi_table *disp)
|
||||||
|
{
|
||||||
|
SET_GenQueriesARB(disp, _mesa_GenQueriesARB);
|
||||||
|
SET_DeleteQueriesARB(disp, _mesa_DeleteQueriesARB);
|
||||||
|
SET_IsQueryARB(disp, _mesa_IsQueryARB);
|
||||||
|
SET_BeginQueryARB(disp, _mesa_BeginQueryARB);
|
||||||
|
SET_EndQueryARB(disp, _mesa_EndQueryARB);
|
||||||
|
SET_GetQueryivARB(disp, _mesa_GetQueryivARB);
|
||||||
|
SET_GetQueryObjectivARB(disp, _mesa_GetQueryObjectivARB);
|
||||||
|
SET_GetQueryObjectuivARB(disp, _mesa_GetQueryObjectuivARB);
|
||||||
|
|
||||||
|
SET_GetQueryObjecti64vEXT(disp, _mesa_GetQueryObjecti64vEXT);
|
||||||
|
SET_GetQueryObjectui64vEXT(disp, _mesa_GetQueryObjectui64vEXT);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* FEATURE_queryobj */
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allocate/init the context state related to query objects.
|
* Allocate/init the context state related to query objects.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
_mesa_init_query(GLcontext *ctx)
|
_mesa_init_queryobj(GLcontext *ctx)
|
||||||
{
|
{
|
||||||
#if FEATURE_ARB_occlusion_query
|
|
||||||
ctx->Query.QueryObjects = _mesa_NewHashTable();
|
ctx->Query.QueryObjects = _mesa_NewHashTable();
|
||||||
ctx->Query.CurrentOcclusionObject = NULL;
|
ctx->Query.CurrentOcclusionObject = NULL;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -569,7 +579,7 @@ delete_queryobj_cb(GLuint id, void *data, void *userData)
|
|||||||
* Free the context state related to query objects.
|
* Free the context state related to query objects.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
_mesa_free_query_data(GLcontext *ctx)
|
_mesa_free_queryobj_data(GLcontext *ctx)
|
||||||
{
|
{
|
||||||
_mesa_HashDeleteAll(ctx->Query.QueryObjects, delete_queryobj_cb, ctx);
|
_mesa_HashDeleteAll(ctx->Query.QueryObjects, delete_queryobj_cb, ctx);
|
||||||
_mesa_DeleteHashTable(ctx->Query.QueryObjects);
|
_mesa_DeleteHashTable(ctx->Query.QueryObjects);
|
||||||
|
@@ -23,19 +23,24 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef OCCLUDE_H
|
#ifndef QUERYOBJ_H
|
||||||
#define OCCLUDE_H
|
#define QUERYOBJ_H
|
||||||
|
|
||||||
|
|
||||||
extern void
|
#include "main/mtypes.h"
|
||||||
_mesa_init_query(GLcontext *ctx);
|
|
||||||
|
|
||||||
extern void
|
|
||||||
_mesa_free_query_data(GLcontext *ctx);
|
|
||||||
|
|
||||||
extern void
|
#if FEATURE_queryobj
|
||||||
_mesa_init_query_object_functions(struct dd_function_table *driver);
|
|
||||||
|
|
||||||
|
#define _MESA_INIT_QUERYOBJ_FUNCTIONS(driver, impl) \
|
||||||
|
do { \
|
||||||
|
(driver)->NewQueryObject = impl ## NewQueryObject; \
|
||||||
|
(driver)->DeleteQuery = impl ## DeleteQuery; \
|
||||||
|
(driver)->BeginQuery = impl ## BeginQuery; \
|
||||||
|
(driver)->EndQuery = impl ## EndQuery; \
|
||||||
|
(driver)->WaitQuery = impl ## WaitQuery; \
|
||||||
|
(driver)->CheckQuery = impl ## CheckQuery; \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
extern void GLAPIENTRY
|
extern void GLAPIENTRY
|
||||||
_mesa_GenQueriesARB(GLsizei n, GLuint *ids);
|
_mesa_GenQueriesARB(GLsizei n, GLuint *ids);
|
||||||
@@ -46,12 +51,6 @@ _mesa_DeleteQueriesARB(GLsizei n, const GLuint *ids);
|
|||||||
extern GLboolean GLAPIENTRY
|
extern GLboolean GLAPIENTRY
|
||||||
_mesa_IsQueryARB(GLuint id);
|
_mesa_IsQueryARB(GLuint id);
|
||||||
|
|
||||||
extern void GLAPIENTRY
|
|
||||||
_mesa_BeginQueryARB(GLenum target, GLuint id);
|
|
||||||
|
|
||||||
extern void GLAPIENTRY
|
|
||||||
_mesa_EndQueryARB(GLenum target);
|
|
||||||
|
|
||||||
extern void GLAPIENTRY
|
extern void GLAPIENTRY
|
||||||
_mesa_GetQueryivARB(GLenum target, GLenum pname, GLint *params);
|
_mesa_GetQueryivARB(GLenum target, GLenum pname, GLint *params);
|
||||||
|
|
||||||
@@ -61,11 +60,33 @@ _mesa_GetQueryObjectivARB(GLuint id, GLenum pname, GLint *params);
|
|||||||
extern void GLAPIENTRY
|
extern void GLAPIENTRY
|
||||||
_mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params);
|
_mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params);
|
||||||
|
|
||||||
extern void GLAPIENTRY
|
extern void
|
||||||
_mesa_GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params);
|
_mesa_init_query_object_functions(struct dd_function_table *driver);
|
||||||
|
|
||||||
extern void GLAPIENTRY
|
extern void
|
||||||
_mesa_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params);
|
_mesa_init_queryobj_dispatch(struct _glapi_table *disp);
|
||||||
|
|
||||||
|
#else /* FEATURE_queryobj */
|
||||||
|
|
||||||
|
#define _MESA_INIT_QUERYOBJ_FUNCTIONS(driver, impl) do { } while (0)
|
||||||
|
|
||||||
|
static INLINE void
|
||||||
|
_mesa_init_query_object_functions(struct dd_function_table *driver)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static INLINE void
|
||||||
|
_mesa_init_queryobj_dispatch(struct _glapi_table *disp)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* FEATURE_queryobj */
|
||||||
|
|
||||||
|
extern void
|
||||||
|
_mesa_init_queryobj(GLcontext *ctx);
|
||||||
|
|
||||||
|
extern void
|
||||||
|
_mesa_free_queryobj_data(GLcontext *ctx);
|
||||||
|
|
||||||
|
|
||||||
#endif /* OCCLUDE_H */
|
#endif /* QUERYOBJ_H */
|
||||||
|
@@ -332,7 +332,7 @@ void st_init_driver_functions(struct dd_function_table *functions)
|
|||||||
st_init_feedback_functions(functions);
|
st_init_feedback_functions(functions);
|
||||||
#endif
|
#endif
|
||||||
st_init_program_functions(functions);
|
st_init_program_functions(functions);
|
||||||
#if FEATURE_ARB_occlusion_query
|
#if FEATURE_queryobj
|
||||||
st_init_query_functions(functions);
|
st_init_query_functions(functions);
|
||||||
#endif
|
#endif
|
||||||
st_init_readpixels_functions(functions);
|
st_init_readpixels_functions(functions);
|
||||||
|
@@ -904,7 +904,6 @@ _swrast_write_index_span( GLcontext *ctx, SWspan *span)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if FEATURE_ARB_occlusion_query
|
|
||||||
if (ctx->Query.CurrentOcclusionObject) {
|
if (ctx->Query.CurrentOcclusionObject) {
|
||||||
/* update count of 'passed' fragments */
|
/* update count of 'passed' fragments */
|
||||||
struct gl_query_object *q = ctx->Query.CurrentOcclusionObject;
|
struct gl_query_object *q = ctx->Query.CurrentOcclusionObject;
|
||||||
@@ -912,7 +911,6 @@ _swrast_write_index_span( GLcontext *ctx, SWspan *span)
|
|||||||
for (i = 0; i < span->end; i++)
|
for (i = 0; i < span->end; i++)
|
||||||
q->Result += span->array->mask[i];
|
q->Result += span->array->mask[i];
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* we have to wait until after occlusion to do this test */
|
/* we have to wait until after occlusion to do this test */
|
||||||
if (ctx->Color.IndexMask == 0) {
|
if (ctx->Color.IndexMask == 0) {
|
||||||
@@ -1376,7 +1374,6 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if FEATURE_ARB_occlusion_query
|
|
||||||
if (ctx->Query.CurrentOcclusionObject) {
|
if (ctx->Query.CurrentOcclusionObject) {
|
||||||
/* update count of 'passed' fragments */
|
/* update count of 'passed' fragments */
|
||||||
struct gl_query_object *q = ctx->Query.CurrentOcclusionObject;
|
struct gl_query_object *q = ctx->Query.CurrentOcclusionObject;
|
||||||
@@ -1384,7 +1381,6 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span)
|
|||||||
for (i = 0; i < span->end; i++)
|
for (i = 0; i < span->end; i++)
|
||||||
q->Result += span->array->mask[i];
|
q->Result += span->array->mask[i];
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* We had to wait until now to check for glColorMask(0,0,0,0) because of
|
/* We had to wait until now to check for glColorMask(0,0,0,0) because of
|
||||||
* the occlusion test.
|
* the occlusion test.
|
||||||
|
Reference in New Issue
Block a user