summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/ir.cpp2
-rw-r--r--src/glsl/ir.h3
-rw-r--r--src/glsl/link_atomics.cpp4
3 files changed, 5 insertions, 4 deletions
diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp
index 4a4d30477ce..d09ff9e5ffa 100644
--- a/src/glsl/ir.cpp
+++ b/src/glsl/ir.cpp
@@ -1551,6 +1551,7 @@ ir_variable::ir_variable(const struct glsl_type *type, const char *name,
this->data.has_initializer = false;
this->data.location = -1;
this->data.location_frac = 0;
+ this->data.binding = 0;
this->warn_extension = NULL;
this->constant_value = NULL;
this->constant_initializer = NULL;
@@ -1566,7 +1567,6 @@ ir_variable::ir_variable(const struct glsl_type *type, const char *name,
this->data.mode = mode;
this->data.interpolation = INTERP_QUALIFIER_NONE;
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;
diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index 18623b96868..535693d9273 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -727,7 +727,7 @@ public:
int index;
/**
- * Initial binding point for a sampler or UBO.
+ * Initial binding point for a sampler, atomic, or UBO.
*
* For array types, this represents the binding point for the first element.
*/
@@ -737,7 +737,6 @@ public:
* Location an atomic counter is stored at.
*/
struct {
- unsigned buffer_index;
unsigned offset;
} atomic;
diff --git a/src/glsl/link_atomics.cpp b/src/glsl/link_atomics.cpp
index 75699fd9391..603873a5d4f 100644
--- a/src/glsl/link_atomics.cpp
+++ b/src/glsl/link_atomics.cpp
@@ -201,7 +201,9 @@ link_assign_atomic_counter_resources(struct gl_context *ctx,
gl_uniform_storage *const storage = &prog->UniformStorage[id];
mab.Uniforms[j] = id;
- var->data.atomic.buffer_index = i;
+ if (!var->data.explicit_binding)
+ var->data.binding = i;
+
storage->atomic_buffer_index = i;
storage->offset = var->data.atomic.offset;
storage->array_stride = (var->type->is_array() ?