mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-28 13:28:01 +03:00
vk: Fix indexed multidraw
This commit is contained in:
parent
2f677ecebd
commit
01cf71e49a
2 changed files with 9 additions and 7 deletions
|
@ -972,21 +972,23 @@ void VKGSRender::emit_geometry(u32 sub_index)
|
|||
{
|
||||
const auto subranges = draw_call.get_subranges();
|
||||
const auto subranges_count = ::size32(subranges);
|
||||
const auto allocation_size = subranges_count * 3;
|
||||
const auto allocation_size = subranges_count * sizeof(VkMultiDrawIndexedInfoEXT);
|
||||
|
||||
m_multidraw_parameters_buffer.resize(allocation_size);
|
||||
auto _ptr = m_multidraw_parameters_buffer.data();
|
||||
auto _ptr = utils::bless<VkMultiDrawIndexedInfoEXT>(m_multidraw_parameters_buffer.data());
|
||||
u32 vertex_offset = 0;
|
||||
|
||||
for (const auto& range : subranges)
|
||||
{
|
||||
const auto count = get_index_count(draw_call.primitive, range.count);
|
||||
*_ptr++ = 0;
|
||||
*_ptr++ = vertex_offset;
|
||||
*_ptr++ = count;
|
||||
_ptr->firstIndex = vertex_offset;
|
||||
_ptr->indexCount = count;
|
||||
_ptr->vertexOffset = 0;
|
||||
|
||||
_ptr++;
|
||||
vertex_offset += count;
|
||||
}
|
||||
_vkCmdDrawMultiIndexedEXT(*m_current_command_buffer, subranges_count, utils::bless<const VkMultiDrawIndexedInfoEXT>(_ptr), 1, 0, sizeof(u32) * 3, nullptr);
|
||||
_vkCmdDrawMultiIndexedEXT(*m_current_command_buffer, subranges_count, _ptr, 1, 0, sizeof(u32) * 3, nullptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -147,7 +147,7 @@ private:
|
|||
VkDescriptorBufferInfo m_vertex_instructions_buffer_info {};
|
||||
VkDescriptorBufferInfo m_fragment_instructions_buffer_info {};
|
||||
|
||||
rsx::simple_array<u32> m_multidraw_parameters_buffer;
|
||||
rsx::simple_array<u8> m_multidraw_parameters_buffer;
|
||||
u64 m_xform_constants_dynamic_offset = 0; // We manage transform_constants dynamic offset manually to alleviate performance penalty of doing a hot-patch of constants.
|
||||
|
||||
std::array<vk::frame_context_t, VK_MAX_ASYNC_FRAMES> frame_context_storage;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue