aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/condrender.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-01-15 21:37:10 +0100
committermarha <marha@users.sourceforge.net>2014-01-15 21:37:10 +0100
commitb7f01cb1f6cfd1ec301f650a073436c91ec614aa (patch)
tree1dbf32344313ad7e5884e6686251cad398a231fa /mesalib/src/mesa/main/condrender.c
parent7b4b94b4449aec056c4c92f5cacc2f89a292a80e (diff)
parent1b0fcca503ae9cf2d462b60770f96c794dfbb27a (diff)
downloadvcxsrv-b7f01cb1f6cfd1ec301f650a073436c91ec614aa.tar.gz
vcxsrv-b7f01cb1f6cfd1ec301f650a073436c91ec614aa.tar.bz2
vcxsrv-b7f01cb1f6cfd1ec301f650a073436c91ec614aa.zip
Merge remote-tracking branch 'origin/released'
* origin/released: mesa xkeyboard-config xserver git update 15 jan 2014 randrproto libfontenc mesa xserver git update 10 Jan 2014 randsrproto fontconfig libX11 git update 6 Jan 2014 Conflicts: mesalib/src/glsl/builtin_functions.cpp mesalib/src/glsl/ir_builder.h xorg-server/Xext/xres.c xorg-server/dix/dispatch.c xorg-server/dix/dixfonts.c xorg-server/hw/xwin/wingc.c xorg-server/hw/xwin/winwindowswm.c xorg-server/include/gc.h xorg-server/os/access.c
Diffstat (limited to 'mesalib/src/mesa/main/condrender.c')
-rw-r--r--mesalib/src/mesa/main/condrender.c41
1 files changed, 30 insertions, 11 deletions
diff --git a/mesalib/src/mesa/main/condrender.c b/mesalib/src/mesa/main/condrender.c
index 2632f7a1a..0ad1e5c2a 100644
--- a/mesalib/src/mesa/main/condrender.c
+++ b/mesalib/src/mesa/main/condrender.c
@@ -40,17 +40,38 @@
void GLAPIENTRY
_mesa_BeginConditionalRender(GLuint queryId, GLenum mode)
{
- struct gl_query_object *q;
+ struct gl_query_object *q = NULL;
GET_CURRENT_CONTEXT(ctx);
- if (!ctx->Extensions.NV_conditional_render || ctx->Query.CondRenderQuery ||
- queryId == 0) {
+ /* Section 2.14 (Conditional Rendering) of the OpenGL 3.0 spec says:
+ *
+ * "If BeginConditionalRender is called while conditional rendering is
+ * in progress, or if EndConditionalRender is called while conditional
+ * rendering is not in progress, the error INVALID_OPERATION is
+ * generated."
+ */
+ if (!ctx->Extensions.NV_conditional_render || ctx->Query.CondRenderQuery) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glBeginConditionalRender()");
return;
}
ASSERT(ctx->Query.CondRenderMode == GL_NONE);
+ /* Section 2.14 (Conditional Rendering) of the OpenGL 3.0 spec says:
+ *
+ * "The error INVALID_VALUE is generated if <id> is not the name of an
+ * existing query object query."
+ */
+ if (queryId != 0)
+ q = _mesa_lookup_query_object(ctx, queryId);
+
+ if (!q) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glBeginConditionalRender(bad queryId=%u)", queryId);
+ return;
+ }
+ ASSERT(q->Id == queryId);
+
switch (mode) {
case GL_QUERY_WAIT:
case GL_QUERY_NO_WAIT:
@@ -64,14 +85,12 @@ _mesa_BeginConditionalRender(GLuint queryId, GLenum mode)
return;
}
- q = _mesa_lookup_query_object(ctx, queryId);
- if (!q) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glBeginConditionalRender(bad queryId=%u)", queryId);
- return;
- }
- ASSERT(q->Id == queryId);
-
+ /* Section 2.14 (Conditional Rendering) of the OpenGL 3.0 spec says:
+ *
+ * "The error INVALID_OPERATION is generated if <id> is the name of a
+ * query object with a target other than SAMPLES_PASSED, or <id> is the
+ * name of a query currently in progress."
+ */
if ((q->Target != GL_SAMPLES_PASSED &&
q->Target != GL_ANY_SAMPLES_PASSED &&
q->Target != GL_ANY_SAMPLES_PASSED_CONSERVATIVE) || q->Active) {