diff options
author | Marek Olšák <[email protected]> | 2019-09-12 21:09:19 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2019-10-09 17:12:27 -0400 |
commit | 279da8a2011d0d81449e059a08c912e8004ae291 (patch) | |
tree | be7ff63af7c0d4d9b2edcdd00c2de608cf75277b /src/gallium/auxiliary | |
parent | e26bd397a8fd818db3a72aef1d0e271fa24c3f7d (diff) |
tgsi/scan: add tgsi_shader_info::msaa_images_declared
Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r-- | src/gallium/auxiliary/tgsi/tgsi_scan.c | 17 | ||||
-rw-r--r-- | src/gallium/auxiliary/tgsi/tgsi_scan.h | 2 |
2 files changed, 19 insertions, 0 deletions
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. */ |