diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c index 118d1e52736..49d089e567b 100644 --- a/src/gallium/drivers/r300/r300_blit.c +++ b/src/gallium/drivers/r300/r300_blit.c @@ -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) { diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 01a6ce06cd0..dda3bceeb59 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -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 */ diff --git a/src/gallium/drivers/r300/r300_texture.h b/src/gallium/drivers/r300/r300_texture.h index 5480385cf1c..a3dc7b31a8c 100644 --- a/src/gallium/drivers/r300/r300_texture.h +++ b/src/gallium/drivers/r300/r300_texture.h @@ -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,