summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorSimon Zeni <[email protected]>2019-12-23 21:45:52 -0500
committerMarge Bot <[email protected]>2020-04-23 03:56:03 +0000
commit51c1c4d95a05b6eb6fce74e8d624615e4a1b38ab (patch)
tree349574043335d147de9590c72893944ee82788ac /src/compiler
parent0edff5123c4f27ff0f8e35d29c2c45a230d3f939 (diff)
mesa: enable GL_EXT_draw_instanced for gles2
Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3204>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/glsl/builtin_variables.cpp5
-rw-r--r--src/compiler/glsl/glsl_parser_extras.cpp1
-rw-r--r--src/compiler/glsl/glsl_parser_extras.h2
3 files changed, 8 insertions, 0 deletions
diff --git a/src/compiler/glsl/builtin_variables.cpp b/src/compiler/glsl/builtin_variables.cpp
index e305ab9b9b8..c9fdac84666 100644
--- a/src/compiler/glsl/builtin_variables.cpp
+++ b/src/compiler/glsl/builtin_variables.cpp
@@ -1084,8 +1084,13 @@ builtin_variable_generator::generate_vs_special_vars()
add_system_value(SYSTEM_VALUE_BASE_INSTANCE, int_t, "gl_BaseInstance");
add_system_value(SYSTEM_VALUE_DRAW_ID, int_t, "gl_DrawID");
}
+ if (state->EXT_draw_instanced_enable && state->is_version(0, 100))
+ add_system_value(SYSTEM_VALUE_INSTANCE_ID, int_t, GLSL_PRECISION_HIGH,
+ "gl_InstanceIDEXT");
+
if (state->ARB_draw_instanced_enable)
add_system_value(SYSTEM_VALUE_INSTANCE_ID, int_t, "gl_InstanceIDARB");
+
if (state->ARB_draw_instanced_enable || state->is_version(140, 300) ||
state->EXT_gpu_shader4_enable) {
add_system_value(SYSTEM_VALUE_INSTANCE_ID, int_t, GLSL_PRECISION_HIGH,
diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp
index 6eb0aa2abb8..c394f00480a 100644
--- a/src/compiler/glsl/glsl_parser_extras.cpp
+++ b/src/compiler/glsl/glsl_parser_extras.cpp
@@ -721,6 +721,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = {
EXT(EXT_demote_to_helper_invocation),
EXT(EXT_frag_depth),
EXT(EXT_draw_buffers),
+ EXT(EXT_draw_instanced),
EXT(EXT_clip_cull_distance),
EXT(EXT_geometry_point_size),
EXT_AEP(EXT_geometry_shader),
diff --git a/src/compiler/glsl/glsl_parser_extras.h b/src/compiler/glsl/glsl_parser_extras.h
index b5e687d6038..afbc09170bf 100644
--- a/src/compiler/glsl/glsl_parser_extras.h
+++ b/src/compiler/glsl/glsl_parser_extras.h
@@ -824,6 +824,8 @@ struct _mesa_glsl_parse_state {
bool EXT_demote_to_helper_invocation_warn;
bool EXT_draw_buffers_enable;
bool EXT_draw_buffers_warn;
+ bool EXT_draw_instanced_enable;
+ bool EXT_draw_instanced_warn;
bool EXT_frag_depth_enable;
bool EXT_frag_depth_warn;
bool EXT_geometry_point_size_enable;