[Mesa-dev] [PATCH] glsl: update the extensions that are enabled for 460

Samuel Pitoiset samuel.pitoiset at gmail.com
Wed Aug 2 18:52:40 UTC 2017



On 08/02/2017 06:24 PM, Ilia Mirkin wrote:
> 
> 
> On Aug 2, 2017 6:56 AM, "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.
> 
>     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 | 2 +-
>       src/compiler/glsl/glsl_parser_extras.h  | 5 +++++
>       3 files changed, 10 insertions(+), 3 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..572a84785b 100644
>     --- a/src/compiler/glsl/builtin_variables.cpp
>     +++ b/src/compiler/glsl/builtin_variables.cpp
>     @@ -1021,7 +1021,7 @@
>     builtin_variable_generator::generate_vs_special_vars()
>             add_system_value(SYSTEM_VALUE_INSTANCE_ID, int_t,
>     "gl_InstanceIDARB");
>          if (state->ARB_draw_instanced_enable || state->is_version(140,
>     300))
>             add_system_value(SYSTEM_VALUE_INSTANCE_ID, int_t,
>     "gl_InstanceID");
>     -   if (state->ARB_shader_draw_parameters_enable) {
>     +   if (state->has_shader_draw_parameters()) {
>             add_system_value(SYSTEM_VALUE_BASE_VERTEX, int_t,
>     "gl_BaseVertexARB");
>             add_system_value(SYSTEM_VALUE_BASE_INSTANCE, int_t,
>     "gl_BaseInstanceARB");
>             add_system_value(SYSTEM_VALUE_DRAW_ID, int_t, "gl_DrawIDARB");
> 
> 
> I haven't read the spec, but are you sure about those suffixes for the 
> core GL support?

Good catch, no ARB suffix for 460. :)

> 
>     diff --git a/src/compiler/glsl/glsl_parser_extras.h
>     b/src/compiler/glsl/glsl_parser_extras.h
>     index fb35813087..c229030ef7 100644
>     --- a/src/compiler/glsl/glsl_parser_extras.h
>     +++ b/src/compiler/glsl/glsl_parser_extras.h
>     @@ -339,6 +339,11 @@ struct _mesa_glsl_parse_state {
>             return ARB_bindless_texture_enable;
>          }
> 
>     +   bool has_shader_draw_parameters() const
>     +   {
>     +      return ARB_shader_draw_parameters_enable || is_version(460, 0);
>     +   }
>     +
>          void process_version_directive(YYLTYPE *locp, int version,
>                                         const char *ident);
> 
>     --
>     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