Resolve issue with primitive toplogy
Primitive Restart Enable should depend on Extended dynamic state 2 extension not 1 Resolve Primitive restart enable Fix MoltenVK crash
This commit is contained in:
parent
3b398adbe6
commit
c53f58a4a9
3 changed files with 27 additions and 33 deletions
|
@ -239,12 +239,6 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
set => Internal.Id3 = (Internal.Id3 & 0xFFFFFFFFFFFFFFBF) | ((value ? 1UL : 0UL) << 6);
|
||||
}
|
||||
|
||||
public PrimitiveTopology TopologyClass
|
||||
{
|
||||
readonly get => (PrimitiveTopology)((Internal.Id3 >> 7) & 0xF);
|
||||
set => Internal.Id3 = (Internal.Id3 & 0xFFFFFFFFFFFFFF8F) | ((ulong)value << 7);
|
||||
}
|
||||
|
||||
public bool HasTessellationControlShader;
|
||||
public NativeArray<PipelineShaderStageCreateInfo> Stages;
|
||||
public PipelineLayout PipelineLayout;
|
||||
|
@ -366,17 +360,11 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
var inputAssemblyState = new PipelineInputAssemblyStateCreateInfo
|
||||
{
|
||||
SType = StructureType.PipelineInputAssemblyStateCreateInfo,
|
||||
Topology = supportsExtDynamicState ? TopologyClass : Topology,
|
||||
Topology = Topology,
|
||||
};
|
||||
|
||||
PipelineTessellationStateCreateInfo tessellationState;
|
||||
|
||||
if (!gd.Capabilities.SupportsExtendedDynamicState2.ExtendedDynamicState2PatchControlPoints && HasTessellationControlShader)
|
||||
{
|
||||
tessellationState.SType = StructureType.PipelineTessellationStateCreateInfo;
|
||||
tessellationState.PatchControlPoints = PatchControlPoints;
|
||||
}
|
||||
|
||||
var rasterizationState = new PipelineRasterizationStateCreateInfo
|
||||
{
|
||||
SType = StructureType.PipelineRasterizationStateCreateInfo,
|
||||
|
@ -390,12 +378,6 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
rasterizationState.LineWidth = 1.0f;
|
||||
}
|
||||
|
||||
if (!supportsExtDynamicState2)
|
||||
{
|
||||
rasterizationState.DepthBiasEnable = DepthBiasEnable;
|
||||
rasterizationState.RasterizerDiscardEnable = RasterizerDiscardEnable;
|
||||
}
|
||||
|
||||
var viewportState = new PipelineViewportStateCreateInfo
|
||||
{
|
||||
SType = StructureType.PipelineViewportStateCreateInfo,
|
||||
|
@ -430,8 +412,6 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
|
||||
if (!supportsExtDynamicState)
|
||||
{
|
||||
inputAssemblyState.PrimitiveRestartEnable = PrimitiveRestartEnable;
|
||||
|
||||
rasterizationState.CullMode = CullMode;
|
||||
rasterizationState.FrontFace = FrontFace;
|
||||
|
||||
|
@ -458,6 +438,19 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
depthStencilState.DepthCompareOp = DepthCompareOp;
|
||||
}
|
||||
|
||||
if (!supportsExtDynamicState2)
|
||||
{
|
||||
inputAssemblyState.PrimitiveRestartEnable = PrimitiveRestartEnable;
|
||||
rasterizationState.DepthBiasEnable = DepthBiasEnable;
|
||||
rasterizationState.RasterizerDiscardEnable = RasterizerDiscardEnable;
|
||||
}
|
||||
|
||||
if (!gd.Capabilities.SupportsExtendedDynamicState2.ExtendedDynamicState2PatchControlPoints && HasTessellationControlShader)
|
||||
{
|
||||
tessellationState.SType = StructureType.PipelineTessellationStateCreateInfo;
|
||||
tessellationState.PatchControlPoints = PatchControlPoints;
|
||||
}
|
||||
|
||||
uint blendEnables = 0;
|
||||
|
||||
if (isMoltenVk && Internal.AttachmentIntegerFormatMask != 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue