summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2016-10-09 19:18:51 +0200
committerMarek Olšák <[email protected]>2016-10-24 21:41:30 +0200
commitac37720f51310ad0398c4cd5c8921da5c96a7c9d (patch)
treed615de333e951c5a9e8fb1850143b76f60021bcb
parentf095a4eb171aadf525198e6583a1796ffe5a07b7 (diff)
tgsi/scan: don't treat RESQ etc. as memory instructions
Reviewed-by: Nicolai Hähnle <[email protected]>
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_scan.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c b/src/gallium/auxiliary/tgsi/tgsi_scan.c
index e5edea8657b..66f1fdf2138 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_scan.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c
@@ -54,6 +54,16 @@ is_memory_file(unsigned file)
}
+static bool
+is_mem_query_inst(unsigned opcode)
+{
+ return opcode == TGSI_OPCODE_RESQ ||
+ opcode == TGSI_OPCODE_TXQ ||
+ opcode == TGSI_OPCODE_TXQS ||
+ opcode == TGSI_OPCODE_TXQ_LZ ||
+ opcode == TGSI_OPCODE_LODQ;
+}
+
/**
* Is the opcode a "true" texture instruction which samples from a
* texture map?
@@ -61,10 +71,7 @@ is_memory_file(unsigned file)
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 &&
+ return (!is_mem_query_inst(opcode) &&
tgsi_get_opcode_info(opcode)->is_tex);
}
@@ -320,7 +327,8 @@ scan_instruction(struct tgsi_shader_info *info,
}
}
- if (is_memory_file(src->Register.File)) {
+ if (is_memory_file(src->Register.File) &&
+ !is_mem_query_inst(fullinst->Instruction.Opcode)) {
is_mem_inst = true;
if (tgsi_get_opcode_info(fullinst->Instruction.Opcode)->is_store) {