summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_uniform.h
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2013-11-22 15:50:48 -0800
committerFrancisco Jerez <[email protected]>2014-02-12 18:44:05 +0100
commitc116541b2c3a45715de15e3180627263143ad426 (patch)
tree1f0449e7a275f218f351630f5fb764fdce54ec19 /src/glsl/ir_uniform.h
parentbb13691d1c4df0c9258289b77867e5d5c890a838 (diff)
glsl: Add gl_uniform_storage fields to keep track of image uniform indices.
v2: Promote anonymous struct into named struct. Reviewed-by: Paul Berry <[email protected]>
Diffstat (limited to 'src/glsl/ir_uniform.h')
-rw-r--r--src/glsl/ir_uniform.h41
1 files changed, 23 insertions, 18 deletions
diff --git a/src/glsl/ir_uniform.h b/src/glsl/ir_uniform.h
index f678c2c5c4d..7508f795d08 100644
--- a/src/glsl/ir_uniform.h
+++ b/src/glsl/ir_uniform.h
@@ -78,6 +78,26 @@ struct gl_uniform_driver_storage {
void *data;
};
+struct gl_opaque_uniform_index {
+ /**
+ * Base opaque uniform index
+ *
+ * If \c gl_uniform_storage::base_type is an opaque type, this
+ * represents its uniform index. If \c
+ * gl_uniform_storage::array_elements is not zero, the array will
+ * use opaque uniform indices \c index through \c index + \c
+ * gl_uniform_storage::array_elements - 1, inclusive.
+ *
+ * Note that the index may be different in each shader stage.
+ */
+ uint8_t index;
+
+ /**
+ * Whether this opaque uniform is used in this shader stage.
+ */
+ bool active;
+};
+
struct gl_uniform_storage {
char *name;
/** Type of this uniform data stored.
@@ -99,24 +119,9 @@ struct gl_uniform_storage {
*/
bool initialized;
- struct {
- /**
- * Base sampler index
- *
- * If \c ::base_type is \c GLSL_TYPE_SAMPLER, this represents the index
- * of this sampler. If \c ::array_elements is not zero, the array will
- * use sampler indices \c ::sampler through \c ::sampler +
- * \c ::array_elements - 1, inclusive.
- *
- * Note that the index may be different in each shader stage.
- */
- uint8_t index;
-
- /**
- * Whether this sampler is used in this shader stage.
- */
- bool active;
- } sampler[MESA_SHADER_STAGES];
+ struct gl_opaque_uniform_index sampler[MESA_SHADER_STAGES];
+
+ struct gl_opaque_uniform_index image[MESA_SHADER_STAGES];
/**
* Storage used by the driver for the uniform