mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 08:58:02 +02:00
glsl: fix num_views linker error
The declaration must be the same across shaders but not all shaders must make the declaration. Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33149>
This commit is contained in:
parent
914697c4ac
commit
09f73024a5
1 changed files with 10 additions and 7 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue