X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fcompiler%2Fnir%2Fnir_lower_tex.c;h=1062afd97f012817c1103f034e143da1b8d5e129;hb=956f17395bfcf7f8ce9dd5ac9fd14a13e86f3a8f;hp=bd603cc228845e37c40ea667b9fe17cf07de2c00;hpb=b08b6289943b225b6451e6c8ce331a8c11bd0c7f;p=mesa.git diff --git a/src/compiler/nir/nir_lower_tex.c b/src/compiler/nir/nir_lower_tex.c index bd603cc2288..1062afd97f0 100644 --- a/src/compiler/nir/nir_lower_tex.c +++ b/src/compiler/nir/nir_lower_tex.c @@ -524,10 +524,9 @@ lower_gradient_cube_map(nir_builder *b, nir_tex_instr *tex) } static void -lower_gradient_shadow(nir_builder *b, nir_tex_instr *tex) +lower_gradient(nir_builder *b, nir_tex_instr *tex) { assert(tex->sampler_dim != GLSL_SAMPLER_DIM_CUBE); - assert(tex->is_shadow); assert(tex->op == nir_texop_txd); assert(tex->dest.is_ssa); @@ -809,16 +808,19 @@ nir_lower_tex_block(nir_block *block, nir_builder *b, if (tex->op == nir_texop_txd && tex->sampler_dim == GLSL_SAMPLER_DIM_CUBE && - (options->lower_txd_cube_map || + (options->lower_txd || + options->lower_txd_cube_map || (tex->is_shadow && options->lower_txd_shadow))) { lower_gradient_cube_map(b, tex); progress = true; continue; } - if (tex->op == nir_texop_txd && options->lower_txd_shadow && - tex->is_shadow && tex->sampler_dim != GLSL_SAMPLER_DIM_CUBE) { - lower_gradient_shadow(b, tex); + if (tex->op == nir_texop_txd && + (options->lower_txd || + (options->lower_txd_shadow && + tex->is_shadow && tex->sampler_dim != GLSL_SAMPLER_DIM_CUBE))) { + lower_gradient(b, tex); progress = true; continue; }