Remove fast_path stream buffer for Vulkan
This commit is contained in:
parent
7944f271dc
commit
bb1739b642
1 changed files with 15 additions and 14 deletions
|
@ -778,11 +778,12 @@ void BufferCache<P>::BindHostGraphicsUniformBuffer(size_t stage, u32 index, u32
|
||||||
const u32 size = std::min(binding.size, (*uniform_buffer_sizes)[stage][index]);
|
const u32 size = std::min(binding.size, (*uniform_buffer_sizes)[stage][index]);
|
||||||
Buffer& buffer = slot_buffers[binding.buffer_id];
|
Buffer& buffer = slot_buffers[binding.buffer_id];
|
||||||
TouchBuffer(buffer, binding.buffer_id);
|
TouchBuffer(buffer, binding.buffer_id);
|
||||||
|
|
||||||
|
if constexpr (IS_OPENGL) {
|
||||||
const bool use_fast_buffer = binding.buffer_id != NULL_BUFFER_ID &&
|
const bool use_fast_buffer = binding.buffer_id != NULL_BUFFER_ID &&
|
||||||
size <= uniform_buffer_skip_cache_size &&
|
size <= uniform_buffer_skip_cache_size &&
|
||||||
!memory_tracker.IsRegionGpuModified(cpu_addr, size);
|
!memory_tracker.IsRegionGpuModified(cpu_addr, size);
|
||||||
if (use_fast_buffer) {
|
if (use_fast_buffer) {
|
||||||
if constexpr (IS_OPENGL) {
|
|
||||||
if (runtime.HasFastBufferSubData()) {
|
if (runtime.HasFastBufferSubData()) {
|
||||||
// Fast path for Nvidia
|
// Fast path for Nvidia
|
||||||
const bool should_fast_bind =
|
const bool should_fast_bind =
|
||||||
|
@ -796,18 +797,18 @@ void BufferCache<P>::BindHostGraphicsUniformBuffer(size_t stage, u32 index, u32
|
||||||
}
|
}
|
||||||
const auto span = ImmediateBufferWithData(cpu_addr, size);
|
const auto span = ImmediateBufferWithData(cpu_addr, size);
|
||||||
runtime.PushFastUniformBuffer(stage, binding_index, span);
|
runtime.PushFastUniformBuffer(stage, binding_index, span);
|
||||||
return;
|
} else {
|
||||||
}
|
|
||||||
}
|
|
||||||
if constexpr (IS_OPENGL) {
|
|
||||||
fast_bound_uniform_buffers[stage] |= 1U << binding_index;
|
fast_bound_uniform_buffers[stage] |= 1U << binding_index;
|
||||||
uniform_buffer_binding_sizes[stage][binding_index] = size;
|
uniform_buffer_binding_sizes[stage][binding_index] = size;
|
||||||
}
|
// Stream buffer path to avoid stalling on non-Nvidia drivers
|
||||||
// Stream buffer path to avoid stalling on non-Nvidia drivers or Vulkan
|
const std::span<u8> span =
|
||||||
const std::span<u8> span = runtime.BindMappedUniformBuffer(stage, binding_index, size);
|
runtime.BindMappedUniformBuffer(stage, binding_index, size);
|
||||||
cpu_memory.ReadBlockUnsafe(cpu_addr, span.data(), size);
|
cpu_memory.ReadBlockUnsafe(cpu_addr, span.data(), size);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Classic cached path
|
// Classic cached path
|
||||||
const bool sync_cached = SynchronizeBuffer(buffer, cpu_addr, size);
|
const bool sync_cached = SynchronizeBuffer(buffer, cpu_addr, size);
|
||||||
if (sync_cached) {
|
if (sync_cached) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue