From: Eric Anholt Date: Mon, 2 Oct 2017 20:02:32 +0000 (-0700) Subject: broadcom/vc5: Fix translation of transform feedback's output_register field. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bd94f6821e7bb3077df885375ef75741e7b804a0;p=mesa.git broadcom/vc5: Fix translation of transform feedback's output_register field. It's a NIR driver_location, not a slot offset. --- diff --git a/src/gallium/drivers/vc5/vc5_program.c b/src/gallium/drivers/vc5/vc5_program.c index d3b3d1bee70..869220b423d 100644 --- a/src/gallium/drivers/vc5/vc5_program.c +++ b/src/gallium/drivers/vc5/vc5_program.c @@ -36,6 +36,18 @@ #include "vc5_context.h" #include "broadcom/cle/v3d_packet_v33_pack.h" +static gl_varying_slot +vc5_get_slot_for_driver_location(nir_shader *s, uint32_t driver_location) +{ + nir_foreach_variable(var, &s->outputs) { + if (var->data.driver_location == driver_location) { + return var->data.location; + } + } + + return -1; +} + static void vc5_set_transform_feedback_outputs(struct vc5_uncompiled_shader *so, const struct pipe_stream_output_info *stream_output) @@ -73,9 +85,11 @@ vc5_set_transform_feedback_outputs(struct vc5_uncompiled_shader *so, * components of this varying. */ for (int j = 0; j < output->num_components; j++) { + gl_varying_slot slot = + vc5_get_slot_for_driver_location(so->base.ir.nir, output->register_index); + slots[slot_count] = - v3d_slot_from_slot_and_component(VARYING_SLOT_VAR0 + - output->register_index, + v3d_slot_from_slot_and_component(slot, output->start_component + j); slot_count++; }