diff options
author | bunnei <bunneidev@gmail.com> | 2021-07-24 07:27:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-24 07:27:50 +0200 |
commit | 84b9c42642379111d2241d7ba675c68340831a0f (patch) | |
tree | 27b7710caa8ef0f55ee3062f628a02fb8b985a8c | |
parent | Merge pull request #6551 from bunnei/improve-kernel-obj (diff) | |
parent | gl_buffer_cache: Use glClearNamedBufferSubData:GL_RED instead of GL_RGBA (diff) | |
download | yuzu-84b9c42642379111d2241d7ba675c68340831a0f.tar yuzu-84b9c42642379111d2241d7ba675c68340831a0f.tar.gz yuzu-84b9c42642379111d2241d7ba675c68340831a0f.tar.bz2 yuzu-84b9c42642379111d2241d7ba675c68340831a0f.tar.lz yuzu-84b9c42642379111d2241d7ba675c68340831a0f.tar.xz yuzu-84b9c42642379111d2241d7ba675c68340831a0f.tar.zst yuzu-84b9c42642379111d2241d7ba675c68340831a0f.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/buffer_cache/buffer_cache.h | 8 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_buffer_cache.cpp | 2 |
2 files changed, 3 insertions, 7 deletions
diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 7373cb62d..5a0b6f0c0 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -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; } diff --git a/src/video_core/renderer_opengl/gl_buffer_cache.cpp b/src/video_core/renderer_opengl/gl_buffer_cache.cpp index c4189fb60..a02a45e04 100644 --- a/src/video_core/renderer_opengl/gl_buffer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_buffer_cache.cpp @@ -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); } |