tgsi: add Texture and Format to tgsi_instruction_memory
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Thu, 10 Mar 2016 21:30:07 +0000 (16:30 -0500)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Mon, 14 Mar 2016 22:24:02 +0000 (17:24 -0500)
Frontends should have this information readily available, and it simplifies
image LOAD/STORE/ATOM* handling especially with indirect image access.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/auxiliary/tgsi/tgsi_dump.c
src/gallium/include/pipe/p_shader_tokens.h

index f232f3870d1e8f86a1aa9b2b395b5911baf687c1..c8b91bba53439555550ecb6ee11507d046f70770 100644 (file)
@@ -637,6 +637,14 @@ iter_instruction(
          TXT(", ");
          ENM(bit, tgsi_memory_names);
       }
+      if (inst->Memory.Texture) {
+         TXT( ", " );
+         ENM( inst->Memory.Texture, tgsi_texture_names );
+      }
+      if (inst->Memory.Format) {
+         TXT( ", " );
+         TXT( util_format_name(inst->Memory.Format) );
+      }
    }
 
    switch (inst->Instruction.Opcode) {
index 9d4a96a5a7e4ea7ad568d7c2c80641c7b3876fc2..34e491e4b930edb940a189d8aa0e993739b1ae2d 100644 (file)
@@ -743,7 +743,9 @@ struct tgsi_dst_register
 struct tgsi_instruction_memory
 {
    unsigned Qualifier : 3;  /* TGSI_MEMORY_ */
-   unsigned Padding   : 29;
+   unsigned Texture   : 8;  /* only for images: TGSI_TEXTURE_ */
+   unsigned Format    : 10; /* only for images: PIPE_FORMAT_ */
+   unsigned Padding   : 11;
 };
 
 #define TGSI_MEMBAR_SHADER_BUFFER (1 << 0)