diff --git a/src/compiler/glsl/gl_nir_linker.c b/src/compiler/glsl/gl_nir_linker.c index d8ab7b3b317..674144f49b3 100644 --- a/src/compiler/glsl/gl_nir_linker.c +++ b/src/compiler/glsl/gl_nir_linker.c @@ -2662,7 +2662,7 @@ link_intrastage_shaders(void *mem_ctx, { bool arb_fragment_coord_conventions_enable = false; bool KHR_shader_subgroup_basic_enable = false; - int32_t view_mask = -1; + unsigned view_mask = 0; /* Check that global variables defined in multiple shaders are consistent. */ @@ -2678,13 +2678,16 @@ link_intrastage_shaders(void *mem_ctx, if (shader_list[i]->KHR_shader_subgroup_basic_enable) KHR_shader_subgroup_basic_enable = true; - if (view_mask != -1 && view_mask != shader_list[i]->view_mask) { - linker_error(prog, "vertex shader defined with " - "conflicting num_views (%d and %d)\n", - ffs(view_mask) - 1, ffs(shader_list[i]->view_mask) - 1); - return NULL; + if (shader_list[i]->view_mask != 0) { + if (view_mask != 0 && shader_list[i]->view_mask != view_mask) { + linker_error(prog, "vertex shader defined with " + "conflicting num_views (%d and %d)\n", + ffs(view_mask) - 1, ffs(shader_list[i]->view_mask) - 1); + return NULL; + } + + view_mask = shader_list[i]->view_mask; } - view_mask = shader_list[i]->view_mask; } if (!prog->data->LinkStatus)