From 3243b6fc97dc73555f72ce8c01f643d707b26610 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolai=20H=C3=A4hnle?= Date: Thu, 10 Mar 2016 16:30:07 -0500 Subject: [PATCH] tgsi: add Texture and Format to tgsi_instruction_memory MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Frontends should have this information readily available, and it simplifies image LOAD/STORE/ATOM* handling especially with indirect image access. Reviewed-by: Ilia Mirkin Reviewed-by: Marek Olšák --- src/gallium/auxiliary/tgsi/tgsi_dump.c | 8 ++++++++ src/gallium/include/pipe/p_shader_tokens.h | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/tgsi/tgsi_dump.c b/src/gallium/auxiliary/tgsi/tgsi_dump.c index f232f38..c8b91bb 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_dump.c +++ b/src/gallium/auxiliary/tgsi/tgsi_dump.c @@ -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) { diff --git a/src/gallium/include/pipe/p_shader_tokens.h b/src/gallium/include/pipe/p_shader_tokens.h index 9d4a96a..34e491e 100644 --- a/src/gallium/include/pipe/p_shader_tokens.h +++ b/src/gallium/include/pipe/p_shader_tokens.h @@ -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) -- 2.7.4