aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2020-06-16 11:02:23 +1000
committerDave Airlie <[email protected]>2020-06-16 12:02:21 +1000
commitfce02f4020ae1a48ce02201df2895b9477ea22d2 (patch)
tree473048fd65cebf865df44695b53e666d54f3fe3f /src
parent25a629558ca1265c1d8423e3c8203795738358b5 (diff)
mesa/gles3: add support for GL_EXT_shader_group_vote
This is the GLES equivalent to ARB_shader_group_vote. Passes: KHR-GLES31.core.shader_group_vote.* Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5490>
Diffstat (limited to 'src')
-rw-r--r--src/compiler/glsl/builtin_functions.cpp20
-rw-r--r--src/compiler/glsl/glsl_parser_extras.cpp1
-rw-r--r--src/compiler/glsl/glsl_parser_extras.h2
-rw-r--r--src/mesa/main/extensions_table.h1
4 files changed, 23 insertions, 1 deletions
diff --git a/src/compiler/glsl/builtin_functions.cpp b/src/compiler/glsl/builtin_functions.cpp
index 1aead1d9e12..172633042ba 100644
--- a/src/compiler/glsl/builtin_functions.cpp
+++ b/src/compiler/glsl/builtin_functions.cpp
@@ -778,9 +778,15 @@ vote(const _mesa_glsl_parse_state *state)
}
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);
diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp
index e5c9f83e63a..647402eee3e 100644
--- a/src/compiler/glsl/glsl_parser_extras.cpp
+++ b/src/compiler/glsl/glsl_parser_extras.cpp
@@ -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),
diff --git a/src/compiler/glsl/glsl_parser_extras.h b/src/compiler/glsl/glsl_parser_extras.h
index bdc0d9ab827..e6b9b196dad 100644
--- a/src/compiler/glsl/glsl_parser_extras.h
+++ b/src/compiler/glsl/glsl_parser_extras.h
@@ -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;
diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index 18d5f8073bf..9780bf0079a 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -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)