summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_draw.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2015-01-09 12:56:34 -0800
committerEric Anholt <[email protected]>2015-01-10 13:54:12 +1300
commit92a0b0bd7099b15320faaccfd70b3c8dc877810e (patch)
treefb403c04ec6144c77c47b3e0c266ef67a74d0506 /src/gallium/drivers/vc4/vc4_draw.c
parent72cb6619cb75a92901d372d687505a747a384571 (diff)
vc4: Pack VPM attr contents according to just the size of the attribute.
total instructions in shared programs: 40960 -> 39753 (-2.95%) instructions in affected programs: 20871 -> 19664 (-5.78%)
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_draw.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_draw.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/drivers/vc4/vc4_draw.c b/src/gallium/drivers/vc4/vc4_draw.c
index 0d915040c88..77e98211c6c 100644
--- a/src/gallium/drivers/vc4/vc4_draw.c
+++ b/src/gallium/drivers/vc4/vc4_draw.c
@@ -197,6 +197,7 @@ vc4_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
cl_u32(&vc4->shader_rec, 0); /* UBO offset written by kernel */
uint32_t max_index = 0xffff;
+ uint32_t vpm_offset = 0;
for (int i = 0; i < vtx->num_elements; i++) {
struct pipe_vertex_element *elem = &vtx->pipe[i];
struct pipe_vertex_buffer *vb =
@@ -210,8 +211,10 @@ 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, i * 16); /* VS VPM offset */
- cl_u8(&vc4->shader_rec, i * 16); /* CS VPM offset */
+ cl_u8(&vc4->shader_rec, vpm_offset); /* VS VPM offset */
+ cl_u8(&vc4->shader_rec, vpm_offset); /* CS VPM offset */
+
+ vpm_offset += align(elem_size, 4) / 4;
if (vb->stride > 0) {
max_index = MIN2(max_index,