diff options
author | Ian Romanick <idr@us.ibm.com> | 2008-01-30 17:26:22 -0800 |
---|---|---|
committer | Ben Skeggs <skeggsb@gmail.com> | 2008-02-15 13:50:26 +1100 |
commit | 805aacfe604eaf9b414336318b8e170dd898123c (patch) | |
tree | 65cc53d5ecf9f47c6fd87899d5cd8cd578dfdae4 /src | |
parent | ea1d5c43b28f16d5ff3bcc750d46143a35597a9e (diff) |
Fix size calculation in attribute fetch.
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/pipe/cell/spu/spu_vertex_fetch.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/pipe/cell/spu/spu_vertex_fetch.c b/src/mesa/pipe/cell/spu/spu_vertex_fetch.c index 0192227d57..1e846868e3 100644 --- a/src/mesa/pipe/cell/spu/spu_vertex_fetch.c +++ b/src/mesa/pipe/cell/spu/spu_vertex_fetch.c @@ -446,14 +446,14 @@ static void generic_vertex_fetch(struct spu_vs_context *draw, * difficulties doing that. */ for (i = 0; i < count; i++) { - uint8_t buffer[32 + (sizeof(float) * 4)] ALIGN16_ATTRIB; - const unsigned long addr = src + elts[i] * pitch; - const unsigned size = (sizeof(float) * 4) + (addr & 0x0f); + uint8_t buffer[32] ALIGN16_ATTRIB; + const unsigned long addr = src + (elts[i] * pitch); + const unsigned size = ((addr & 0x0f) == 0) ? 16 : 32; mfc_get(buffer, addr & ~0x0f, size, TAG_VERTEX_BUFFER, 0, 0); wait_on_mask(1 << TAG_VERTEX_BUFFER); - memcpy(& buffer, buffer + (addr & 0x0f), sizeof(float) * 4); + memmove(& buffer, buffer + (addr & 0x0f), 16); fetch(buffer, p[i]); } |