summaryrefslogtreecommitdiffstats
path: root/src/glsl/builtin_variables.cpp
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2013-07-26 11:55:52 -0700
committerPaul Berry <[email protected]>2013-10-15 11:34:30 -0700
commit2910a82eb43bafc73d542336c21f415f5f4a3bed (patch)
treeceea5f66f6fd2f0506edff19ca75b3df67e1529d /src/glsl/builtin_variables.cpp
parent705a90e30435490c2de84f4f6741cab335fa7608 (diff)
glsl: Add new GLSL 1.50 constants.
This patch populates the following built-in GLSL 1.50 variables based on constants stored in ctx->Const: - gl_MaxVertexOutputComponents - gl_MaxGeometryInputComponents - gl_MaxGeometryOutputComponents - gl_MaxFragmentInputComponents - gl_MaxGeometryTextureImageUnits - gl_MaxGeometryOutputVertices - gl_MaxGeometryTotalOutputComponents - gl_MaxGeometryUniformComponents - gl_MaxGeometryVaryingComponents On i965/gen7, fixes all Piglit tests in "spec/glsl-1.50/built-in constants/*" except for gl_MaxCombinedTextureImageUnits and gl_MaxGeometryUniformComponents. Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/glsl/builtin_variables.cpp')
-rw-r--r--src/glsl/builtin_variables.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/builtin_variables.cpp
index ae0a03f0d47..f06d2ab05fd 100644
--- a/src/glsl/builtin_variables.cpp
+++ b/src/glsl/builtin_variables.cpp
@@ -583,6 +583,37 @@ builtin_variable_generator::generate_constants()
add_const("gl_MaxVaryingComponents", state->ctx->Const.MaxVarying * 4);
}
+ if (state->is_version(150, 0)) {
+ add_const("gl_MaxVertexOutputComponents",
+ state->Const.MaxVertexOutputComponents);
+ add_const("gl_MaxGeometryInputComponents",
+ state->Const.MaxGeometryInputComponents);
+ add_const("gl_MaxGeometryOutputComponents",
+ state->Const.MaxGeometryOutputComponents);
+ add_const("gl_MaxFragmentInputComponents",
+ state->Const.MaxFragmentInputComponents);
+ add_const("gl_MaxGeometryTextureImageUnits",
+ state->Const.MaxGeometryTextureImageUnits);
+ add_const("gl_MaxGeometryOutputVertices",
+ state->Const.MaxGeometryOutputVertices);
+ add_const("gl_MaxGeometryTotalOutputComponents",
+ state->Const.MaxGeometryTotalOutputComponents);
+ add_const("gl_MaxGeometryUniformComponents",
+ state->Const.MaxGeometryUniformComponents);
+
+ /* Note: the GLSL 1.50-4.40 specs require
+ * gl_MaxGeometryVaryingComponents to be present, and to be at least 64.
+ * But they do not define what it means (and there does not appear to be
+ * any corresponding constant in the GL specs). However,
+ * ARB_geometry_shader4 defines MAX_GEOMETRY_VARYING_COMPONENTS_ARB to
+ * be the maximum number of components available for use as geometry
+ * outputs. So we assume this is a synonym for
+ * gl_MaxGeometryOutputComponents.
+ */
+ add_const("gl_MaxGeometryVaryingComponents",
+ state->Const.MaxGeometryOutputComponents);
+ }
+
if (compatibility) {
/* Note: gl_MaxLights stopped being listed as an explicit constant in
* GLSL 1.30, however it continues to be referred to (as a minimum size