From 06572c6011620081ae864ae20f7e9d01dd17bec1 Mon Sep 17 00:00:00 2001 From: eladash Date: Mon, 24 Sep 2018 10:07:46 +0300 Subject: [PATCH] rsx: Fix vertex count if all the streams are disabled --- rpcs3/Emu/RSX/GL/GLVertexBuffers.cpp | 2 +- rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/RSX/GL/GLVertexBuffers.cpp b/rpcs3/Emu/RSX/GL/GLVertexBuffers.cpp index d85062106a..1ed354b0a5 100644 --- a/rpcs3/Emu/RSX/GL/GLVertexBuffers.cpp +++ b/rpcs3/Emu/RSX/GL/GLVertexBuffers.cpp @@ -158,7 +158,7 @@ namespace vertex_input_state operator()(const rsx::draw_inlined_array& command) { - const u32 vertex_count = (u32)command.inline_vertex_array.size() * sizeof(u32) / m_vertex_layout.interleaved_blocks[0].attribute_stride; + const u32 vertex_count = m_vertex_layout.interleaved_blocks[0].locations.size() ? ((u32)command.inline_vertex_array.size() * sizeof(u32)) / m_vertex_layout.interleaved_blocks[0].attribute_stride : 0; if (!gl::is_primitive_native(rsx::method_registers.current_draw_clause.primitive)) { diff --git a/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp b/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp index 41fafee35b..84939ef461 100644 --- a/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp +++ b/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp @@ -212,7 +212,7 @@ namespace auto &draw_clause = rsx::method_registers.current_draw_clause; VkPrimitiveTopology prims = vk::get_appropriate_topology(draw_clause.primitive, primitives_emulated); - const u32 vertex_count = (u32)command.inline_vertex_array.size() * sizeof(u32) / m_vertex_layout.interleaved_blocks[0].attribute_stride; + const u32 vertex_count = m_vertex_layout.interleaved_blocks[0].locations.size() ? ((u32)command.inline_vertex_array.size() * sizeof(u32)) / m_vertex_layout.interleaved_blocks[0].attribute_stride : 0; if (!primitives_emulated) {