aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/drawpix.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2011-09-29 23:13:44 -0700
committerEric Anholt <[email protected]>2011-10-01 22:16:07 -0700
commite7c2b711a3b01cbeb0bf93d5442599457e7f8f51 (patch)
tree641814c96430487d478587cc1052c91075e03a37 /src/mesa/main/drawpix.c
parent3a1ba094f45b3df9b5b4449fcac926b844aca7a4 (diff)
mesa: Respect GL_RASTERIZER_DISCARD for various meta-type operations.
From the EXT_transform_feedback spec: Primitives can be optionally discarded before rasterization by calling Enable and Disable with RASTERIZER_DISCARD_EXT. When enabled, primitives are discared right before the rasterization stage, but after the optional transform feedback stage. When disabled, primitives are passed through to the rasterization stage to be processed normally. RASTERIZER_DISCARD_EXT applies to the DrawPixels, CopyPixels, Bitmap, Clear and Accum commands as well. And the GL 3.2 spec says it applies to ClearBuffer* as well. Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/drawpix.c')
-rw-r--r--src/mesa/main/drawpix.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c
index b7e2c36e192..412cc15af4e 100644
--- a/src/mesa/main/drawpix.c
+++ b/src/mesa/main/drawpix.c
@@ -80,6 +80,10 @@ _mesa_DrawPixels( GLsizei width, GLsizei height,
goto end; /* the error code was recorded */
}
+ if (ctx->TransformFeedback.RasterDiscard) {
+ goto end;
+ }
+
if (!ctx->Current.RasterPosValid) {
goto end; /* no-op, not an error */
}
@@ -188,6 +192,10 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height,
goto end;
}
+ if (ctx->TransformFeedback.RasterDiscard) {
+ goto end;
+ }
+
if (!ctx->Current.RasterPosValid || width == 0 || height == 0) {
goto end; /* no-op, not an error */
}
@@ -242,6 +250,9 @@ _mesa_Bitmap( GLsizei width, GLsizei height,
return;
}
+ if (ctx->TransformFeedback.RasterDiscard)
+ return;
+
if (ctx->RenderMode == GL_RENDER) {
/* Truncate, to satisfy conformance tests (matches SGI's OpenGL). */
if (width > 0 && height > 0) {