From 5f6c76af51bd41508c38c153bd471f9a6e7ee663 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 9 Dec 2023 14:54:17 -0500 Subject: VideoCommon: Use std::span for BoundingBox::Write() Crosses off a lingering TODO. Also amends a few nearby cases where a u32 cast was being repromoted to size_t. --- Source/Core/VideoBackends/Vulkan/VKBoundingBox.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'Source/Core/VideoBackends/Vulkan/VKBoundingBox.cpp') diff --git a/Source/Core/VideoBackends/Vulkan/VKBoundingBox.cpp b/Source/Core/VideoBackends/Vulkan/VKBoundingBox.cpp index 7765e97a25..af51293500 100644 --- a/Source/Core/VideoBackends/Vulkan/VKBoundingBox.cpp +++ b/Source/Core/VideoBackends/Vulkan/VKBoundingBox.cpp @@ -77,7 +77,7 @@ std::vector VKBoundingBox::Read(u32 index, u32 length) return values; } -void VKBoundingBox::Write(u32 index, const std::vector& values) +void VKBoundingBox::Write(u32 index, std::span values) { // We can't issue vkCmdUpdateBuffer within a render pass. // However, the writes must be serialized, so we can't put it in the init buffer. @@ -91,8 +91,7 @@ void VKBoundingBox::Write(u32 index, const std::vector& values) // Write the values to the GPU buffer vkCmdUpdateBuffer(g_command_buffer_mgr->GetCurrentCommandBuffer(), m_gpu_buffer, - index * sizeof(BBoxType), values.size() * sizeof(BBoxType), - reinterpret_cast(values.data())); + index * sizeof(BBoxType), values.size() * sizeof(BBoxType), values.data()); // Restore fragment shader access to the buffer. StagingBuffer::BufferMemoryBarrier( -- cgit v1.2.3