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,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::PipelineVertexInputDivisorStateCreateInfoEXT>();
vk::PipelineViewportStateCreateInfo viewportState{