mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-10 01:40:14 +01:00
mesa: clear existing swizzle info before bitwise-OR
This patch fixes a bug in big-endian treatment, where the previous
swizzle info wasn't cleared before a new swizzle info was inserted into
the format field using a bitwise-OR operation.
v2: use MESA_ARRAY_FORMAT_SWIZZLE_*_MASK instead of numeric constants
v3: align according to coding style
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
CC: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
(cherry picked from commit 2ac171a7db)
This commit is contained in:
parent
d02bb82d52
commit
d706b00522
1 changed files with 5 additions and 0 deletions
|
|
@ -191,6 +191,11 @@ static inline void
|
|||
_mesa_array_format_set_swizzle(mesa_array_format *f,
|
||||
int32_t x, int32_t y, int32_t z, int32_t w)
|
||||
{
|
||||
*f &= ~(MESA_ARRAY_FORMAT_SWIZZLE_X_MASK |
|
||||
MESA_ARRAY_FORMAT_SWIZZLE_Y_MASK |
|
||||
MESA_ARRAY_FORMAT_SWIZZLE_Z_MASK |
|
||||
MESA_ARRAY_FORMAT_SWIZZLE_W_MASK);
|
||||
|
||||
*f |= ((x << 8 ) & MESA_ARRAY_FORMAT_SWIZZLE_X_MASK) |
|
||||
((y << 11) & MESA_ARRAY_FORMAT_SWIZZLE_Y_MASK) |
|
||||
((z << 14) & MESA_ARRAY_FORMAT_SWIZZLE_Z_MASK) |
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue