mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 02:48:06 +02:00
r300: fix BE 32-bit CBZB clear values
CBZB clears use ZB_DEPTHCLEARVALUE for the clear color. On big-endian hosts the 32-bit payload needs little-endian byte order. Fixes fast_color_clear/all-colors on RV350. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40885>
This commit is contained in:
parent
c5423d3e27
commit
c52bc90076
1 changed files with 9 additions and 4 deletions
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
#include "util/format/u_format.h"
|
||||
#include "util/half_float.h"
|
||||
#include "util/u_math.h"
|
||||
#include "util/u_pack_color.h"
|
||||
#include "util/u_surface.h"
|
||||
|
||||
|
|
@ -110,10 +111,14 @@ static uint32_t r300_depth_clear_cb_value(enum pipe_format format,
|
|||
union util_color uc;
|
||||
util_pack_color(rgba, format, &uc);
|
||||
|
||||
if (util_format_get_blocksizebits(format) == 32)
|
||||
return uc.ui[0];
|
||||
else
|
||||
return uc.us | (uc.us << 16);
|
||||
if (util_format_get_blocksizebits(format) == 32) {
|
||||
/* CBZB clears reuse ZB_DEPTHCLEARVALUE, which expects the 32-bit
|
||||
* payload in little-endian byte order.
|
||||
*/
|
||||
return util_cpu_to_le32(uc.ui[0]);
|
||||
}
|
||||
|
||||
return uc.us | (uc.us << 16);
|
||||
}
|
||||
|
||||
static bool r300_cbzb_clear_allowed(struct r300_context *r300,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue