From 67d4a5b15cfd8583c19a5776b0ec1564b60239eb Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Sun, 23 Aug 2009 23:50:27 +0100 Subject: mesa/swrast: use one fewer divide in swrast's choose_cube_face also Same change as for softpipe --- src/mesa/swrast/s_texfilter.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/mesa/swrast') diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index 6b1f934647..216c107e3f 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -1905,8 +1905,12 @@ choose_cube_face(const struct gl_texture_object *texObj, } } - newCoord[0] = ( sc / ma + 1.0F ) * 0.5F; - newCoord[1] = ( tc / ma + 1.0F ) * 0.5F; + { + const float ima = 1.0F / ma; + newCoord[0] = ( sc * ima + 1.0F ) * 0.5F; + newCoord[1] = ( tc * ima + 1.0F ) * 0.5F; + } + return (const struct gl_texture_image **) texObj->Image[face]; } -- cgit v1.2.3 From 077e3de98977ca0046d4f09eb7936f6006719739 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 21 Sep 2009 08:32:43 -0600 Subject: swrast: fix cube face selection If arx and ary are equal, we still want to choose from one of them, and not arz. This is the same as Michal's softpipe fix. --- src/mesa/swrast/s_texfilter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa/swrast') diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index dd59314cd9..ea749c0113 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -1863,7 +1863,7 @@ choose_cube_face(const struct gl_texture_object *texObj, GLuint face; GLfloat sc, tc, ma; - if (arx > ary && arx > arz) { + if (arx >= ary && arx >= arz) { if (rx >= 0.0F) { face = FACE_POS_X; sc = -rz; @@ -1877,7 +1877,7 @@ choose_cube_face(const struct gl_texture_object *texObj, ma = arx; } } - else if (ary > arx && ary > arz) { + else if (ary >= arx && ary >= arz) { if (ry >= 0.0F) { face = FACE_POS_Y; sc = rx; -- cgit v1.2.3 From d504a7669d7b71229c2d15503a095d71ee1584e6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 21 Sep 2009 08:32:43 -0600 Subject: swrast: fix cube face selection If arx and ary are equal, we still want to choose from one of them, and not arz. This is the same as Michal's softpipe fix. --- src/mesa/swrast/s_texfilter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa/swrast') diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index 6b1f934647..efe6f23474 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -1862,7 +1862,7 @@ choose_cube_face(const struct gl_texture_object *texObj, GLuint face; GLfloat sc, tc, ma; - if (arx > ary && arx > arz) { + if (arx >= ary && arx >= arz) { if (rx >= 0.0F) { face = FACE_POS_X; sc = -rz; @@ -1876,7 +1876,7 @@ choose_cube_face(const struct gl_texture_object *texObj, ma = arx; } } - else if (ary > arx && ary > arz) { + else if (ary >= arx && ary >= arz) { if (ry >= 0.0F) { face = FACE_POS_Y; sc = rx; -- cgit v1.2.3 From ad935c3f4708417641dd3c257912ccce11485acc Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 23 Sep 2009 12:54:14 -0600 Subject: swrast: fix typo in partial derivatives parameter passing --- src/mesa/swrast/s_fragprog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa/swrast') diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index b71fb9eae9..144f78b024 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -108,7 +108,7 @@ fetch_texel_deriv( GLcontext *ctx, const GLfloat texcoord[4], lambda = _swrast_compute_lambda(texdx[0], texdy[0], /* ds/dx, ds/dy */ texdx[1], texdy[1], /* dt/dx, dt/dy */ - texdx[3], texdy[2], /* dq/dx, dq/dy */ + texdx[3], texdy[3], /* dq/dx, dq/dy */ texW, texH, texcoord[0], texcoord[1], texcoord[3], 1.0F / texcoord[3]) + lodBias; -- cgit v1.2.3 From 2acd5de22651a3461c0576107c8e8fab1f01469a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 23 Sep 2009 13:35:03 -0600 Subject: swrast: add lod bias when texture sampling Mostly fixes progs/demos/lodbias when MESA_TEX_PROG=1. But the LOD still seems off by -1 or so. May be an issue with the params passed to _swrast_compute_lambda() --- src/mesa/swrast/s_fragprog.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/mesa/swrast') diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index 144f78b024..b326acf3e3 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -89,6 +89,8 @@ fetch_texel_lod( GLcontext *ctx, const GLfloat texcoord[4], GLfloat lambda, * Fetch a texel with the given partial derivatives to compute a level * of detail in the mipmap. * Called via machine->FetchTexelDeriv() + * \param lodBias the lod bias which may be specified by a TXB instruction, + * otherwise zero. */ static void fetch_texel_deriv( GLcontext *ctx, const GLfloat texcoord[4], @@ -96,7 +98,8 @@ fetch_texel_deriv( GLcontext *ctx, const GLfloat texcoord[4], GLfloat lodBias, GLuint unit, GLfloat color[4] ) { SWcontext *swrast = SWRAST_CONTEXT(ctx); - const struct gl_texture_object *texObj = ctx->Texture.Unit[unit]._Current; + const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; + const struct gl_texture_object *texObj = texUnit->_Current; if (texObj) { const struct gl_texture_image *texImg = @@ -111,7 +114,9 @@ fetch_texel_deriv( GLcontext *ctx, const GLfloat texcoord[4], texdx[3], texdy[3], /* dq/dx, dq/dy */ texW, texH, texcoord[0], texcoord[1], texcoord[3], - 1.0F / texcoord[3]) + lodBias; + 1.0F / texcoord[3]); + + lambda += lodBias + texUnit->LodBias + texObj->LodBias; lambda = CLAMP(lambda, texObj->MinLod, texObj->MaxLod); -- cgit v1.2.3 From 42fac11d437d6bf2cb27f9487dedf7fb396616d4 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Tue, 8 Sep 2009 17:45:59 +0800 Subject: mesa/main: New feature FEATURE_queryobj. It merges FEATURE_ARB_occlusion_query and FEATURE_EXT_timer_query, and follows the feature conventions. --- src/mesa/main/api_exec.c | 18 +---------- src/mesa/main/context.c | 10 ++----- src/mesa/main/dlist.c | 8 ++--- src/mesa/main/extensions.c | 2 +- src/mesa/main/mfeatures.h | 3 +- src/mesa/main/queryobj.c | 48 ++++++++++++++++++------------ src/mesa/main/queryobj.h | 59 +++++++++++++++++++++++++------------ src/mesa/state_tracker/st_context.c | 2 +- src/mesa/swrast/s_span.c | 4 --- 9 files changed, 79 insertions(+), 75 deletions(-) (limited to 'src/mesa/swrast') diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c index b7b9aa0bf2..3fe10f1207 100644 --- a/src/mesa/main/api_exec.c +++ b/src/mesa/main/api_exec.c @@ -83,9 +83,7 @@ #include "pixelstore.h" #include "points.h" #include "polygon.h" -#if FEATURE_ARB_occlusion_query || FEATURE_EXT_timer_query #include "queryobj.h" -#endif #include "readpix.h" #include "scissor.h" #include "state.h" @@ -625,16 +623,7 @@ _mesa_init_exec_table(struct _glapi_table *exec) #endif /* ARB 29. GL_ARB_occlusion_query */ -#if FEATURE_ARB_occlusion_query - 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 + _mesa_init_queryobj_dispatch(exec); /* ARB 37. GL_ARB_draw_buffers */ #if FEATURE_draw_read_buffer @@ -744,11 +733,6 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_GenerateMipmapEXT(exec, _mesa_GenerateMipmapEXT); #endif -#if FEATURE_EXT_timer_query - SET_GetQueryObjecti64vEXT(exec, _mesa_GetQueryObjecti64vEXT); - SET_GetQueryObjectui64vEXT(exec, _mesa_GetQueryObjectui64vEXT); -#endif - #if FEATURE_EXT_framebuffer_blit SET_BlitFramebufferEXT(exec, _mesa_BlitFramebufferEXT); #endif diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 17e98ffa30..6994f98504 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -116,9 +116,7 @@ #include "pixelstore.h" #include "points.h" #include "polygon.h" -#if FEATURE_ARB_occlusion_query #include "queryobj.h" -#endif #if FEATURE_ARB_sync #include "syncobj.h" #endif @@ -694,9 +692,7 @@ init_attrib_groups(GLcontext *ctx) _mesa_init_point( ctx ); _mesa_init_polygon( ctx ); _mesa_init_program( ctx ); -#if FEATURE_ARB_occlusion_query - _mesa_init_query( ctx ); -#endif + _mesa_init_queryobj( ctx ); #if FEATURE_ARB_sync _mesa_init_sync( ctx ); #endif @@ -990,9 +986,7 @@ _mesa_free_context_data( GLcontext *ctx ) _mesa_free_colortables_data( ctx ); _mesa_free_program_data(ctx); _mesa_free_shader_state(ctx); -#if FEATURE_ARB_occlusion_query - _mesa_free_query_data(ctx); -#endif + _mesa_free_queryobj_data(ctx); #if FEATURE_ARB_sync _mesa_free_sync_data(ctx); #endif diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index e2b172595c..35f9a3cf03 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -4856,7 +4856,7 @@ save_ProgramStringARB(GLenum target, GLenum format, GLsizei len, #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */ -#if FEATURE_ARB_occlusion_query +#if FEATURE_queryobj static void GLAPIENTRY 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 @@ -7155,7 +7155,7 @@ execute_list(GLcontext *ctx, GLuint list) n[6].f)); break; #endif -#if FEATURE_ARB_occlusion_query +#if FEATURE_queryobj case OPCODE_BEGIN_QUERY_ARB: CALL_BeginQueryARB(ctx->Exec, (n[1].e, n[2].ui)); break; @@ -8924,7 +8924,7 @@ _mesa_init_dlist_table(struct _glapi_table *table) SET_UnmapBufferARB(table, _mesa_UnmapBufferARB); #endif -#if FEATURE_ARB_occlusion_query +#if FEATURE_queryobj SET_BeginQueryARB(table, save_BeginQueryARB); SET_EndQueryARB(table, save_EndQueryARB); SET_GenQueriesARB(table, _mesa_GenQueriesARB); diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 2992abd075..54cf37c5f4 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -215,7 +215,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx) ctx->Extensions.ARB_imaging = GL_TRUE; ctx->Extensions.ARB_map_buffer_range = GL_TRUE; ctx->Extensions.ARB_multitexture = GL_TRUE; -#if FEATURE_ARB_occlusion_query +#if FEATURE_queryobj ctx->Extensions.ARB_occlusion_query = GL_TRUE; #endif ctx->Extensions.ARB_point_sprite = GL_TRUE; diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h index 834b89e6e5..27799771a5 100644 --- a/src/mesa/main/mfeatures.h +++ b/src/mesa/main/mfeatures.h @@ -83,6 +83,7 @@ #define FEATURE_histogram _HAVE_FULL_GL #define FEATURE_pixel_transfer _HAVE_FULL_GL #define FEATURE_point_size_array 0 +#define FEATURE_queryobj _HAVE_FULL_GL #define FEATURE_rastpos _HAVE_FULL_GL #define FEATURE_texgen _HAVE_FULL_GL #define FEATURE_texture_fxt1 _HAVE_FULL_GL @@ -91,7 +92,6 @@ #define FEATURE_vertex_array_byte 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_framebuffer_object _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_pixel_buffer_object _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_NV_fence _HAVE_FULL_GL #define FEATURE_NV_fragment_program _HAVE_FULL_GL diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c index a73c6e0508..f6eb4ee7e1 100644 --- a/src/mesa/main/queryobj.c +++ b/src/mesa/main/queryobj.c @@ -29,6 +29,10 @@ #include "imports.h" #include "queryobj.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) { struct gl_query_object *q; @@ -236,7 +240,6 @@ _mesa_BeginQueryARB(GLenum target, GLuint id) return; } break; -#if FEATURE_EXT_timer_query case GL_TIME_ELAPSED_EXT: if (!ctx->Extensions.EXT_timer_query) { _mesa_error(ctx, GL_INVALID_ENUM, "glBeginQueryARB(target)"); @@ -247,7 +250,6 @@ _mesa_BeginQueryARB(GLenum target, GLuint id) return; } break; -#endif default: _mesa_error(ctx, GL_INVALID_ENUM, "glBeginQueryARB(target)"); return; @@ -285,17 +287,15 @@ _mesa_BeginQueryARB(GLenum target, GLuint id) if (target == GL_SAMPLES_PASSED_ARB) { ctx->Query.CurrentOcclusionObject = q; } -#if FEATURE_EXT_timer_query else if (target == GL_TIME_ELAPSED_EXT) { ctx->Query.CurrentTimerObject = q; } -#endif ctx->Driver.BeginQuery(ctx, q); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_EndQueryARB(GLenum target) { struct gl_query_object *q; @@ -313,7 +313,6 @@ _mesa_EndQueryARB(GLenum target) q = ctx->Query.CurrentOcclusionObject; ctx->Query.CurrentOcclusionObject = NULL; break; -#if FEATURE_EXT_timer_query case GL_TIME_ELAPSED_EXT: if (!ctx->Extensions.EXT_timer_query) { _mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)"); @@ -322,7 +321,6 @@ _mesa_EndQueryARB(GLenum target) q = ctx->Query.CurrentTimerObject; ctx->Query.CurrentTimerObject = NULL; break; -#endif default: _mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)"); return; @@ -354,7 +352,6 @@ _mesa_GetQueryivARB(GLenum target, GLenum pname, GLint *params) } q = ctx->Query.CurrentOcclusionObject; break; -#if FEATURE_EXT_timer_query case GL_TIME_ELAPSED_EXT: if (!ctx->Extensions.EXT_timer_query) { _mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)"); @@ -362,7 +359,6 @@ _mesa_GetQueryivARB(GLenum target, GLenum pname, GLint *params) } q = ctx->Query.CurrentTimerObject; break; -#endif default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryivARB(target)"); return; @@ -462,12 +458,10 @@ _mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params) } -#if FEATURE_EXT_timer_query - /** * New with GL_EXT_timer_query */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params) { struct gl_query_object *q = NULL; @@ -504,7 +498,7 @@ _mesa_GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params) /** * New with GL_EXT_timer_query */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params) { 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. */ void -_mesa_init_query(GLcontext *ctx) +_mesa_init_queryobj(GLcontext *ctx) { -#if FEATURE_ARB_occlusion_query ctx->Query.QueryObjects = _mesa_NewHashTable(); 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. */ void -_mesa_free_query_data(GLcontext *ctx) +_mesa_free_queryobj_data(GLcontext *ctx) { _mesa_HashDeleteAll(ctx->Query.QueryObjects, delete_queryobj_cb, ctx); _mesa_DeleteHashTable(ctx->Query.QueryObjects); diff --git a/src/mesa/main/queryobj.h b/src/mesa/main/queryobj.h index ee775ef959..6cf3c76d74 100644 --- a/src/mesa/main/queryobj.h +++ b/src/mesa/main/queryobj.h @@ -23,19 +23,24 @@ */ -#ifndef OCCLUDE_H -#define OCCLUDE_H +#ifndef QUERYOBJ_H +#define QUERYOBJ_H -extern void -_mesa_init_query(GLcontext *ctx); +#include "main/mtypes.h" -extern void -_mesa_free_query_data(GLcontext *ctx); -extern void -_mesa_init_query_object_functions(struct dd_function_table *driver); +#if FEATURE_queryobj +#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 _mesa_GenQueriesARB(GLsizei n, GLuint *ids); @@ -46,12 +51,6 @@ _mesa_DeleteQueriesARB(GLsizei n, const GLuint *ids); extern GLboolean GLAPIENTRY _mesa_IsQueryARB(GLuint id); -extern void GLAPIENTRY -_mesa_BeginQueryARB(GLenum target, GLuint id); - -extern void GLAPIENTRY -_mesa_EndQueryARB(GLenum target); - extern void GLAPIENTRY _mesa_GetQueryivARB(GLenum target, GLenum pname, GLint *params); @@ -61,11 +60,33 @@ _mesa_GetQueryObjectivARB(GLuint id, GLenum pname, GLint *params); extern void GLAPIENTRY _mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params); -extern void GLAPIENTRY -_mesa_GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params); +extern void +_mesa_init_query_object_functions(struct dd_function_table *driver); -extern void GLAPIENTRY -_mesa_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params); +extern void +_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 */ diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 8514b6b375..96969c736c 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -332,7 +332,7 @@ void st_init_driver_functions(struct dd_function_table *functions) st_init_feedback_functions(functions); #endif st_init_program_functions(functions); -#if FEATURE_ARB_occlusion_query +#if FEATURE_queryobj st_init_query_functions(functions); #endif st_init_readpixels_functions(functions); diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index a45eac438e..704230d1d7 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -904,7 +904,6 @@ _swrast_write_index_span( GLcontext *ctx, SWspan *span) } } -#if FEATURE_ARB_occlusion_query if (ctx->Query.CurrentOcclusionObject) { /* update count of 'passed' fragments */ 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++) q->Result += span->array->mask[i]; } -#endif /* we have to wait until after occlusion to do this test */ 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) { /* update count of 'passed' fragments */ 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++) q->Result += span->array->mask[i]; } -#endif /* We had to wait until now to check for glColorMask(0,0,0,0) because of * the occlusion test. -- cgit v1.2.3 From f741c1eed4559329a89fbf8da569889bbcdace26 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Sat, 3 Oct 2009 18:01:58 +0200 Subject: swrast: Move up state validation in _swrast_ReadPixels. This ensures the driver won't map the wrong set of textures. --- src/mesa/swrast/s_readpix.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mesa/swrast') diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c index 48b9408d24..a1aeb2e01f 100644 --- a/src/mesa/swrast/s_readpix.c +++ b/src/mesa/swrast/s_readpix.c @@ -555,15 +555,15 @@ _swrast_ReadPixels( GLcontext *ctx, SWcontext *swrast = SWRAST_CONTEXT(ctx); struct gl_pixelstore_attrib clippedPacking = *packing; + if (ctx->NewState) + _mesa_update_state(ctx); + /* Need to do swrast_render_start() before clipping or anything else * since this is where a driver may grab the hw lock and get an updated * window size. */ swrast_render_start(ctx); - if (ctx->NewState) - _mesa_update_state(ctx); - if (swrast->NewState) _swrast_validate_derived( ctx ); -- cgit v1.2.3