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

Samuel Pitoiset samuel.pitoiset at gmail.com
Wed Aug 2 19:15:23 UTC 2017


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>
---
 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



More information about the mesa-dev mailing list