mesa/gles3: add support for GL_EXT_shader_group_vote
authorDave Airlie <airlied@redhat.com>
Tue, 16 Jun 2020 01:02:23 +0000 (11:02 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 16 Jun 2020 02:02:21 +0000 (12:02 +1000)
This is the GLES equivalent to ARB_shader_group_vote.

Passes: KHR-GLES31.core.shader_group_vote.*
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5490>

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

index 314bc574bf570c5b2c3bc278b3adba5ee0035051..0c607ba91ef0986559c67983568b6b00207ff3e4 100644 (file)
@@ -325,6 +325,7 @@ Khronos, ARB, and OES extensions that are not part of any OpenGL or OpenGL ES ve
   GL_EXT_semaphore                                      DONE (radeonsi)
   GL_EXT_semaphore_fd                                   DONE (radeonsi)
   GL_EXT_semaphore_win32                                not started
+  GL_EXT_shader_group_vote                              DONE (all drivers that support ARB_shader_group_vote)
   GL_EXT_sRGB_write_control                             DONE (all drivers that support GLES 3.0+)
   GL_EXT_texture_norm16                                 DONE (freedreno, i965, r600, radeonsi, nvc0)
   GL_EXT_texture_sRGB_R8                                DONE (all drivers that support GLES 3.0+)
index 13e179456e46fc33468a250813060dce4a57ed5b..f3ca40d80a813bc9b3746cdf90a74e99c009f162 100644 (file)
@@ -1,4 +1,5 @@
 GL_ARB_compute_variable_group_size on Iris.
+GL_EXT_shader_group_vote on GLES3.
 VK_AMD_texture_gather_bias_lod on RADV.
 VK_EXT_private_data on ANV and RADV.
 VK_EXT_custom_border_color on RADV.
index 1aead1d9e122143428fe455d2d888de3b95d271f..172633042ba8bcf16d85555970883d7d24ef6c6e 100644 (file)
@@ -777,10 +777,16 @@ vote(const _mesa_glsl_parse_state *state)
    return state->ARB_shader_group_vote_enable;
 }
 
+static bool
+vote_ext(const _mesa_glsl_parse_state *state)
+{
+   return state->EXT_shader_group_vote_enable;
+}
+
 static bool
 vote_or_v460_desktop(const _mesa_glsl_parse_state *state)
 {
-   return state->ARB_shader_group_vote_enable || v460_desktop(state);
+   return state->EXT_shader_group_vote_enable || state->ARB_shader_group_vote_enable || v460_desktop(state);
 }
 
 static bool
@@ -4274,6 +4280,18 @@ builtin_builder::create_builtins()
                 _vote("__intrinsic_vote_eq", vote),
                 NULL);
 
+   add_function("anyInvocationEXT",
+                _vote("__intrinsic_vote_any", vote_ext),
+                NULL);
+
+   add_function("allInvocationsEXT",
+                _vote("__intrinsic_vote_all", vote_ext),
+                NULL);
+
+   add_function("allInvocationsEqualEXT",
+                _vote("__intrinsic_vote_eq", vote_ext),
+                NULL);
+
    add_function("anyInvocation",
                 _vote("__intrinsic_vote_any", v460_desktop),
                 NULL);
index e5c9f83e63a17342e2c8a7175aa70a9deb14ed51..647402eee3e6c4f24532a9ab1bcc4cd6a697bb18 100644 (file)
@@ -737,6 +737,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = {
    EXT(EXT_separate_shader_objects),
    EXT(EXT_shader_framebuffer_fetch),
    EXT(EXT_shader_framebuffer_fetch_non_coherent),
+   EXT(EXT_shader_group_vote),
    EXT(EXT_shader_image_load_formatted),
    EXT(EXT_shader_image_load_store),
    EXT(EXT_shader_implicit_conversions),
index bdc0d9ab827847c0e765fb5dcf0ae067f86fb04d..e6b9b196dad69ebc804e2cdeca708759f86e945c 100644 (file)
@@ -845,6 +845,8 @@ struct _mesa_glsl_parse_state {
    bool EXT_shader_framebuffer_fetch_warn;
    bool EXT_shader_framebuffer_fetch_non_coherent_enable;
    bool EXT_shader_framebuffer_fetch_non_coherent_warn;
+   bool EXT_shader_group_vote_enable;
+   bool EXT_shader_group_vote_warn;
    bool EXT_shader_image_load_formatted_enable;
    bool EXT_shader_image_load_formatted_warn;
    bool EXT_shader_image_load_store_enable;
index 18d5f8073bfc9c3888e4b6f3f41b192bbfca202b..9780bf0079a9c219fadb95f25fba445db759921d 100644 (file)
@@ -278,6 +278,7 @@ EXT(EXT_separate_shader_objects             , dummy_true
 EXT(EXT_separate_specular_color             , dummy_true                             , GLL,  x ,  x ,  x , 1997)
 EXT(EXT_shader_framebuffer_fetch            , EXT_shader_framebuffer_fetch           , GLL, GLC,  x , ES2, 2013)
 EXT(EXT_shader_framebuffer_fetch_non_coherent, EXT_shader_framebuffer_fetch_non_coherent, GLL, GLC,  x, ES2, 2018)
+EXT(EXT_shader_group_vote                   , ARB_shader_group_vote                  ,   x,   x,  x ,  30, 2013)
 EXT(EXT_shader_image_load_formatted         , EXT_shader_image_load_formatted        , GLL, GLC,  x ,  x , 2014)
 EXT(EXT_shader_image_load_store             , EXT_shader_image_load_store            , GLL, GLC,  x ,  x , 2010)
 EXT(EXT_shader_implicit_conversions         , dummy_true                             ,  x ,  x ,  x ,  31, 2013)