summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/tgsi
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary/tgsi')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_scan.c15
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_scan.h8
2 files changed, 13 insertions, 10 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c b/src/gallium/auxiliary/tgsi/tgsi_scan.c
index 7d5496c9603..99799fa16e2 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_scan.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c
@@ -283,9 +283,9 @@ scan_src_operand(struct tgsi_shader_info *info,
if (src->Register.File == TGSI_FILE_IMAGE) {
if (src->Register.Indirect)
- info->images_writemask = info->images_declared;
+ info->images_atomic = info->images_declared;
else
- info->images_writemask |= 1 << src->Register.Index;
+ info->images_atomic |= 1 << src->Register.Index;
} else if (src->Register.File == TGSI_FILE_BUFFER) {
if (src->Register.Indirect)
info->shader_buffers_atomic = info->shader_buffers_declared;
@@ -293,7 +293,12 @@ scan_src_operand(struct tgsi_shader_info *info,
info->shader_buffers_atomic |= 1 << src->Register.Index;
}
} else {
- if (src->Register.File == TGSI_FILE_BUFFER) {
+ if (src->Register.File == TGSI_FILE_IMAGE) {
+ if (src->Register.Indirect)
+ info->images_load = info->images_declared;
+ else
+ info->images_load |= 1 << src->Register.Index;
+ } else if (src->Register.File == TGSI_FILE_BUFFER) {
if (src->Register.Indirect)
info->shader_buffers_load = info->shader_buffers_declared;
else
@@ -425,9 +430,9 @@ scan_instruction(struct tgsi_shader_info *info,
if (dst->Register.File == TGSI_FILE_IMAGE) {
if (dst->Register.Indirect)
- info->images_writemask = info->images_declared;
+ info->images_store = info->images_declared;
else
- info->images_writemask |= 1 << dst->Register.Index;
+ info->images_store |= 1 << dst->Register.Index;
} else if (dst->Register.File == TGSI_FILE_BUFFER) {
if (dst->Register.Indirect)
info->shader_buffers_store = info->shader_buffers_declared;
diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.h b/src/gallium/auxiliary/tgsi/tgsi_scan.h
index e3c24e950ed..3854827e5cb 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_scan.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_scan.h
@@ -138,14 +138,12 @@ struct tgsi_shader_info
unsigned images_declared; /**< bitmask of declared images */
/**
- * Bitmask indicating which images are written to (STORE / ATOM*).
- * Indirect image accesses are not reflected in this mask.
- */
- unsigned images_writemask;
- /**
* Bitmask indicating which declared image is a buffer.
*/
unsigned images_buffers;
+ unsigned images_load; /**< bitmask of images using loads */
+ unsigned images_store; /**< bitmask of images using stores */
+ unsigned images_atomic; /**< bitmask of images using atomics */
unsigned shader_buffers_declared; /**< bitmask of declared shader buffers */
unsigned shader_buffers_load; /**< bitmask of shader buffers using loads */
unsigned shader_buffers_store; /**< bitmask of shader buffers using stores */