tgsi: don't print texture target for sample opcodes
authorRoland Scheidegger <sroland@vmware.com>
Fri, 12 Sep 2014 22:29:56 +0000 (00:29 +0200)
committerRoland Scheidegger <sroland@vmware.com>
Tue, 16 Sep 2014 01:50:31 +0000 (03:50 +0200)
sample opcodes don't encode a texture target, it would thus always
print UNKNOWN, which is not helpful (and wouldn't parse when giving
back the shader text to tgsi).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/tgsi/tgsi_dump.c

index 884d8cf935447ac2b5e573bb48f2f8889895a9e5..08d3fde614c75015630f5f80e8b5bcb8e667e377 100644 (file)
@@ -573,8 +573,11 @@ iter_instruction(
    }
 
    if (inst->Instruction.Texture) {
-      TXT( ", " );
-      ENM( inst->Texture.Texture, tgsi_texture_names );
+      if (!(inst->Instruction.Opcode >= TGSI_OPCODE_SAMPLE &&
+            inst->Instruction.Opcode <= TGSI_OPCODE_GATHER4)) {
+         TXT( ", " );
+         ENM( inst->Texture.Texture, tgsi_texture_names );
+      }
       for (i = 0; i < inst->Texture.NumOffsets; i++) {
          TXT( ", " );
          TXT(tgsi_file_name(inst->TexOffsets[i].File));