Browse Source

another fixed for cursed driver

pull/2718/head
Ribbit 5 months ago
parent
commit
ccb963e32f
  1. 14
      src/video_core/buffer_cache/buffer_cache.h
  2. 4
      src/video_core/renderer_vulkan/vk_buffer_cache.h

14
src/video_core/buffer_cache/buffer_cache.h

@ -835,6 +835,20 @@ void BufferCache<P>::BindHostGraphicsUniformBuffer(size_t stage, u32 index, u32
return;
}
const u32 offset = buffer.Offset(device_addr);
if constexpr (!IS_OPENGL) {
if constexpr (requires(const Runtime& r) { r.GetUniformBufferAlignment(); }) {
const u32 ubo_align = runtime.GetUniformBufferAlignment();
if (ubo_align != 0 && (offset % ubo_align) != 0) {
if constexpr (HAS_PERSISTENT_UNIFORM_BUFFER_BINDINGS) {
channel_state->uniform_buffer_binding_sizes[stage][binding_index] = size;
}
const std::span<u8> span = runtime.BindMappedUniformBuffer(stage, binding_index, size);
device_memory.ReadBlockUnsafe(device_addr, span.data(), size);
return;
}
}
}
if constexpr (IS_OPENGL) {
// Mark the index as dirty if offset doesn't match
const bool is_copy_bind = offset != 0 && !runtime.SupportsNonZeroUniformOffset();

4
src/video_core/renderer_vulkan/vk_buffer_cache.h

@ -98,6 +98,10 @@ public:
return device.GetDriverID() == VK_DRIVER_ID_QUALCOMM_PROPRIETARY;
}
u32 GetUniformBufferAlignment() const {
return static_cast<u32>(device.GetUniformBufferAlignment());
}
u32 GetStorageBufferAlignment() const;
[[nodiscard]] StagingBufferRef UploadStagingBuffer(size_t size);

Loading…
Cancel
Save