From 3c5eae639db9fba3215336da698a286f8f140c82 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 8 Jan 2025 08:17:04 -0500 Subject: [PATCH] glsl: make gl_ViewID_OVR visible to all shader stages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit according to spec Fixes: 328c29d6007 ("mesa,glsl,gallium: add GL_OVR_multiview") Reviewed-by: Adam Jackson Reviewed-by: Marek Olšák Part-of: --- src/compiler/glsl/builtin_variables.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler/glsl/builtin_variables.cpp b/src/compiler/glsl/builtin_variables.cpp index 70109945c8e..40e48eefb8d 100644 --- a/src/compiler/glsl/builtin_variables.cpp +++ b/src/compiler/glsl/builtin_variables.cpp @@ -1130,6 +1130,10 @@ builtin_variable_generator::generate_special_vars() add_system_value(SYSTEM_VALUE_SUBGROUP_LE_MASK, uvec4_t, "gl_SubgroupLeMask"); add_system_value(SYSTEM_VALUE_SUBGROUP_LT_MASK, uvec4_t, "gl_SubgroupLtMask"); } + if (state->is_version(300, 300) && state->OVR_multiview_enable){ + add_system_value(SYSTEM_VALUE_VIEW_INDEX, int_t, GLSL_PRECISION_MEDIUM, + "gl_ViewID_OVR"); + } } @@ -1143,10 +1147,6 @@ builtin_variable_generator::generate_vs_special_vars() add_system_value(SYSTEM_VALUE_VERTEX_ID, int_t, GLSL_PRECISION_HIGH, "gl_VertexID"); } - if (state->is_version(300, 300) && state->OVR_multiview_enable){ - add_system_value(SYSTEM_VALUE_VIEW_INDEX, int_t, GLSL_PRECISION_MEDIUM, - "gl_ViewID_OVR"); - } 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");