On 08/02/2017 09:06 PM, Gustaw Smolarczyk wrote:
2017-08-02 20:57 GMT+02:00 Samuel Pitoiset <[email protected]>:
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 <[email protected]>
---
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");
+ }
I am not a GLSL expert, but doesn't that mean that, with GLSL 4.60,
the gl_BaseVertex et. al. system values will only be defined when
ARB_shader_draw_parameters extension is enabled? I think you meant:
Oh yeah, my mistake, updated the patch too quickly.
if (state->is_version(460, 0)) {
// add ARB-less system values
}
if (state->ARB_shader_draw_parameters_enable) {
// add ARB-ful system values
}
(See for example gl_FragDepth and gl_FragDepthEXT)
Regards,
Gustaw
_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev