summaryrefslogtreecommitdiff
path: root/src/glsl/builtin_variables.cpp
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2012-02-29 08:29:39 -0800
committerKenneth Graunke <kenneth@whitecape.org>2012-02-29 14:57:15 -0800
commit1e6a2c10590bc6b4112ec2e54e1de7d8f9fd349d (patch)
tree126263a83260ca7bae45f7241705d0bd4b632630 /src/glsl/builtin_variables.cpp
parent767ba60831657a684e3852c398a0d13d1201158f (diff)
glsl: Make gl_InstanceID available with GL_ARB_draw_instanced extension
Originally ARB_draw_instanced only specified that ARB decorated name. Since no vendor actually implemented that behavior and some apps use the undecorated name, the extension now specifies that both names are available. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Marek Olšák <maraeo@gmail.com>
Diffstat (limited to 'src/glsl/builtin_variables.cpp')
-rw-r--r--src/glsl/builtin_variables.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/builtin_variables.cpp
index ed6b922ca62..66b3abdd84c 100644
--- a/src/glsl/builtin_variables.cpp
+++ b/src/glsl/builtin_variables.cpp
@@ -870,13 +870,25 @@ generate_ARB_draw_instanced_variables(exec_list *instructions,
/* gl_InstanceIDARB is only available in the vertex shader.
*/
if (target == vertex_shader) {
- ir_variable *const inst =
+ ir_variable *inst =
add_variable(instructions, state->symbols,
"gl_InstanceIDARB", glsl_type::int_type,
ir_var_system_value, SYSTEM_VALUE_INSTANCE_ID);
if (warn)
inst->warn_extension = "GL_ARB_draw_instanced";
+
+ /* Originally ARB_draw_instanced only specified that ARB decorated name.
+ * Since no vendor actually implemented that behavior and some apps use
+ * the undecorated name, the extension now specifies that both names are
+ * available.
+ */
+ inst = add_variable(instructions, state->symbols,
+ "gl_InstanceID", glsl_type::int_type,
+ ir_var_system_value, SYSTEM_VALUE_INSTANCE_ID);
+
+ if (warn)
+ inst->warn_extension = "GL_ARB_draw_instanced";
}
}