mesa: enable GL_EXT_draw_instanced for gles2
authorSimon Zeni <simon@bl4ckb0ne.ca>
Tue, 24 Dec 2019 02:45:52 +0000 (21:45 -0500)
committerMarge Bot <eric+marge@anholt.net>
Thu, 23 Apr 2020 03:56:03 +0000 (03:56 +0000)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3204>

docs/relnotes/new_features.txt
src/compiler/glsl/builtin_variables.cpp
src/compiler/glsl/glsl_parser_extras.cpp
src/compiler/glsl/glsl_parser_extras.h
src/mesa/main/extensions_table.h

index cf4b5fad96afc6b599d73988fbab5cb6d847410f..cbf7b6068606c05efb40a52f10fb206c0d0afd0f 100644 (file)
@@ -6,3 +6,4 @@ GL_NV_pixel_buffer_object on all gallium drivers, i915, i965, swrast.
 GL_NV_viewport_array2 on nvc0 (GM200+).
 GL_NV_viewport_swizzle on nvc0 (GM200+).
 VK_KHR_shader_non_semantic_info on Intel, RADV.
+GL_EXT_draw_instanced on gles2
index e305ab9b9b8e32ff8f639a75e0a6e4f6dd64d912..c9fdac84666b7843b7389ec3575c5a3292ce8795 100644 (file)
@@ -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,
index 6eb0aa2abb8090ab145cd3bec4156a36691e9603..c394f00480a48ee248f2413e54121d8e025d8906 100644 (file)
@@ -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),
index b5e687d603865d448bce19869451333265cfd1e8..afbc09170bfa71064038f3d052517cb0114cc20e 100644 (file)
@@ -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;
index a4194a9ac5d0f323d435a3baf3302e20c193b7a0..66f5d2e9d9d78facbe8d8c984f222cd433ba5e62 100644 (file)
@@ -234,7 +234,7 @@ EXT(EXT_draw_buffers                        , dummy_true
 EXT(EXT_draw_buffers2                       , EXT_draw_buffers2                      , GLL, GLC,  x ,  x , 2006)
 EXT(EXT_draw_buffers_indexed                , ARB_draw_buffers_blend                 ,  x ,  x ,  x ,  30, 2014)
 EXT(EXT_draw_elements_base_vertex           , ARB_draw_elements_base_vertex          ,  x ,  x ,  x , ES2, 2014)
-EXT(EXT_draw_instanced                      , ARB_draw_instanced                     , GLL, GLC,  x ,  x , 2006)
+EXT(EXT_draw_instanced                      , ARB_draw_instanced                     , GLL, GLC,  x , ES2 , 2006)
 EXT(EXT_draw_range_elements                 , dummy_true                             , GLL,  x ,  x ,  x , 1997)
 EXT(EXT_float_blend                         , EXT_float_blend                        ,  x ,  x ,  x ,  30, 2015)
 EXT(EXT_fog_coord                           , dummy_true                             , GLL,  x ,  x ,  x , 1999)