summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_program.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_program.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_program.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_program.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c
index 6bad1560b2f..e362dcdf6ca 100644
--- a/src/gallium/drivers/vc4/vc4_program.c
+++ b/src/gallium/drivers/vc4/vc4_program.c
@@ -1076,17 +1076,11 @@ static void
emit_vertex_input(struct vc4_compile *c, int attr)
{
enum pipe_format format = c->vs_key->attr_formats[attr];
+ uint32_t attr_size = util_format_get_blocksize(format);
struct qreg vpm_reads[4];
- /* Right now, we're setting the VPM offsets to be 16 bytes wide every
- * time, so we always read 4 32-bit VPM entries.
- */
- for (int i = 0; i < 4; i++) {
- vpm_reads[i] = qir_get_temp(c);
- qir_emit(c, qir_inst(QOP_VPM_READ,
- vpm_reads[i],
- c->undef,
- c->undef));
+ for (int i = 0; i < align(attr_size, 4) / 4; i++) {
+ vpm_reads[i] = qir_VPM_READ(c);
c->num_inputs++;
}