X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fmain%2Fcondrender.c;h=352e2e2b165dbf8cea6a6e42b3edf840d3d1c844;hb=7f48278edc70ad0841cbee2c46add7653b4fac15;hp=52762133a0ee1c43fd5a7e1e764e9bcb5b64c1ef;hpb=0fbe828c1d2a7e7d9155a3ef64e91da4ec2b79ee;p=mesa.git diff --git a/src/mesa/main/condrender.c b/src/mesa/main/condrender.c index 52762133a0e..352e2e2b165 100644 --- a/src/mesa/main/condrender.c +++ b/src/mesa/main/condrender.c @@ -34,16 +34,17 @@ #include "glheader.h" #include "condrender.h" #include "enums.h" +#include "mtypes.h" #include "queryobj.h" -GLAPI void GLAPIENTRY +void GLAPIENTRY _mesa_BeginConditionalRender(GLuint queryId, GLenum mode) { struct gl_query_object *q; GET_CURRENT_CONTEXT(ctx); - if (ctx->Query.CondRenderQuery) { + if (!ctx->Extensions.NV_conditional_render || ctx->Query.CondRenderQuery) { _mesa_error(ctx, GL_INVALID_OPERATION, "glBeginConditionalRender()"); return; } @@ -84,12 +85,14 @@ _mesa_BeginConditionalRender(GLuint queryId, GLenum mode) } -GLAPI void APIENTRY +void APIENTRY _mesa_EndConditionalRender(void) { GET_CURRENT_CONTEXT(ctx); - if (!ctx->Query.CondRenderQuery) { + FLUSH_VERTICES(ctx, 0x0); + + if (!ctx->Extensions.NV_conditional_render || !ctx->Query.CondRenderQuery) { _mesa_error(ctx, GL_INVALID_OPERATION, "glEndConditionalRender()"); return; } @@ -103,17 +106,19 @@ _mesa_EndConditionalRender(void) /** - * This function is called by software rendering commands to determine if - * subsequent drawing commands should be executed or discarded depending - * on the current conditional rendering state. - * Ideally, this check would be implemented by the GPU when doing hardware - * rendering. - * XXX should this function be called via a new driver hook? + * This function is called by software rendering commands (all point, + * line triangle drawing, glClear, glDrawPixels, glCopyPixels, and + * glBitmap, glBlitFramebuffer) to determine if subsequent drawing + * commands should be + * executed or discarded depending on the current conditional + * rendering state. Ideally, this check would be implemented by the + * GPU when doing hardware rendering. XXX should this function be + * called via a new driver hook? * * \return GL_TRUE if we should render, GL_FALSE if we should discard */ GLboolean -_mesa_check_conditional_render(GLcontext *ctx) +_mesa_check_conditional_render(struct gl_context *ctx) { struct gl_query_object *q = ctx->Query.CondRenderQuery;