st/mesa: don't use resource_copy_region for CopyPixels with conditional render
authorMarek Olšák <maraeo@gmail.com>
Sun, 29 May 2011 04:21:39 +0000 (06:21 +0200)
committerMarek Olšák <maraeo@gmail.com>
Mon, 30 May 2011 08:51:06 +0000 (10:51 +0200)
The conditional rendering should be able to kill CopyPixels.
I assume the render condition has no effect on resource_copy_region.

This fixes piglit:
- NV_conditional_render/copypixels

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/state_tracker/st_cb_drawpixels.c

index 29c1df4ae5c13bbdde13ba4e75972fa9f43ae99d..965fbcd1d9e96076de76bc62e88294602887e31a 100644 (file)
@@ -1247,7 +1247,8 @@ blit_copy_pixels(struct gl_context *ctx, GLint srcx, GLint srcy,
        !ctx->VertexProgram.Enabled &&
        !ctx->Shader.CurrentFragmentProgram &&
        st_fb_orientation(ctx->ReadBuffer) == st_fb_orientation(ctx->DrawBuffer) &&
-       ctx->DrawBuffer->_NumColorDrawBuffers == 1) {
+       ctx->DrawBuffer->_NumColorDrawBuffers == 1 &&
+       !ctx->Query.CondRenderQuery) {
       struct st_renderbuffer *rbRead, *rbDraw;
       GLint drawX, drawY;