Re: [Mesa-dev] [PATCH 1/4] intel/blorp: Fix compiler warning about num_layers.
Lionel Landwerlinwrites: > On 13/03/18 17:38, Eric Anholt wrote: >> 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 >> --- >> 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 1d586e5ef38d..2b8d913fa282 100644 >> --- a/src/mesa/drivers/dri/i965/brw_blorp.c >> +++ b/src/mesa/drivers/dri/i965/brw_blorp.c >> @@ -1408,6 +1408,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; > > I guess if we're going to assign it in both block, better put it > before/after the 2 blocks. > > What's your compiler? :) Just gcc 7.3 signature.asc Description: PGP signature ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/4] intel/blorp: Fix compiler warning about num_layers.
On 13/03/18 17:38, Eric Anholt wrote: 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--- 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 1d586e5ef38d..2b8d913fa282 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp.c +++ b/src/mesa/drivers/dri/i965/brw_blorp.c @@ -1408,6 +1408,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; I guess if we're going to assign it in both block, better put it before/after the 2 blocks. What's your compiler? :) ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 1/4] intel/blorp: Fix compiler warning about num_layers.
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--- 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 1d586e5ef38d..2b8d913fa282 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp.c +++ b/src/mesa/drivers/dri/i965/brw_blorp.c @@ -1408,6 +1408,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.16.2 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev