[Mesa-dev] [PATCH 03/10] st/glsl_to_tgsi: set memory access type on image intrinsics

Nicolai Hähnle nhaehnle at gmail.com
Sun Mar 13 14:29:45 UTC 2016


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

This is required to preserve the image variable's coherent/restrict/volatile
qualifiers in TGSI.
---
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index fcfd8b7..18cea60 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -3616,6 +3616,13 @@ glsl_to_tgsi_visitor::visit_image_intrinsic(ir_call *ir)
 
    inst->image_format = st_mesa_format_to_pipe_format(st_context(ctx),
          _mesa_get_shader_image_format(imgvar->data.image_format));
+
+   if (imgvar->data.image_coherent)
+      inst->buffer_access |= TGSI_MEMORY_COHERENT;
+   if (imgvar->data.image_restrict)
+      inst->buffer_access |= TGSI_MEMORY_RESTRICT;
+   if (imgvar->data.image_volatile)
+      inst->buffer_access |= TGSI_MEMORY_VOLATILE;
 }
 
 void
-- 
2.5.0



More information about the mesa-dev mailing list