summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2016-03-30 09:55:56 -0600
committerBrian Paul <[email protected]>2016-03-31 09:47:40 -0600
commit9d7cd439880d9334d21ed099efa15ccf8b709748 (patch)
treef24ba0ee2a5c60af56aef1adb7a96ed0a8ae544e /src/gallium
parentf96a403bc3e1ef45f92621e9ace48cf757db4059 (diff)
tgsi: skip texture query opcodes when examining texture targets
Should fix the assertion in piglit spec@arb_gpu_shader5@texturegather@fs-r-none-shadow-2d when the TXQ instruction specifies a 2D target but the sampler view was declared as SHADOW2D. Reviewed-by: Michel Dänzer <[email protected]> Tested-by: Michel Dänzer <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_scan.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c b/src/gallium/auxiliary/tgsi/tgsi_scan.c
index 76a6fef8b44..d90fb1d68df 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_scan.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c
@@ -54,6 +54,20 @@ is_memory_file(unsigned file)
}
+/**
+ * Is the opcode a "true" texture instruction which samples from a
+ * texture map?
+ */
+static bool
+is_texture_inst(unsigned opcode)
+{
+ return (opcode != TGSI_OPCODE_TXQ &&
+ opcode != TGSI_OPCODE_TXQS &&
+ opcode != TGSI_OPCODE_TXQ_LZ &&
+ opcode != TGSI_OPCODE_LODQ &&
+ tgsi_get_opcode_info(opcode)->is_tex);
+}
+
static void
scan_instruction(struct tgsi_shader_info *info,
const struct tgsi_full_instruction *fullinst,
@@ -189,7 +203,7 @@ scan_instruction(struct tgsi_shader_info *info,
assert(index < Elements(info->is_msaa_sampler));
assert(index < PIPE_MAX_SAMPLERS);
- if (tgsi_get_opcode_info(fullinst->Instruction.Opcode)->is_tex) {
+ if (is_texture_inst(fullinst->Instruction.Opcode)) {
const unsigned target = fullinst->Texture.Texture;
assert(target < TGSI_TEXTURE_UNKNOWN);
/* for texture instructions, check that the texture instruction