mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-04 00:08:16 +02:00
radeonsi: fix unaligned clear_buffer fallback
This is unreachable currently, but it will be used by unaligned 8-bit and 16-bit fills. Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
parent
7f1e34e6c8
commit
65d0c558d5
1 changed files with 8 additions and 6 deletions
|
|
@ -176,12 +176,14 @@ static void si_clear_buffer(struct pipe_context *ctx, struct pipe_resource *dst,
|
|||
|
||||
/* Fallback for unaligned clears. */
|
||||
if (offset % 4 != 0 || size % 4 != 0) {
|
||||
uint32_t *map = sctx->b.ws->buffer_map(r600_resource(dst)->cs_buf,
|
||||
sctx->b.rings.gfx.cs,
|
||||
PIPE_TRANSFER_WRITE);
|
||||
size /= 4;
|
||||
for (unsigned i = 0; i < size; i++)
|
||||
*map++ = value;
|
||||
uint8_t *map = sctx->b.ws->buffer_map(r600_resource(dst)->cs_buf,
|
||||
sctx->b.rings.gfx.cs,
|
||||
PIPE_TRANSFER_WRITE);
|
||||
map += offset;
|
||||
for (unsigned i = 0; i < size; i++) {
|
||||
unsigned byte_within_dword = (offset + i) % 4;
|
||||
*map++ = (value >> (byte_within_dword * 8)) & 0xff;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue