mesa/src/imagination
Oskar Rundgren 0e3c828fc4 pvr: PBE fix mesa pipe swizzle conversion
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>
2023-05-17 08:18:25 +00:00
..
common pvr: Add support to process transfer and blit cmds 2023-04-19 11:01:05 +00:00
csbgen pvr: add GUARD_SIZE_DEFAULT for CDM and VDM control stream links 1 and 2 2023-05-10 13:13:07 +00:00
include pvr: Transfer fix blit with multiple emits 2023-05-16 18:09:03 +00:00
rogue pvr: Don't ralloc build context from compiler 2023-05-04 10:35:30 +00:00
vulkan pvr: PBE fix mesa pipe swizzle conversion 2023-05-17 08:18:25 +00:00
.clang-format pvr: Add support for validating modifier combos 2023-02-24 11:29:48 +00:00
.dir-locals.el
.editorconfig pvr: Change indentation from tab to spaces for xml files. 2022-08-31 08:26:17 +00:00
meson.build