1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-12-25 20:06:00 +00:00

Bring up pipeline converter inline with dynamic states.

This commit is contained in:
sunshineinabox 2024-05-29 22:34:23 -07:00
parent 16a4374ae8
commit 985c648860

View file

@ -169,24 +169,41 @@ namespace Ryujinx.Graphics.Vulkan
pipeline.HasDepthStencil = state.DepthStencilEnable;
pipeline.LogicOpEnable = state.LogicOpEnable;
pipeline.LogicOp = state.LogicOp.Convert();
pipeline.MinDepthBounds = 0f; // Not implemented.
pipeline.MaxDepthBounds = 0f; // Not implemented.
pipeline.PatchControlPoints = state.PatchControlPoints;
pipeline.PolygonMode = PolygonMode.Fill; // Not implemented.
pipeline.PrimitiveRestartEnable = state.PrimitiveRestartEnable;
pipeline.RasterizerDiscardEnable = state.RasterizerDiscard;
pipeline.SamplesCount = (uint)state.SamplesCount;
pipeline.DepthBiasEnable = state.BiasEnable != 0;
if (!gd.Capabilities.SupportsExtendedDynamicState2)
{
pipeline.PrimitiveRestartEnable = state.PrimitiveRestartEnable;
pipeline.RasterizerDiscardEnable = state.RasterizerDiscard;
pipeline.DepthBiasEnable = state.BiasEnable != 0;
}
if (!gd.ExtendedDynamicState2Features.ExtendedDynamicState2LogicOp)
{
pipeline.LogicOp = state.LogicOp.Convert();
}
if (!gd.ExtendedDynamicState2Features.ExtendedDynamicState2PatchControlPoints)
{
pipeline.PatchControlPoints = state.PatchControlPoints;
}
pipeline.SamplesCount = (uint)state.SamplesCount;
// Stencil masks and ref are dynamic, so are 0 in the Vulkan pipeline.
if (!gd.Capabilities.SupportsExtendedDynamicState)
{
pipeline.DepthTestEnable = state.DepthTest.TestEnable;
pipeline.DepthWriteEnable = state.DepthTest.WriteEnable;
if (pipeline.DepthTestEnable)
{
pipeline.DepthWriteEnable = state.DepthTest.WriteEnable;
}
pipeline.DepthCompareOp = state.DepthTest.Func.Convert();
pipeline.CullMode = state.CullEnable ? state.CullMode.Convert() : CullModeFlags.None;