From 3ab0f02cec6136c42d5bb7168f3cf2a5dd84b8b6 Mon Sep 17 00:00:00 2001 From: weihuoya Date: Mon, 3 Dec 2018 19:23:36 +0800 Subject: [PATCH] vulkan: fx index buffer reserve size --- Source/Core/VideoBackends/Vulkan/VertexManager.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/Core/VideoBackends/Vulkan/VertexManager.cpp b/Source/Core/VideoBackends/Vulkan/VertexManager.cpp index d6059a0062..4fa3a92b09 100644 --- a/Source/Core/VideoBackends/Vulkan/VertexManager.cpp +++ b/Source/Core/VideoBackends/Vulkan/VertexManager.cpp @@ -98,7 +98,8 @@ void VertexManager::ResetBuffer(u32 stride) // Attempt to allocate from buffers bool has_vbuffer_allocation = m_vertex_stream_buffer->ReserveMemory(MAXVBUFFERSIZE, stride); - bool has_ibuffer_allocation = m_index_stream_buffer->ReserveMemory(MAXIBUFFERSIZE, sizeof(u16)); + bool has_ibuffer_allocation = + m_index_stream_buffer->ReserveMemory(MAXIBUFFERSIZE * sizeof(u16), sizeof(u16)); if (!has_vbuffer_allocation || !has_ibuffer_allocation) { // Flush any pending commands first, so that we can wait on the fences @@ -109,7 +110,8 @@ void VertexManager::ResetBuffer(u32 stride) if (!has_vbuffer_allocation) has_vbuffer_allocation = m_vertex_stream_buffer->ReserveMemory(MAXVBUFFERSIZE, stride); if (!has_ibuffer_allocation) - has_ibuffer_allocation = m_index_stream_buffer->ReserveMemory(MAXIBUFFERSIZE, sizeof(u16)); + has_ibuffer_allocation = + m_index_stream_buffer->ReserveMemory(MAXIBUFFERSIZE * sizeof(u16), sizeof(u16)); // If we still failed, that means the allocation was too large and will never succeed, so panic if (!has_vbuffer_allocation || !has_ibuffer_allocation)