[Mesa-dev] [PATCH 05/23] glsl: Add gl_uniform_storage fields to keep track of image uniform indices.

Francisco Jerez currojerez at riseup.net
Tue Nov 26 00:02:21 PST 2013


---
 src/glsl/ir_uniform.h | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/src/glsl/ir_uniform.h b/src/glsl/ir_uniform.h
index 13faab7..0704061 100644
--- a/src/glsl/ir_uniform.h
+++ b/src/glsl/ir_uniform.h
@@ -118,6 +118,25 @@ struct gl_uniform_storage {
       bool active;
    } sampler[MESA_SHADER_TYPES];
 
+   struct {
+      /**
+       * Base image index
+       *
+       * If \c ::base_type is \c GLSL_TYPE_IMAGE, this represents the
+       * index of this image.  If \c ::array_elements is not zero, the
+       * array will use indices \c index through \c index + \c
+       * ::array_elements - 1, inclusive.
+       *
+       * Note that the index may be different in each shader stage.
+       */
+      uint8_t index;
+
+      /**
+       * Whether this image is used in this shader stage.
+       */
+      bool active;
+   } image[MESA_SHADER_TYPES];
+
    /**
     * Storage used by the driver for the uniform
     */
-- 
1.8.3.4



More information about the mesa-dev mailing list