From cde14e143c443326297da3a4190ea021bb9b5fcf Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Sun, 18 Jun 2023 01:33:15 +0200 Subject: [PATCH] early-access version 3692 --- README.md | 2 +- src/video_core/buffer_cache/buffer_cache.h | 23 +++++++------------ .../renderer_vulkan/vk_buffer_cache.cpp | 2 +- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 108f19dd3..8db151651 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 3691. +This is the source code for early-access 3692. ## Legal Notice diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 765f17285..23f0d9817 100755 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -801,8 +801,7 @@ void BufferCache

::BindHostGraphicsUniformBuffer(size_t stage, u32 index, u32 !HasFastUniformBufferBound(stage, binding_index) || channel_state->uniform_buffer_binding_sizes[stage][binding_index] != size; if (should_fast_bind) { - // We only have to bind when the currently bound buffer is not the fast - // version + // We only have to bind when the currently bound buffer is not the fast version channel_state->fast_bound_uniform_buffers[stage] |= 1U << binding_index; channel_state->uniform_buffer_binding_sizes[stage][binding_index] = size; runtime.BindFastUniformBuffer(stage, binding_index, size); @@ -905,7 +904,6 @@ void BufferCache

::BindHostTransformFeedbackBuffers() { return; } HostBindings host_bindings; - bool any_valid{false}; for (u32 index = 0; index < NUM_TRANSFORM_FEEDBACK_BUFFERS; ++index) { const Binding& binding = channel_state->transform_feedback_buffers[index]; if (maxwell3d->regs.transform_feedback.controls[index].varying_count == 0 && @@ -921,12 +919,8 @@ void BufferCache

::BindHostTransformFeedbackBuffers() { host_bindings.buffers.push_back(&buffer); host_bindings.offsets.push_back(offset); host_bindings.sizes.push_back(binding.size); - host_bindings.min_index = std::min(host_bindings.min_index, index); - host_bindings.max_index = std::max(host_bindings.max_index, index); - any_valid = true; } - if (any_valid) { - host_bindings.max_index++; + if (host_bindings.buffers.size() > 0) { runtime.BindTransformFeedbackBuffers(host_bindings); } } @@ -1322,8 +1316,8 @@ typename BufferCache

::OverlapResult BufferCache

::ResolveOverlaps(VAddr cpu } stream_score += overlap.StreamScore(); if (stream_score > STREAM_LEAP_THRESHOLD && !has_stream_leap) { - // When this memory region has been joined a bunch of times, we assume it's being - // used as a stream buffer. Increase the size to skip constantly recreating buffers. + // When this memory region has been joined a bunch of times, we assume it's being used + // as a stream buffer. Increase the size to skip constantly recreating buffers. has_stream_leap = true; if (expands_right) { begin -= CACHING_PAGESIZE * 256; @@ -1717,17 +1711,16 @@ Binding BufferCache

::StorageBufferBinding(GPUVAddr ssbo_addr, u32 cbuf_index, const GPUVAddr gpu_addr = gpu_memory->Read(ssbo_addr); const auto size = [&]() { const bool is_nvn_cbuf = cbuf_index == 0; - // The NVN driver buffer (index 0) is known to pack the SSBO address followed by its - // size. + // The NVN driver buffer (index 0) is known to pack the SSBO address followed by its size. if (is_nvn_cbuf) { const u32 ssbo_size = gpu_memory->Read(ssbo_addr + 8); if (ssbo_size != 0) { return ssbo_size; } } - // Other titles (notably Doom Eternal) may use STG/LDG on buffer addresses in custom - // defined cbufs, which do not store the sizes adjacent to the addresses, so use the - // fully mapped buffer size for now. + // Other titles (notably Doom Eternal) may use STG/LDG on buffer addresses in custom defined + // cbufs, which do not store the sizes adjacent to the addresses, so use the fully + // mapped buffer size for now. const u32 memory_layout_size = static_cast(gpu_memory->GetMemoryLayoutSize(gpu_addr)); return std::min(memory_layout_size, static_cast(8_MiB)); }(); diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp index 0205d789b..4073882fe 100755 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp @@ -563,7 +563,7 @@ void BufferCacheRuntime::BindTransformFeedbackBuffers(VideoCommon::HostBindings< } scheduler.Record([bindings = std::move(bindings), buffer_handles = std::move(buffer_handles)](vk::CommandBuffer cmdbuf) { - cmdbuf.BindTransformFeedbackBuffersEXT(0, bindings.max_index - bindings.max_index, + cmdbuf.BindTransformFeedbackBuffersEXT(0, static_cast(buffer_handles.size()), buffer_handles.data(), bindings.offsets.data(), bindings.sizes.data()); });