From 727f83e9693010d4d0d54fb1f1c81a6ddedded1c Mon Sep 17 00:00:00 2001 From: PixelyIon Date: Sun, 23 Jan 2022 01:37:42 +0530 Subject: [PATCH] Fix Incorrect Vertex Binding Divisor State Submission We always submit pipeline divisor descriptions regardless of binding input rate being vertex rather than instance. This is invalid behavior and has been fixed by only submitting binding descriptors when the input rate is per-instance. --- app/src/main/cpp/skyline/gpu/interconnect/graphics_context.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/cpp/skyline/gpu/interconnect/graphics_context.h b/app/src/main/cpp/skyline/gpu/interconnect/graphics_context.h index 593efa6d..694ddb23 100644 --- a/app/src/main/cpp/skyline/gpu/interconnect/graphics_context.h +++ b/app/src/main/cpp/skyline/gpu/interconnect/graphics_context.h @@ -2358,7 +2358,8 @@ namespace skyline::gpu::interconnect { if (vertexBufferView) { auto &vertexBuffer{vertexBuffers[index]}; vertexBindingDescriptions.push_back(vertexBuffer.bindingDescription); - vertexBindingDivisorsDescriptions.push_back(vertexBuffer.bindingDivisorDescription); + if (vertexBuffer.bindingDescription.inputRate == vk::VertexInputRate::eInstance) + vertexBindingDivisorsDescriptions.push_back(vertexBuffer.bindingDivisorDescription); std::scoped_lock vertexBufferLock(*vertexBufferView); vertexBufferHandles[index] = vertexBufferView->buffer->GetBacking(); @@ -2417,7 +2418,7 @@ namespace skyline::gpu::interconnect { } }; - if (!supportsVertexAttributeDivisor) + if (!supportsVertexAttributeDivisor || vertexBindingDivisorsDescriptions.empty()) vertexState.unlink(); vk::PipelineViewportStateCreateInfo viewportState{