Mesa (master): intel/fs: Don't handle texop_tex for shaders without implicit LOD

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 25 19:51:37 UTC 2019


Module: Mesa
Branch: master
Commit: 055f6281d410aa55ac56169973897000d0e0cd42
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=055f6281d410aa55ac56169973897000d0e0cd42

Author: Caio Marcelo de Oliveira Filho <caio.oliveira at intel.com>
Date:   Thu Apr 18 21:04:57 2019 -0700

intel/fs: Don't handle texop_tex for shaders without implicit LOD

These will be lowered by nir_lower_tex() with the
lower_tex_when_implicit_lod_not_supported, so don't need the extra
handling here.

Reviewed-by: Rob Clark <robdclark at gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>

---

 src/intel/compiler/brw_fs_nir.cpp | 7 +------
 src/intel/compiler/brw_nir.c      | 1 +
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler/brw_fs_nir.cpp
index 59d9926606b..71fe0ff7e2f 100644
--- a/src/intel/compiler/brw_fs_nir.cpp
+++ b/src/intel/compiler/brw_fs_nir.cpp
@@ -5353,15 +5353,10 @@ fs_visitor::nir_emit_texture(const fs_builder &bld, nir_tex_instr *instr)
    srcs[TEX_LOGICAL_SRC_COORD_COMPONENTS] = brw_imm_d(instr->coord_components);
    srcs[TEX_LOGICAL_SRC_GRAD_COMPONENTS] = brw_imm_d(lod_components);
 
-   bool shader_supports_implicit_lod = stage == MESA_SHADER_FRAGMENT ||
-      (stage == MESA_SHADER_COMPUTE &&
-       nir->info.cs.derivative_group != DERIVATIVE_GROUP_NONE);
-
    enum opcode opcode;
    switch (instr->op) {
    case nir_texop_tex:
-      opcode = shader_supports_implicit_lod ?
-         SHADER_OPCODE_TEX_LOGICAL : SHADER_OPCODE_TXL_LOGICAL;
+      opcode = SHADER_OPCODE_TEX_LOGICAL;
       break;
    case nir_texop_txb:
       opcode = FS_OPCODE_TXB_LOGICAL;
diff --git a/src/intel/compiler/brw_nir.c b/src/intel/compiler/brw_nir.c
index e0a393fc298..4a1fbf08c97 100644
--- a/src/intel/compiler/brw_nir.c
+++ b/src/intel/compiler/brw_nir.c
@@ -693,6 +693,7 @@ brw_preprocess_nir(const struct brw_compiler *compiler, nir_shader *nir,
       .lower_txp = ~0,
       .lower_txf_offset = true,
       .lower_rect_offset = true,
+      .lower_tex_without_implicit_lod = true,
       .lower_txd_cube_map = true,
       .lower_txb_shadow_clamp = true,
       .lower_txd_shadow_clamp = true,




More information about the mesa-commit mailing list