diff --git a/.pick_status.json b/.pick_status.json index c5048c0c386..52a9dcc3dea 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -40,7 +40,7 @@ "description": "zink: fix big tcs output io", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/zink/zink_compiler.c b/src/gallium/drivers/zink/zink_compiler.c index e03036ca8f8..cfa89f47c86 100644 --- a/src/gallium/drivers/zink/zink_compiler.c +++ b/src/gallium/drivers/zink/zink_compiler.c @@ -2659,11 +2659,18 @@ assign_consumer_var_io(gl_shader_stage stage, nir_variable *var, unsigned *reser var->data.driver_location = -1; return true; } + /* patch variables may be read in the workgroup */ if (stage != MESA_SHADER_TESS_CTRL) /* dead io */ return false; - /* patch variables may be read in the workgroup */ - slot_map[slot] = (*reserved)++; + unsigned num_slots; + if (nir_is_arrayed_io(var, stage)) + num_slots = glsl_count_vec4_slots(glsl_get_array_element(var->type), false, false); + else + num_slots = glsl_count_vec4_slots(var->type, false, false); + assert(*reserved + num_slots <= MAX_VARYING); + for (unsigned i = 0; i < num_slots; i++) + slot_map[slot + i] = (*reserved)++; } var->data.driver_location = slot_map[slot]; }