Mesa (master): etnaviv: skip unused vertex attributes when assigning VS inputs

Christian Gmeiner austriancoder at kemper.freedesktop.org
Sat Oct 14 14:40:30 UTC 2017


Module: Mesa
Branch: master
Commit: 34360ac6eddd44f20aae2a382fc4c7a77f9096ba
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=34360ac6eddd44f20aae2a382fc4c7a77f9096ba

Author: Lucas Stach <l.stach at pengutronix.de>
Date:   Thu Oct 12 16:07:47 2017 +0200

etnaviv: skip unused vertex attributes when assigning VS inputs

When not all of the vertex attributes are actually used in the shader,
we end up with some inputs without an assigned reg. Those are marked
as invalid and must be skipped when assigning the inputs, as those would
overwrite other valid inputs otherwise.

Fixes piglit drawpixels and a bunch of other tests using the st_draw path.

Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
Reviewed-by: Wladimir J. van der Laan <laanwj at gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner at gmail.com>

---

 src/gallium/drivers/etnaviv/etnaviv_compiler.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/gallium/drivers/etnaviv/etnaviv_compiler.c b/src/gallium/drivers/etnaviv/etnaviv_compiler.c
index e2b906c2f6..41ab4031f6 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_compiler.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_compiler.c
@@ -2126,6 +2126,10 @@ fill_in_vs_inputs(struct etna_shader_variant *sobj, struct etna_compile *c)
    for (int idx = 0; idx < c->file[TGSI_FILE_INPUT].reg_size; ++idx) {
       struct etna_reg_desc *reg = &c->file[TGSI_FILE_INPUT].reg[idx];
       assert(sf->num_reg < ETNA_NUM_INPUTS);
+
+      if (!reg->native.valid)
+         continue;
+
       /* XXX exclude inputs with special semantics such as gl_frontFacing */
       sf->reg[sf->num_reg].reg = reg->native.id;
       sf->reg[sf->num_reg].semantic = reg->semantic;




More information about the mesa-commit mailing list