r300g: fix conditional rendering in non-wait path
authorMarek Olšák <maraeo@gmail.com>
Wed, 29 Sep 2010 23:08:58 +0000 (01:08 +0200)
committerMarek Olšák <maraeo@gmail.com>
Thu, 30 Sep 2010 00:44:30 +0000 (02:44 +0200)
NOTE: This is a candidate for the 7.9 branch.

src/gallium/drivers/r300/r300_query.c

index 5b0121ce9e19459f38641a5e1425f35d0acb1bde..5f34fcb274485bd5307d46f2ee83f5fa87eb695b 100644 (file)
@@ -158,7 +158,7 @@ static void r300_render_condition(struct pipe_context *pipe,
                                   uint mode)
 {
     struct r300_context *r300 = r300_context(pipe);
-    uint64_t result;
+    uint64_t result = 0;
     boolean wait;
 
     if (query) {
@@ -167,9 +167,9 @@ static void r300_render_condition(struct pipe_context *pipe,
 
         if (!r300_get_query_result(pipe, query, wait, &result)) {
             r300->skip_rendering = FALSE;
+        } else {
+            r300->skip_rendering = result == 0;
         }
-
-        r300->skip_rendering = result == 0;
     } else {
         r300->skip_rendering = FALSE;
     }