panfrost: Fixup vertex offsets to prevent shadow copy
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Mon, 15 Apr 2019 04:08:46 +0000 (04:08 +0000)
committerAlyssa Rosenzweig <alyssa@rosenzweig.io>
Fri, 19 Apr 2019 22:50:20 +0000 (22:50 +0000)
commit31d9caa23924a6076bd3f64b9aed7e212940437d
tree86a9e072c0d3b31e56f49fd1fe0714f42a1634f5
parente008d4f011b62c38be3e1401315dabc0df7e5b29
panfrost: Fixup vertex offsets to prevent shadow copy

Mali attribute buffers have to be 64-byte aligned. However, Gallium
enforces no such requirement; for unaligned buffers, we were previously
forced to create a shadow copy (slow!). To prevent this, we instead use
the offseted buffer's address with the lower bits masked off, and then
add those masked off bits to the src_offset. Proof of correctness
included, possibly for the opportunity to say "QED" unironically.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
src/gallium/drivers/panfrost/pan_context.c
src/gallium/drivers/panfrost/pan_context.h