i965: Drop a gratuitous "if" that the compiler didn't eliminate at -O2.
authorEric Anholt <eric@anholt.net>
Tue, 17 May 2011 16:20:04 +0000 (09:20 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 31 May 2011 19:07:28 +0000 (12:07 -0700)
Oddly, this increases compiled code size.  (marking the 'if' as likely
also increases code size, but not as much).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/drivers/dri/i965/brw_wm_surface_state.c

index a3111768d62a64c681dcad04102146089c7d7de5..f5c06949c5402ac5d77eac9d57366415ade8d91b 100644 (file)
@@ -539,16 +539,14 @@ prepare_wm_surfaces(struct brw_context *brw)
    int i;
    int nr_surfaces = 0;
 
-   if (ctx->DrawBuffer->_NumColorDrawBuffers >= 1) {
-      for (i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers; i++) {
-        struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[i];
-        struct intel_renderbuffer *irb = intel_renderbuffer(rb);
-        struct intel_region *region = irb ? irb->region : NULL;
-
-        if (region)
-           brw_add_validated_bo(brw, region->buffer);
-        nr_surfaces = SURF_INDEX_DRAW(i) + 1;
-      }
+   for (i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers; i++) {
+      struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[i];
+      struct intel_renderbuffer *irb = intel_renderbuffer(rb);
+      struct intel_region *region = irb ? irb->region : NULL;
+
+      if (region)
+        brw_add_validated_bo(brw, region->buffer);
+      nr_surfaces = SURF_INDEX_DRAW(i) + 1;
    }
 
    if (brw->wm.const_bo) {