mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-12-22 16:30:57 +01:00
Merge pull request #6690 from ReinUsesLisp/dma-clear-fixups
buffer_cache: Misc fixups related to buffer clears
This commit is contained in:
commit
84b9c42642
2 changed files with 3 additions and 7 deletions
|
@ -553,13 +553,9 @@ bool BufferCache<P>::DMAClear(GPUVAddr dst_address, u64 amount, u32 value) {
|
|||
ClearDownload(subtract_interval);
|
||||
common_ranges.subtract(subtract_interval);
|
||||
|
||||
BufferId buffer;
|
||||
do {
|
||||
has_deleted_buffers = false;
|
||||
buffer = FindBuffer(*cpu_dst_address, static_cast<u32>(size));
|
||||
} while (has_deleted_buffers);
|
||||
const BufferId buffer = FindBuffer(*cpu_dst_address, static_cast<u32>(size));
|
||||
auto& dest_buffer = slot_buffers[buffer];
|
||||
const u32 offset = static_cast<u32>(*cpu_dst_address - dest_buffer.CpuAddr());
|
||||
const u32 offset = dest_buffer.Offset(*cpu_dst_address);
|
||||
runtime.ClearBuffer(dest_buffer, offset, size, value);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ void BufferCacheRuntime::CopyBuffer(Buffer& dst_buffer, Buffer& src_buffer,
|
|||
|
||||
void BufferCacheRuntime::ClearBuffer(Buffer& dest_buffer, u32 offset, size_t size, u32 value) {
|
||||
glClearNamedBufferSubData(dest_buffer.Handle(), GL_R32UI, static_cast<GLintptr>(offset),
|
||||
static_cast<GLsizeiptr>(size / sizeof(u32)), GL_RGBA, GL_UNSIGNED_INT,
|
||||
static_cast<GLsizeiptr>(size / sizeof(u32)), GL_RED, GL_UNSIGNED_INT,
|
||||
&value);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue