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

Author: Roland Scheidegger <srol...@vmware.com>
Date:   Wed Mar 30 04:25:45 2016 +0200

tgsi: (trivial) only verify target for is_tex instructions

d3d10 state tracker does not encode (valid) target (only offsets are
really used from the texture bits), since that information always comes
from the sview dcl, and not the instruction (note the meaning of target
is actually slightly different between gl and d3d10 in any case, because
d3d10 target does never include shadow bit).
Also move the msaa sampler identification as well - would need to set that
on the sview not sampler, so while this does not fix it make it at least
obvious it won't work with sample instructions.

---

 src/gallium/auxiliary/tgsi/tgsi_scan.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c 
b/src/gallium/auxiliary/tgsi/tgsi_scan.c
index c71c777..76a6fef 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_scan.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c
@@ -184,14 +184,14 @@ scan_instruction(struct tgsi_shader_info *info,
       /* Texture samplers */
       if (src->Register.File == TGSI_FILE_SAMPLER) {
          const unsigned index = src->Register.Index;
-         const unsigned target = fullinst->Texture.Texture;
 
          assert(fullinst->Instruction.Texture);
          assert(index < Elements(info->is_msaa_sampler));
          assert(index < PIPE_MAX_SAMPLERS);
-         assert(target < TGSI_TEXTURE_UNKNOWN);
 
          if (tgsi_get_opcode_info(fullinst->Instruction.Opcode)->is_tex) {
+            const unsigned target = fullinst->Texture.Texture;
+            assert(target < TGSI_TEXTURE_UNKNOWN);
             /* for texture instructions, check that the texture instruction
              * target matches the previous sampler view declaration (if there
              * was one.)
@@ -205,12 +205,11 @@ scan_instruction(struct tgsi_shader_info *info,
                 */
                assert(info->sampler_targets[index] == target);
             }
-         }
-
-         /* MSAA samplers */
-         if (target == TGSI_TEXTURE_2D_MSAA ||
-             target == TGSI_TEXTURE_2D_ARRAY_MSAA) {
-            info->is_msaa_sampler[src->Register.Index] = TRUE;
+            /* MSAA samplers */
+            if (target == TGSI_TEXTURE_2D_MSAA ||
+                target == TGSI_TEXTURE_2D_ARRAY_MSAA) {
+               info->is_msaa_sampler[src->Register.Index] = TRUE;
+            }
          }
       }
 

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to