nir/lower_tex: lower gradients on shadow cube maps if lower_txd_shadow is set
authorIago Toral Quiroga <itoral@igalia.com>
Mon, 12 Dec 2016 12:43:53 +0000 (13:43 +0100)
committerIago Toral Quiroga <itoral@igalia.com>
Tue, 13 Dec 2016 09:33:29 +0000 (10:33 +0100)
Even if lower_txd_cube_map isn't. Suggested by Ken to make the flag more
consistent with its name.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/compiler/nir/nir_lower_tex.c

index 91aa9e174316d8c99d402debc226d623e57de8ac..c67a8eda3f23977532881f6a1957efa1701ca2fc 100644 (file)
@@ -784,8 +784,10 @@ nir_lower_tex_block(nir_block *block, nir_builder *b,
          progress = true;
       }
 
-      if (tex->op == nir_texop_txd && options->lower_txd_cube_map &&
-          tex->sampler_dim == GLSL_SAMPLER_DIM_CUBE) {
+      if (tex->op == nir_texop_txd &&
+          tex->sampler_dim == GLSL_SAMPLER_DIM_CUBE &&
+          (options->lower_txd_cube_map ||
+           (tex->is_shadow && options->lower_txd_shadow))) {
          lower_gradient_cube_map(b, tex);
          progress = true;
          continue;