diff options
author | Kenneth Graunke <[email protected]> | 2019-01-15 22:35:02 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2019-02-19 13:26:58 -0800 |
commit | f9c835eb56afc88a94b18052cbef001ae8a49031 (patch) | |
tree | ad182ff043cafa534fc212fe29e5b79280c869db /src/gallium/drivers/radeonsi/driinfo_radeonsi.h | |
parent | 3c2c6bd1c7636793ccb5e25f05677ae02e0fdb47 (diff) |
mesa: Align doubles to a 64-bit starting boundary, even if packing.
In the new Intel Iris driver, I am using Tim's new packed uniform
storage system. It works great, with one caveat: our scalar compiler
backend assumes that uniform offsets will be aligned to the underlying
data type. For example, doubles must be 64-bit aligned, floats 32-bit,
half-floats 16-bit, and so on. It does not need any other padding.
Currently, _mesa_add_parameter aligns everything to 32-bit offsets,
creating doubles that have an unaligned offset. This patch alters
that code to align doubles to 64-bit offsets.
This may be slightly less optimal for drivers which can support full
packing, and allow reads from unaligned offsets at no penalty. We could
make this extra alignment optional. However, it only comes into play
when intermixing double and single precision uniforms. Doubles are
already not too common, and intermixed values (floats then doubles)
is probably even less common. At most, we burn a single 32-bit slot
to the alignment, which is not that expensive. So, it doesn't seem
worthwhile to add the extra complexity.
Eventually, we'll likely want to update this code to allow half-float
values to be packed tighter than 32-bit offsets. At that point, we'll
probably want to revisit what drivers ultimately want, and add options.
Acked-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/driinfo_radeonsi.h')
0 files changed, 0 insertions, 0 deletions