Module: Mesa
Branch: staging/20.2
Commit: e12a581a3ac80b753d4516fc4535b6983c5a1104
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e12a581a3ac80b753d4516fc4535b6983c5a1104

Author: Samuel Pitoiset <[email protected]>
Date:   Wed Oct 21 18:25:56 2020 +0200

aco: fix determining if LOD is zero for nir_texop_txf/nir_texop_txs

txf/txs expects LOD to be a 32-bit unsigned integer while other
texture operations expects a float.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3668
Fixes: 93c8ebfa780 ("aco: Initial commit of independent AMD compiler")
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7256>
(cherry picked from commit 4e2fe34aa9944612f2224188317a4ad2aee8035b)

---

 .pick_status.json                              | 2 +-
 src/amd/compiler/aco_instruction_selection.cpp | 4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index ade1d384c4f..bcb452a1d3c 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1282,7 +1282,7 @@
         "description": "aco: fix determining if LOD is zero for 
nir_texop_txf/nir_texop_txs",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": "93c8ebfa780ebd1495095e794731881aef29e7d3"
     },
diff --git a/src/amd/compiler/aco_instruction_selection.cpp 
b/src/amd/compiler/aco_instruction_selection.cpp
index f05737a6360..8b716841710 100644
--- a/src/amd/compiler/aco_instruction_selection.cpp
+++ b/src/amd/compiler/aco_instruction_selection.cpp
@@ -8514,9 +8514,7 @@ void visit_tex(isel_context *ctx, nir_tex_instr *instr)
          has_bias = true;
          break;
       case nir_tex_src_lod: {
-         nir_const_value *val = nir_src_as_const_value(instr->src[i].src);
-
-         if (val && val->f32 <= 0.0) {
+         if (nir_src_is_const(instr->src[i].src) && 
nir_src_as_uint(instr->src[i].src) == 0) {
             level_zero = true;
          } else {
             lod = get_ssa_temp(ctx, instr->src[i].src.ssa);

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to