st/glsl_to_tgsi: set memory access type on image intrinsics
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Sun, 13 Mar 2016 02:47:35 +0000 (21:47 -0500)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Mon, 14 Mar 2016 22:24:30 +0000 (17:24 -0500)
This is required to preserve the image variable's coherent/restrict/volatile
qualifiers in TGSI.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/state_tracker/st_glsl_to_tgsi.cpp

index fcfd8b7ae920a279cfab33aaf8ee4f17f8a7e269..18cea60fc748210f135f3c3c5c81204df7e1a3c6 100644 (file)
@@ -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