summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_uniform.h
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2015-04-20 10:27:36 +1000
committerDave Airlie <airlied@redhat.com>2015-07-23 17:25:43 +1000
commit60266863d80bb2af94fa5c189ccd23ee20607ea9 (patch)
tree9b7a90ddee9f98523508d95a201463f61ddb3126 /src/glsl/ir_uniform.h
parent44ea8b9b8edc5f59da546683fe64129a1c1be449 (diff)
downloadexternal_mesa3d-60266863d80bb2af94fa5c189ccd23ee20607ea9.zip
external_mesa3d-60266863d80bb2af94fa5c189ccd23ee20607ea9.tar.gz
external_mesa3d-60266863d80bb2af94fa5c189ccd23ee20607ea9.tar.bz2
glsl: add uniform and program resource support (v2)
This adds linker support for subroutine uniforms, they have some subtle differences from real uniforms, we also hide them and they are given internal uniform names. This also adds the subroutine locations and subroutine uniforms to the program resource tracking for later use. v1.1: drop is_subroutine_def v2: handle explicit location properly, ARB_explicit_location has a lot of language for subroutine shaders. Calculate a link time the number of compatible subroutines for a uniform, to make program resource easier later. Acked-by: Kenneth Graunke <kenneth@whitecape.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/glsl/ir_uniform.h')
-rw-r--r--src/glsl/ir_uniform.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/glsl/ir_uniform.h b/src/glsl/ir_uniform.h
index e1b8014..0b6f720 100644
--- a/src/glsl/ir_uniform.h
+++ b/src/glsl/ir_uniform.h
@@ -114,6 +114,8 @@ struct gl_uniform_storage {
struct gl_opaque_uniform_index image[MESA_SHADER_STAGES];
+ struct gl_opaque_uniform_index subroutine[MESA_SHADER_STAGES];
+
/**
* Storage used by the driver for the uniform
*/
@@ -173,10 +175,16 @@ struct gl_uniform_storage {
/**
* The 'base location' for this uniform in the uniform remap table. For
* arrays this is the first element in the array.
+ * for subroutines this is in shader subroutine uniform remap table.
*/
unsigned remap_location;
/**
+ * The number of compatible subroutines with this subroutine uniform.
+ */
+ unsigned num_compatible_subroutines;
+
+ /**
* This is a compiler-generated uniform that should not be advertised
* via the API.
*/