Avoid setting stride if dynamic state is supported
This commit is contained in:
parent
f085b47b30
commit
2fd093d4b4
4 changed files with 15 additions and 9 deletions
|
@ -1378,7 +1378,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
{
|
||||
int count = Math.Min(Constants.MaxVertexBuffers, vertexBuffers.Length);
|
||||
|
||||
_newState.Internal.VertexBindingDescriptions[0] = new VertexInputBindingDescription(0, 0, VertexInputRate.Vertex);
|
||||
_newState.Internal.VertexBindingDescriptions[0] = new VertexInputBindingDescription(0, _supportExtDynamic && (!Gd.IsMoltenVk || Gd.SupportsMTL31) ? null : 0, VertexInputRate.Vertex);
|
||||
|
||||
int validCount = 1;
|
||||
|
||||
|
@ -1407,7 +1407,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
|
||||
_newState.Internal.VertexBindingDescriptions[descriptorIndex] = new VertexInputBindingDescription(
|
||||
(uint)binding,
|
||||
(uint)vertexBuffer.Stride,
|
||||
_supportExtDynamic && (!Gd.IsMoltenVk || Gd.SupportsMTL31) ? null : (uint)vertexBuffer.Stride,
|
||||
inputRate);
|
||||
|
||||
int vbSize = vertexBuffer.Buffer.Size;
|
||||
|
|
|
@ -256,7 +256,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
}
|
||||
|
||||
int descriptorIndex = 1;
|
||||
pipeline.Internal.VertexBindingDescriptions[0] = new VertexInputBindingDescription(0, 0, VertexInputRate.Vertex);
|
||||
pipeline.Internal.VertexBindingDescriptions[0] = new VertexInputBindingDescription(0, extendedDynamicState && (!gd.IsMoltenVk || gd.SupportsMTL31) ? null : 0, VertexInputRate.Vertex);
|
||||
|
||||
for (int i = 0; i < vbCount; i++)
|
||||
{
|
||||
|
@ -276,7 +276,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
// TODO: Support divisor > 1
|
||||
pipeline.Internal.VertexBindingDescriptions[descriptorIndex++] = new VertexInputBindingDescription(
|
||||
(uint)i + 1,
|
||||
(uint)alignedStride,
|
||||
extendedDynamicState && (!gd.IsMoltenVk || gd.SupportsMTL31) ? null : (uint)alignedStride,
|
||||
inputRate);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -466,7 +466,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
|
||||
bool isMoltenVk = gd.IsMoltenVk;
|
||||
|
||||
if (isMoltenVk)
|
||||
if (isMoltenVk && !_supportsExtDynamicState)
|
||||
{
|
||||
UpdateVertexAttributeDescriptions(gd);
|
||||
}
|
||||
|
@ -480,7 +480,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
{
|
||||
SType = StructureType.PipelineVertexInputStateCreateInfo,
|
||||
VertexAttributeDescriptionCount = VertexAttributeDescriptionsCount,
|
||||
PVertexAttributeDescriptions = isMoltenVk ? pVertexAttributeDescriptions2 : pVertexAttributeDescriptions,
|
||||
PVertexAttributeDescriptions = isMoltenVk && !_supportsExtDynamicState ? pVertexAttributeDescriptions2 : pVertexAttributeDescriptions,
|
||||
VertexBindingDescriptionCount = VertexBindingDescriptionsCount,
|
||||
PVertexBindingDescriptions = pVertexBindingDescriptions,
|
||||
};
|
||||
|
|
|
@ -71,16 +71,22 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
|
||||
_buffer = autoBuffer;
|
||||
|
||||
if (!gd.Capabilities.SupportsExtendedDynamicState)
|
||||
{
|
||||
state.Internal.VertexBindingDescriptions[DescriptorIndex].Stride = (uint)stride;
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
autoBuffer = gd.BufferManager.GetBuffer(cbs.CommandBuffer, _handle, false, out int size);
|
||||
|
||||
if (!gd.Capabilities.SupportsExtendedDynamicState)
|
||||
{
|
||||
// The original stride must be reapplied in case it was rewritten.
|
||||
state.Internal.VertexBindingDescriptions[DescriptorIndex].Stride = (uint)_stride;
|
||||
}
|
||||
|
||||
if (_offset >= size)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue