[Mesa-dev] [PATCH 05/17] intel/blorp: Fix compiler warning about num_layers.

Eric Anholt eric at anholt.net
Sat Feb 10 16:32:58 UTC 2018


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).

Cc: Jason Ekstrand <jason.ekstrand at intel.com>
---
 src/mesa/drivers/dri/i965/brw_blorp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/mesa/drivers/dri/i965/brw_blorp.c b/src/mesa/drivers/dri/i965/brw_blorp.c
index aa62abde9c41..f483a78b82bf 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp.c
+++ b/src/mesa/drivers/dri/i965/brw_blorp.c
@@ -1404,6 +1404,7 @@ brw_blorp_clear_depth_stencil(struct brw_context *brw,
          assert(level == irb->mt_level);
          assert(start_layer == irb->mt_layer);
          assert(num_layers == fb->MaxNumLayers ? irb->layer_count : 1);
+         num_layers = fb->MaxNumLayers ? irb->layer_count : 1;
       } else {
          level = irb->mt_level;
          start_layer = irb->mt_layer;
-- 
2.15.0



More information about the mesa-dev mailing list