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.
This commit is contained in:
PixelyIon 2022-01-23 01:37:42 +05:30
parent 9f7e80cf8f
commit 727f83e969

View File

@ -2358,6 +2358,7 @@ namespace skyline::gpu::interconnect {
if (vertexBufferView) { if (vertexBufferView) {
auto &vertexBuffer{vertexBuffers[index]}; auto &vertexBuffer{vertexBuffers[index]};
vertexBindingDescriptions.push_back(vertexBuffer.bindingDescription); vertexBindingDescriptions.push_back(vertexBuffer.bindingDescription);
if (vertexBuffer.bindingDescription.inputRate == vk::VertexInputRate::eInstance)
vertexBindingDivisorsDescriptions.push_back(vertexBuffer.bindingDivisorDescription); vertexBindingDivisorsDescriptions.push_back(vertexBuffer.bindingDivisorDescription);
std::scoped_lock vertexBufferLock(*vertexBufferView); std::scoped_lock vertexBufferLock(*vertexBufferView);
@ -2417,7 +2418,7 @@ namespace skyline::gpu::interconnect {
} }
}; };
if (!supportsVertexAttributeDivisor) if (!supportsVertexAttributeDivisor || vertexBindingDivisorsDescriptions.empty())
vertexState.unlink<vk::PipelineVertexInputDivisorStateCreateInfoEXT>(); vertexState.unlink<vk::PipelineVertexInputDivisorStateCreateInfoEXT>();
vk::PipelineViewportStateCreateInfo viewportState{ vk::PipelineViewportStateCreateInfo viewportState{