From bb13691d1c4df0c9258289b77867e5d5c890a838 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Fri, 22 Nov 2013 20:57:44 -0800 Subject: [PATCH] glsl: Add image memory and layout qualifiers to ir_variable. v2: Add comment next to the read_only and write_only qualifier flags. Reviewed-by: Paul Berry --- src/glsl/ir.cpp | 5 +++++ src/glsl/ir.h | 14 ++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp index 1a36bd631c1..63dfa383a1d 100644 --- a/src/glsl/ir.cpp +++ b/src/glsl/ir.cpp @@ -1554,6 +1554,11 @@ ir_variable::ir_variable(const struct glsl_type *type, const char *name, this->data.max_array_access = 0; this->data.atomic.buffer_index = 0; this->data.atomic.offset = 0; + this->data.image.read_only = false; + this->data.image.write_only = false; + this->data.image.coherent = false; + this->data.image._volatile = false; + this->data.image._restrict = false; if (type != NULL) { if (type->base_type == GLSL_TYPE_SAMPLER) diff --git a/src/glsl/ir.h b/src/glsl/ir.h index e266328b204..39585731898 100644 --- a/src/glsl/ir.h +++ b/src/glsl/ir.h @@ -690,6 +690,20 @@ public: unsigned offset; } atomic; + /** + * ARB_shader_image_load_store qualifiers. + */ + struct { + bool read_only; /**< "readonly" qualifier. */ + bool write_only; /**< "writeonly" qualifier. */ + bool coherent; + bool _volatile; + bool _restrict; + + /** Image internal format if specified explicitly, otherwise GL_NONE. */ + GLenum format; + } image; + /** * Highest element accessed with a constant expression array index * -- 2.30.2