[Mesa-dev] [PATCH v2] glsl: update the extensions that are enabled for 460
Samuel Pitoiset
samuel.pitoiset at gmail.com
Wed Aug 2 18:57:44 UTC 2017
Other ones are either unsupported or don't have any helper
function checks.
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 | 12 +++++++++---
2 files changed, 13 insertions(+), 5 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..56163e543f 100644
--- a/src/compiler/glsl/builtin_variables.cpp
+++ b/src/compiler/glsl/builtin_variables.cpp
@@ -1022,9 +1022,15 @@ builtin_variable_generator::generate_vs_special_vars()
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) {
- 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");
+ 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");
+ } else {
+ 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");
+ }
}
if (state->AMD_vertex_shader_layer_enable ||
state->ARB_shader_viewport_layer_array_enable) {
--
2.13.3
More information about the mesa-dev
mailing list