intel/blorp: Fix compiler warning about num_layers.
authorEric Anholt <eric@anholt.net>
Sat, 10 Feb 2018 10:29:56 +0000 (10:29 +0000)
committerEric Anholt <eric@anholt.net>
Tue, 20 Mar 2018 21:06:46 +0000 (14:06 -0700)
The compiler doesn't notice that the condition for num_layers to be
undefined already defined it above (as our assert checked in a debug
build).

v2: Move the pair of assignments to one outside of the block.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/mesa/drivers/dri/i965/brw_blorp.c

index 72c5d194efec6ea5ba350646f8f368b0be049464..72578b6ea5ccce855e6d8705f0bcbc3b45c9c4ce 100644 (file)
@@ -1426,8 +1426,8 @@ brw_blorp_clear_depth_stencil(struct brw_context *brw,
       } else {
          level = irb->mt_level;
          start_layer = irb->mt_layer;
-         num_layers = fb->MaxNumLayers ? irb->layer_count : 1;
       }
+      num_layers = fb->MaxNumLayers ? irb->layer_count : 1;
 
       stencil_mask = ctx->Stencil.WriteMask[0] & 0xff;