diff options
author | Ilia Mirkin <[email protected]> | 2016-01-19 01:43:40 -0500 |
---|---|---|
committer | Ilia Mirkin <[email protected]> | 2016-01-29 21:04:56 -0500 |
commit | 2b089c7ffe2c46a5d5d01ec315fb3e5a07695d44 (patch) | |
tree | 18b45365b45bc9ebaee0e4e16439d075ed3cd890 /src | |
parent | 2ccc42fd2c63502ffb1273a5e4ff7c8d77dc6062 (diff) |
glsl: always initialize image_* fields, copy them on interface init
Interfaces can have image properties set in case they are buffer
interfaces. Make sure not to lose this information.
Signed-off-by: Ilia Mirkin <[email protected]>
Reviewed-by: Iago Toral Quiroga <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/glsl/builtin_variables.cpp | 5 | ||||
-rw-r--r-- | src/compiler/glsl_types.cpp | 5 | ||||
-rw-r--r-- | src/compiler/glsl_types.h | 3 |
3 files changed, 12 insertions, 1 deletions
diff --git a/src/compiler/glsl/builtin_variables.cpp b/src/compiler/glsl/builtin_variables.cpp index 25d92cc691b..6db74f1c634 100644 --- a/src/compiler/glsl/builtin_variables.cpp +++ b/src/compiler/glsl/builtin_variables.cpp @@ -328,6 +328,11 @@ per_vertex_accumulator::add_field(int slot, const glsl_type *type, this->fields[this->num_fields].sample = 0; this->fields[this->num_fields].patch = 0; this->fields[this->num_fields].precision = GLSL_PRECISION_NONE; + this->fields[this->num_fields].image_read_only = 0; + this->fields[this->num_fields].image_write_only = 0; + this->fields[this->num_fields].image_coherent = 0; + this->fields[this->num_fields].image_volatile = 0; + this->fields[this->num_fields].image_restrict = 0; this->num_fields++; } diff --git a/src/compiler/glsl_types.cpp b/src/compiler/glsl_types.cpp index ef6c3c6e3b7..1458ad366cd 100644 --- a/src/compiler/glsl_types.cpp +++ b/src/compiler/glsl_types.cpp @@ -163,6 +163,11 @@ glsl_type::glsl_type(const glsl_struct_field *fields, unsigned num_fields, this->fields.structure[i].sample = fields[i].sample; this->fields.structure[i].matrix_layout = fields[i].matrix_layout; this->fields.structure[i].patch = fields[i].patch; + this->fields.structure[i].image_read_only = fields[i].image_read_only; + this->fields.structure[i].image_write_only = fields[i].image_write_only; + this->fields.structure[i].image_coherent = fields[i].image_coherent; + this->fields.structure[i].image_volatile = fields[i].image_volatile; + this->fields.structure[i].image_restrict = fields[i].image_restrict; this->fields.structure[i].precision = fields[i].precision; } diff --git a/src/compiler/glsl_types.h b/src/compiler/glsl_types.h index e63d7945c9f..00133d9cb25 100644 --- a/src/compiler/glsl_types.h +++ b/src/compiler/glsl_types.h @@ -863,7 +863,8 @@ struct glsl_struct_field { glsl_struct_field(const struct glsl_type *_type, const char *_name) : type(_type), name(_name), location(-1), interpolation(0), centroid(0), sample(0), matrix_layout(GLSL_MATRIX_LAYOUT_INHERITED), patch(0), - precision(GLSL_PRECISION_NONE) + precision(GLSL_PRECISION_NONE), image_read_only(0), image_write_only(0), + image_coherent(0), image_volatile(0), image_restrict(0) { /* empty */ } |