mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-04 19:10:35 +02:00
The swizzle of pipe formats is described in
"struct util_format_description". The struct has array
"unsigned char swizzle[4];". The index of the array is the colour
channel (in the order R, G, B and A). The value is what position
the colour channel is sourced from.
In PBE register settings (REG_SWIZ_CHAN[0-3]) the register index is
output channel position (and not colour). The colours are in the PBE
source channels - SWIZ_SOURCE_CHAN0 typically red.
The function pvr_get_pbe_hw_swizzle doesn't translate the swizzle
correctly. Remove function and replace with switch for each colour.
This could be done in a for loop, but there is just as much code
in the loop, it involves pointers and it's less readable for humans.
That's why I opted for this implementation.
Fixed test:
dEQP-VK.api.copy_and_blit.core.image_to_image
.all_formats.color.2d.r4g4b4a4_unorm_pack16.b4g4r4a4_unorm_pack16
and other with this pixel format.
Signed-off-by: Oskar Rundgren <oskar.rundgren@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22958>
|
||
|---|---|---|
| .. | ||
| common | ||
| csbgen | ||
| include | ||
| rogue | ||
| vulkan | ||
| .clang-format | ||
| .dir-locals.el | ||
| .editorconfig | ||
| meson.build | ||