mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 11:28:05 +02:00
r300: fix BE CBZB clears for swapped 8888 formats
On big-endian hosts, r300 handles A8R8G8B8 and X8R8G8B8 by using DWORD swap and programming component order as the matching B8G8R8A8 or B8G8R8X8 formats. Reuse the same mapping when packing CBZB clear colors. Fixes the bad lower-screen colors in Extreme TuxRacer on RV350. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40885>
This commit is contained in:
parent
c52bc90076
commit
5aa4bdc8e7
3 changed files with 8 additions and 3 deletions
|
|
@ -109,6 +109,9 @@ static uint32_t r300_depth_clear_cb_value(enum pipe_format format,
|
|||
const float* rgba)
|
||||
{
|
||||
union util_color uc;
|
||||
|
||||
format = r300_unbyteswap_array_format(format);
|
||||
|
||||
util_pack_color(rgba, format, &uc);
|
||||
|
||||
if (util_format_get_blocksizebits(format) == 32) {
|
||||
|
|
|
|||
|
|
@ -25,10 +25,10 @@
|
|||
* The swizzles must be set exactly like their non-swapped counterparts,
|
||||
* because byte-swapping is what reverses the component order, not swizzling.
|
||||
*
|
||||
* This function returns the format that must be used to program CB and TX
|
||||
* swizzles.
|
||||
* This function returns the format that must be used to handle component order
|
||||
* for r300 byte-swapped array formats.
|
||||
*/
|
||||
static enum pipe_format r300_unbyteswap_array_format(enum pipe_format format)
|
||||
enum pipe_format r300_unbyteswap_array_format(enum pipe_format format)
|
||||
{
|
||||
/* FIXME: Disabled on little endian because of a reported regression:
|
||||
* https://bugs.freedesktop.org/show_bug.cgi?id=98869 */
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@ unsigned r300_get_swizzle_combined(const unsigned char *swizzle_format,
|
|||
const unsigned char *swizzle_view,
|
||||
bool dxtc_swizzle);
|
||||
|
||||
enum pipe_format r300_unbyteswap_array_format(enum pipe_format format);
|
||||
|
||||
uint32_t r300_translate_texformat(enum pipe_format format,
|
||||
const unsigned char *swizzle_view,
|
||||
bool is_r500,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue