From 79762e877cd9b439d5f7697d3fea8d930ab05646 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolai=20H=C3=A4hnle?= Date: Tue, 15 Mar 2016 20:54:30 -0500 Subject: [PATCH] tgsi/scan: add writes_memory to flag presence of stores or atomics MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák --- src/gallium/auxiliary/tgsi/tgsi_scan.c | 12 ++++++++---- src/gallium/auxiliary/tgsi/tgsi_scan.h | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c b/src/gallium/auxiliary/tgsi/tgsi_scan.c index 65bdab5b1cd..d32c3a14344 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_scan.c +++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c @@ -196,10 +196,13 @@ scan_instruction(struct tgsi_shader_info *info, if (is_memory_file(src->Register.File)) { is_mem_inst = true; - if (src->Register.File == TGSI_FILE_IMAGE && - !src->Register.Indirect && - tgsi_get_opcode_info(fullinst->Instruction.Opcode)->is_store) - info->images_writemask |= 1 << src->Register.Index; + if (tgsi_get_opcode_info(fullinst->Instruction.Opcode)->is_store) { + info->writes_memory = TRUE; + + if (src->Register.File == TGSI_FILE_IMAGE && + !src->Register.Indirect) + info->images_writemask |= 1 << src->Register.Index; + } } } @@ -215,6 +218,7 @@ scan_instruction(struct tgsi_shader_info *info, assert(fullinst->Instruction.Opcode == TGSI_OPCODE_STORE); is_mem_inst = true; + info->writes_memory = TRUE; if (dst->Register.File == TGSI_FILE_IMAGE && !dst->Register.Indirect) diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.h b/src/gallium/auxiliary/tgsi/tgsi_scan.h index d777f23749b..76d8925119e 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_scan.h +++ b/src/gallium/auxiliary/tgsi/tgsi_scan.h @@ -111,6 +111,7 @@ struct tgsi_shader_info boolean writes_clipvertex; boolean writes_viewport_index; boolean writes_layer; + boolean writes_memory; /**< contains stores or atomics to buffers or images */ boolean is_msaa_sampler[PIPE_MAX_SAMPLERS]; boolean uses_doubles; /**< uses any of the double instructions */ unsigned clipdist_writemask; -- 2.30.2