[Mesa-dev] [PATCH v3] glsl: update the extensions that are enabled for 460
Samuel Pitoiset
samuel.pitoiset at gmail.com
Thu Aug 3 09:25:24 UTC 2017
On 08/03/2017 02:44 AM, Ilia Mirkin wrote:
> Can you go through all the others and work out the suffixes too? Just
> going by memory, but the vote extension functions have suffixes, as do
> the atomic counter ones, maybe there's other stuff too...
Yes... Hopefully, this time is the good one. :)
>
> On Aug 2, 2017 2:15 PM, "Samuel Pitoiset" <samuel.pitoiset at gmail.com
> <mailto:samuel.pitoiset at gmail.com>> wrote:
>
> Other ones are either unsupported or don't have any helper
> function checks.
>
> v3: - always add gl_BaseVertex & co when 460 is enabled
> v2: - fix ARB_shader_draw_parameters system value names
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com
> <mailto:samuel.pitoiset at gmail.com>>
> ---
> src/compiler/glsl/builtin_functions.cpp | 6 ++++--
> src/compiler/glsl/builtin_variables.cpp | 5 +++++
> 2 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/src/compiler/glsl/builtin_functions.cpp
> b/src/compiler/glsl/builtin_functions.cpp
> index 84833bdd7d..5a0c78ec4a 100644
> --- a/src/compiler/glsl/builtin_functions.cpp
> +++ b/src/compiler/glsl/builtin_functions.cpp
> @@ -483,7 +483,8 @@ shader_atomic_counters(const
> _mesa_glsl_parse_state *state)
> static bool
> shader_atomic_counter_ops(const _mesa_glsl_parse_state *state)
> {
> - return state->ARB_shader_atomic_counter_ops_enable;
> + return (state->is_version(460, 0) ||
> + state->ARB_shader_atomic_counter_ops_enable);
> }
>
> static bool
> @@ -606,7 +607,8 @@ barrier_supported(const _mesa_glsl_parse_state
> *state)
> static bool
> vote(const _mesa_glsl_parse_state *state)
> {
> - return state->ARB_shader_group_vote_enable;
> + return (state->is_version(460, 0) ||
> + state->ARB_shader_group_vote_enable);
> }
>
> static bool
> diff --git a/src/compiler/glsl/builtin_variables.cpp
> b/src/compiler/glsl/builtin_variables.cpp
> index 19d427e4bc..ea2d897cc8 100644
> --- a/src/compiler/glsl/builtin_variables.cpp
> +++ b/src/compiler/glsl/builtin_variables.cpp
> @@ -1017,6 +1017,11 @@
> builtin_variable_generator::generate_vs_special_vars()
>
> if (state->is_version(130, 300))
> add_system_value(SYSTEM_VALUE_VERTEX_ID, int_t, "gl_VertexID");
> + if (state->is_version(460, 0)) {
> + add_system_value(SYSTEM_VALUE_BASE_VERTEX, int_t,
> "gl_BaseVertex");
> + add_system_value(SYSTEM_VALUE_BASE_INSTANCE, int_t,
> "gl_BaseInstance");
> + add_system_value(SYSTEM_VALUE_DRAW_ID, int_t, "gl_DrawID");
> + }
> 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))
> --
> 2.13.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org <mailto:mesa-dev at lists.freedesktop.org>
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> <https://lists.freedesktop.org/mailman/listinfo/mesa-dev>
>
More information about the mesa-dev
mailing list