mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
zink: fix variable locations in manual xfb emission
the last output isn't always only consuming 1 slot, so ensure that the
xfb outputs begin at the appropriate place
cc: mesa-stable
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16669>
(cherry picked from commit e9d28cbe3f)
This commit is contained in:
parent
274fcc2783
commit
692375bf9d
2 changed files with 5 additions and 4 deletions
|
|
@ -895,7 +895,7 @@
|
|||
"description": "zink: fix variable locations in manual xfb emission",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -4068,18 +4068,19 @@ nir_to_spirv(struct nir_shader *s, const struct zink_shader_info *sinfo, uint32_
|
|||
nir_foreach_shader_in_variable(var, s)
|
||||
emit_input(&ctx, var);
|
||||
|
||||
int max_output = -1;
|
||||
int max_output = 0;
|
||||
nir_foreach_shader_out_variable(var, s) {
|
||||
/* ignore SPIR-V built-ins, tagged with a sentinel value */
|
||||
if (var->data.driver_location != UINT_MAX) {
|
||||
assert(var->data.driver_location < INT_MAX);
|
||||
max_output = MAX2(max_output, (int)var->data.driver_location);
|
||||
unsigned extent = glsl_count_attribute_slots(var->type, false);
|
||||
max_output = MAX2(max_output, (int)var->data.driver_location + extent);
|
||||
}
|
||||
emit_output(&ctx, var);
|
||||
}
|
||||
|
||||
if (sinfo->last_vertex)
|
||||
emit_so_info(&ctx, sinfo, max_output + 1);
|
||||
emit_so_info(&ctx, sinfo, max_output);
|
||||
uint32_t tcs_vertices_out_word = 0;
|
||||
|
||||
/* we have to reverse iterate to match what's done in zink_compiler.c */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue