From 279da8a2011d0d81449e059a08c912e8004ae291 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Thu, 12 Sep 2019 21:09:19 -0400 Subject: [PATCH] tgsi/scan: add tgsi_shader_info::msaa_images_declared Acked-by: Pierre-Eric Pelloux-Prayer --- src/gallium/auxiliary/tgsi/tgsi_scan.c | 17 +++++++++++++++++ src/gallium/auxiliary/tgsi/tgsi_scan.h | 2 ++ 2 files changed, 19 insertions(+) diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c b/src/gallium/auxiliary/tgsi/tgsi_scan.c index e1247c3da26..0cd4a8883ae 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_scan.c +++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c @@ -293,6 +293,15 @@ scan_src_operand(struct tgsi_shader_info *info, !is_mem_query_inst(fullinst->Instruction.Opcode)) { *is_mem_inst = true; + if (src->Register.File == TGSI_FILE_IMAGE && + (fullinst->Memory.Texture == TGSI_TEXTURE_2D_MSAA || + fullinst->Memory.Texture == TGSI_TEXTURE_2D_ARRAY_MSAA)) { + if (src->Register.Indirect) + info->msaa_images_declared = info->images_declared; + else + info->msaa_images_declared |= 1 << src->Register.Index; + } + if (tgsi_get_opcode_info(fullinst->Instruction.Opcode)->is_store) { info->writes_memory = TRUE; @@ -560,6 +569,14 @@ scan_instruction(struct tgsi_shader_info *info, info->writes_memory = TRUE; if (dst->Register.File == TGSI_FILE_IMAGE) { + if (fullinst->Memory.Texture == TGSI_TEXTURE_2D_MSAA || + fullinst->Memory.Texture == TGSI_TEXTURE_2D_ARRAY_MSAA) { + if (dst->Register.Indirect) + info->msaa_images_declared = info->images_declared; + else + info->msaa_images_declared |= 1 << dst->Register.Index; + } + if (dst->Register.Indirect) info->images_store = info->images_declared; else diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.h b/src/gallium/auxiliary/tgsi/tgsi_scan.h index a2938e5fd38..c446ee5e65a 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_scan.h +++ b/src/gallium/auxiliary/tgsi/tgsi_scan.h @@ -144,6 +144,8 @@ struct tgsi_shader_info unsigned num_written_clipdistance; unsigned images_declared; /**< bitmask of declared images */ + unsigned msaa_images_declared; /**< bitmask of declared MSAA images */ + /** * Bitmask indicating which declared image is a buffer. */ -- 2.30.2