wildcard
3 days ago
committed by
crueter
No known key found for this signature in database
GPG Key ID: 425ACD2D4830EBC6
2 changed files with
13 additions and
0 deletions
-
src/video_core/renderer_vulkan/vk_buffer_cache.cpp
-
src/video_core/vulkan_common/vulkan_device.h
|
|
@ -108,6 +108,14 @@ VkBufferView Buffer::View(u32 offset, u32 size, VideoCore::Surface::PixelFormat |
|
|
// Null buffer not supported, adjust offset and size
|
|
|
// Null buffer not supported, adjust offset and size
|
|
|
offset = 0; |
|
|
offset = 0; |
|
|
size = 0; |
|
|
size = 0; |
|
|
|
|
|
} else { |
|
|
|
|
|
// Align offset down to minTexelBufferOffsetAlignment
|
|
|
|
|
|
const u32 alignment = static_cast<u32>(device->GetMinTexelBufferOffsetAlignment()); |
|
|
|
|
|
if (alignment > 1) { |
|
|
|
|
|
const u32 aligned_offset = offset & ~(alignment - 1); |
|
|
|
|
|
size += offset - aligned_offset; |
|
|
|
|
|
offset = aligned_offset; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
const auto it{std::ranges::find_if(views, [offset, size, format](const BufferView& view) { |
|
|
const auto it{std::ranges::find_if(views, [offset, size, format](const BufferView& view) { |
|
|
return offset == view.offset && size == view.size && format == view.format; |
|
|
return offset == view.offset && size == view.size && format == view.format; |
|
|
|
|
|
@ -318,6 +318,11 @@ public: |
|
|
return properties.properties.limits.minStorageBufferOffsetAlignment; |
|
|
return properties.properties.limits.minStorageBufferOffsetAlignment; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// Returns texel buffer offset alignment requirement. |
|
|
|
|
|
VkDeviceSize GetMinTexelBufferOffsetAlignment() const { |
|
|
|
|
|
return properties.properties.limits.minTexelBufferOffsetAlignment; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/// Returns the maximum range for storage buffers. |
|
|
/// Returns the maximum range for storage buffers. |
|
|
VkDeviceSize GetMaxStorageBufferRange() const { |
|
|
VkDeviceSize GetMaxStorageBufferRange() const { |
|
|
return properties.properties.limits.maxStorageBufferRange; |
|
|
return properties.properties.limits.maxStorageBufferRange; |
|
|
|