summaryrefslogtreecommitdiffstats
path: root/src/glsl/glsl_parser_extras.h
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2013-07-30 21:13:48 -0700
committerPaul Berry <[email protected]>2013-08-01 20:24:39 -0700
commit7cfefe6965d50d8b1b494396d7b3b16d87bb2060 (patch)
tree789a59eac0c0568b5c53d8c79cad3dca5b2ea1d8 /src/glsl/glsl_parser_extras.h
parent20ae8e0c9168d900246d5940e07cf668dba8f0ce (diff)
glsl: Implement rules for geometry shader input sizes.
Section 4.3.8.1 (Input Layout Qualifiers) of the GLSL 1.50 spec contains some tricky rules for how the sizes of geometry shader input arrays are related to the input layout specification. In essence, those rules boil down to the following: - If an input array declaration does not specify a size, and it follows an input layout declaration, it is sized according to the input layout. - If an input layout declaration follows an input array declaration that didn't specify a size, the input array declaration is given a size at the time the input layout declaration appears. - All input layout declarations and input array sizes must ultimately match. Inconsistencies are reported as soon as they are detected, at compile time if the inconsistency is within one compilation unit, otherwise at link time. - At least one compilation unit must contain an input layout declaration. (Note: the geom_array_resize_visitor class was contributed by Bryan Cain <[email protected]>.) Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/glsl_parser_extras.h')
-rw-r--r--src/glsl/glsl_parser_extras.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h
index 7c563ea7f60..b9ca4e3a4d6 100644
--- a/src/glsl/glsl_parser_extras.h
+++ b/src/glsl/glsl_parser_extras.h
@@ -316,6 +316,15 @@ struct _mesa_glsl_parse_state {
/** Shaders containing built-in functions that are used for linking. */
struct gl_shader *builtins_to_link[16];
unsigned num_builtins_to_link;
+
+ /**
+ * For geometry shaders, size of the most recently seen input declaration
+ * that was a sized array, or 0 if no sized input array declarations have
+ * been seen.
+ *
+ * Unused for other shader types.
+ */
+ unsigned gs_input_size;
};
# define YYLLOC_DEFAULT(Current, Rhs, N) \