diff options
| author | 2020-04-28 02:24:33 -0300 | |
|---|---|---|
| committer | 2020-04-28 02:24:33 -0300 | |
| commit | d6a24b4a5b285217fa044a39741f2cdb40d8e966 (patch) | |
| tree | 2b98fbed32ffd6a565e64489ab007fd4b1b8f94d /src | |
| parent | Merge pull request #3766 from ReinUsesLisp/renderpass-cache-key (diff) | |
| download | yuzu-d6a24b4a5b285217fa044a39741f2cdb40d8e966.tar.gz yuzu-d6a24b4a5b285217fa044a39741f2cdb40d8e966.tar.xz yuzu-d6a24b4a5b285217fa044a39741f2cdb40d8e966.zip | |
vk_rasterizer: Skip index buffer setup when vertices are zero
Xenoblade 2 invokes a draw call with zero vertices.
This is likely due to indirect drawing (glDrawArraysIndirect).
This causes a crash in the staging buffer pool when trying to create a
buffer with a size of zero. To workaround this, skip index buffer setup
entirely when the number of indices is zero.
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index c821b1229..d634aa4ea 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp | |||
| @@ -896,6 +896,9 @@ void RasterizerVulkan::SetupVertexArrays(FixedPipelineState::VertexInput& vertex | |||
| 896 | 896 | ||
| 897 | void RasterizerVulkan::SetupIndexBuffer(BufferBindings& buffer_bindings, DrawParameters& params, | 897 | void RasterizerVulkan::SetupIndexBuffer(BufferBindings& buffer_bindings, DrawParameters& params, |
| 898 | bool is_indexed) { | 898 | bool is_indexed) { |
| 899 | if (params.num_vertices == 0) { | ||
| 900 | return; | ||
| 901 | } | ||
| 899 | const auto& regs = system.GPU().Maxwell3D().regs; | 902 | const auto& regs = system.GPU().Maxwell3D().regs; |
| 900 | switch (regs.draw.topology) { | 903 | switch (regs.draw.topology) { |
| 901 | case Maxwell::PrimitiveTopology::Quads: { | 904 | case Maxwell::PrimitiveTopology::Quads: { |