summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_draw.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2015-01-10 14:30:25 +1300
committerEric Anholt <[email protected]>2015-01-10 15:24:56 +1300
commitb920ecf793bd419558a240014624add08774765d (patch)
treeb1ae0fb208547b3e14237f2fe202fb328500c937 /src/gallium/drivers/vc4/vc4_draw.c
parentc772c92153fdcd4ba4920b7ef1745ce83b09603b (diff)
vc4: Cook up the draw-time VPM setup info during shader compile.
This will give the compiler the chance to dead-code eliminate unused VPM reads. This is particularly a big deal in the CS where a bunch of vattrs are just not going to be used.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_draw.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_draw.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gallium/drivers/vc4/vc4_draw.c b/src/gallium/drivers/vc4/vc4_draw.c
index cc3f2d42183..bb4b9a42217 100644
--- a/src/gallium/drivers/vc4/vc4_draw.c
+++ b/src/gallium/drivers/vc4/vc4_draw.c
@@ -185,14 +185,14 @@ vc4_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
cl_u32(&vc4->shader_rec, 0); /* UBO offset written by kernel */
cl_u16(&vc4->shader_rec, 0); /* vs num uniforms */
- cl_u8(&vc4->shader_rec, (1 << num_elements_emit) - 1); /* vs attribute array bitfield */
- cl_u8(&vc4->shader_rec, 16 * num_elements_emit); /* vs total attribute size */
+ cl_u8(&vc4->shader_rec, vc4->prog.vs->vattrs_live);
+ cl_u8(&vc4->shader_rec, vc4->prog.vs->vattr_offsets[8]);
cl_reloc(vc4, &vc4->shader_rec, vc4->prog.vs->bo, 0);
cl_u32(&vc4->shader_rec, 0); /* UBO offset written by kernel */
cl_u16(&vc4->shader_rec, 0); /* cs num uniforms */
- cl_u8(&vc4->shader_rec, (1 << num_elements_emit) - 1); /* cs attribute array bitfield */
- cl_u8(&vc4->shader_rec, 16 * num_elements_emit); /* cs total attribute size */
+ cl_u8(&vc4->shader_rec, vc4->prog.cs->vattrs_live);
+ cl_u8(&vc4->shader_rec, vc4->prog.cs->vattr_offsets[8]);
cl_reloc(vc4, &vc4->shader_rec, vc4->prog.cs->bo, 0);
cl_u32(&vc4->shader_rec, 0); /* UBO offset written by kernel */
@@ -211,8 +211,8 @@ vc4_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
cl_reloc(vc4, &vc4->shader_rec, rsc->bo, offset);
cl_u8(&vc4->shader_rec, elem_size - 1);
cl_u8(&vc4->shader_rec, vb->stride);
- cl_u8(&vc4->shader_rec, vpm_offset); /* VS VPM offset */
- cl_u8(&vc4->shader_rec, vpm_offset); /* CS VPM offset */
+ cl_u8(&vc4->shader_rec, vc4->prog.vs->vattr_offsets[i]);
+ cl_u8(&vc4->shader_rec, vc4->prog.cs->vattr_offsets[i]);
vpm_offset += align(elem_size, 4);