r300g: more efficient finish + fix comments
authorMarek Olšák <maraeo@gmail.com>
Tue, 25 May 2010 23:41:22 +0000 (01:41 +0200)
committerMarek Olšák <maraeo@gmail.com>
Tue, 25 May 2010 23:41:32 +0000 (01:41 +0200)
src/gallium/drivers/r300/r300_context.c
src/gallium/drivers/r300/r300_context.h

index 4721b7d5dc9bf4fa88ae8dedd0b046b26e98a95c..85e45d8647d6b60883df24f2c56a860315e4e952 100644 (file)
@@ -253,11 +253,12 @@ void r300_finish(struct r300_context *r300)
             if (fb->cbufs[i]->texture) {
                 r300->rws->buffer_wait(r300->rws,
                     r300_texture(fb->cbufs[i]->texture)->buffer);
+                return;
             }
-            if (fb->zsbuf) {
-                r300->rws->buffer_wait(r300->rws,
-                    r300_texture(fb->zsbuf->texture)->buffer);
-            }
+        }
+        if (fb->zsbuf && fb->zsbuf->texture) {
+            r300->rws->buffer_wait(r300->rws,
+                r300_texture(fb->zsbuf->texture)->buffer);
         }
     }
 }
index 82183cfcb8b6b980acab88f84fafd487eeffe6ea..efc6df3fabf859464a039be48700f80b81ab887d 100644 (file)
@@ -259,8 +259,8 @@ struct r300_query {
  *
  * This is not a subclass of pipe_fence_handle because pipe_fence_handle is
  * never actually fully defined. So, rather than have it as a member, and do
- * subclass-style casting, we treat pipe_query as an opaque, and just
- * trust that our state tracker does not ever mess up query objects.
+ * subclass-style casting, we treat pipe_fence_handle as an opaque, and just
+ * trust that our state tracker does not ever mess up fence objects.
  */
 struct r300_fence {
     struct pipe_reference reference;