summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-05-18 00:45:36 +0200
committerGitHub <noreply@github.com>2021-05-18 00:45:36 +0200
commit93bc59b62d8fa4f19bc26a10242fba48d93ceb04 (patch)
tree13333321679903743dae182dc7b3efd1e7342b62
parentMerge pull request #6328 from Morph1984/enforce-c4715 (diff)
parentbuffer_cache: Ensure null buffers cannot take the fast uniform bind path (diff)
downloadyuzu-93bc59b62d8fa4f19bc26a10242fba48d93ceb04.tar
yuzu-93bc59b62d8fa4f19bc26a10242fba48d93ceb04.tar.gz
yuzu-93bc59b62d8fa4f19bc26a10242fba48d93ceb04.tar.bz2
yuzu-93bc59b62d8fa4f19bc26a10242fba48d93ceb04.tar.lz
yuzu-93bc59b62d8fa4f19bc26a10242fba48d93ceb04.tar.xz
yuzu-93bc59b62d8fa4f19bc26a10242fba48d93ceb04.tar.zst
yuzu-93bc59b62d8fa4f19bc26a10242fba48d93ceb04.zip
-rw-r--r--src/video_core/buffer_cache/buffer_cache.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h
index 32dcbd693..de971041f 100644
--- a/src/video_core/buffer_cache/buffer_cache.h
+++ b/src/video_core/buffer_cache/buffer_cache.h
@@ -690,7 +690,10 @@ void BufferCache<P>::BindHostGraphicsUniformBuffer(size_t stage, u32 index, u32
const VAddr cpu_addr = binding.cpu_addr;
const u32 size = binding.size;
Buffer& buffer = slot_buffers[binding.buffer_id];
- if (size <= uniform_buffer_skip_cache_size && !buffer.IsRegionGpuModified(cpu_addr, size)) {
+ const bool use_fast_buffer = binding.buffer_id != NULL_BUFFER_ID &&
+ size <= uniform_buffer_skip_cache_size &&
+ !buffer.IsRegionGpuModified(cpu_addr, size);
+ if (use_fast_buffer) {
if constexpr (IS_OPENGL) {
if (runtime.HasFastBufferSubData()) {
// Fast path for Nvidia