From 11dfcb653156a52a695968a0e3c84ca96f6a0393 Mon Sep 17 00:00:00 2001 From: Hans-Kristian Arntzen Date: Tue, 29 Aug 2017 15:54:22 +0200 Subject: [PATCH] Add restrict qualifier for images. --- reference/shaders/comp/coherent-image.comp | 2 +- spirv_glsl.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/reference/shaders/comp/coherent-image.comp b/reference/shaders/comp/coherent-image.comp index 97da6667..b3992f24 100644 --- a/reference/shaders/comp/coherent-image.comp +++ b/reference/shaders/comp/coherent-image.comp @@ -6,7 +6,7 @@ layout(binding = 1, std430) coherent restrict writeonly buffer SSBO ivec4 value; } _10; -layout(binding = 3, r32i) uniform coherent readonly mediump iimage2D uImage; +layout(binding = 3, r32i) uniform coherent restrict readonly mediump iimage2D uImage; void main() { diff --git a/spirv_glsl.cpp b/spirv_glsl.cpp index 5a92a0f3..7d9e9ea2 100644 --- a/spirv_glsl.cpp +++ b/spirv_glsl.cpp @@ -6079,6 +6079,8 @@ string CompilerGLSL::to_qualifiers_glsl(uint32_t id) { if (flags & (1ull << DecorationCoherent)) res += "coherent "; + if (flags & (1ull << DecorationRestrict)) + res += "restrict "; if (flags & (1ull << DecorationNonWritable)) res += "readonly "; if (flags & (1ull << DecorationNonReadable))