broadcom/vc5: Fix translation of transform feedback's output_register field.
It's a NIR driver_location, not a slot offset.
This commit is contained in:
@@ -36,6 +36,18 @@
|
|||||||
#include "vc5_context.h"
|
#include "vc5_context.h"
|
||||||
#include "broadcom/cle/v3d_packet_v33_pack.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
|
static void
|
||||||
vc5_set_transform_feedback_outputs(struct vc5_uncompiled_shader *so,
|
vc5_set_transform_feedback_outputs(struct vc5_uncompiled_shader *so,
|
||||||
const struct pipe_stream_output_info *stream_output)
|
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.
|
* components of this varying.
|
||||||
*/
|
*/
|
||||||
for (int j = 0; j < output->num_components; j++) {
|
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] =
|
slots[slot_count] =
|
||||||
v3d_slot_from_slot_and_component(VARYING_SLOT_VAR0 +
|
v3d_slot_from_slot_and_component(slot,
|
||||||
output->register_index,
|
|
||||||
output->start_component + j);
|
output->start_component + j);
|
||||||
slot_count++;
|
slot_count++;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user