glsl: Add ir_variable fields for explicit bindings.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 18 Jul 2013 22:10:49 +0000 (15:10 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 18 Jul 2013 23:57:24 +0000 (16:57 -0700)
These are not used yet, but they exist and are copied appropriately.

v2: Add an explicit "int binding" variable rather than reusing
    constant_value, as suggested by Paul Berry.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
src/glsl/ir.h
src/glsl/ir_clone.cpp

index 1f0dc0906a1fba821c3a87a169ac61f2fba0b4d0..7ac291cf40e986db3d02e009e8eab6e9f66b540f 100644 (file)
@@ -470,6 +470,14 @@ public:
    unsigned explicit_location:1;
    unsigned explicit_index:1;
 
+   /**
+    * Was an initial binding explicitly set in the shader?
+    *
+    * If so, constant_value contains an integer ir_constant representing the
+    * initial binding point.
+    */
+   unsigned explicit_binding:1;
+
    /**
     * Does this variable have an initializer?
     *
@@ -527,6 +535,13 @@ public:
     */
    int index;
 
+   /**
+    * Initial binding point for a sampler or UBO.
+    *
+    * For array types, this represents the binding point for the first element.
+    */
+   int binding;
+
    /**
     * Built-in state that backs this uniform
     *
index 5b42935f8e83b12f6eed91efb7380ca84bd312e1..9d4178de8b12a8874735954b253f75cf81d9b0ce 100644 (file)
@@ -50,11 +50,13 @@ ir_variable::clone(void *mem_ctx, struct hash_table *ht) const
    var->interpolation = this->interpolation;
    var->location = this->location;
    var->index = this->index;
+   var->binding = this->binding;
    var->warn_extension = this->warn_extension;
    var->origin_upper_left = this->origin_upper_left;
    var->pixel_center_integer = this->pixel_center_integer;
    var->explicit_location = this->explicit_location;
    var->explicit_index = this->explicit_index;
+   var->explicit_binding = this->explicit_binding;
    var->has_initializer = this->has_initializer;
    var->depth_layout = this->depth_layout;