1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-12-26 22:26:01 +00:00

Consolidate some checks

This commit is contained in:
sunshineinabox 2024-05-26 19:08:46 -07:00
parent 1adae7794a
commit 4b504243d8

View file

@ -396,6 +396,15 @@ namespace Ryujinx.Graphics.Vulkan
return pipeline; return pipeline;
} }
// Using patches topology without a tessellation shader is invalid.
// If we find such a case, return null pipeline to skip the draw.
if (Topology == PrimitiveTopology.PatchList && !HasTessellationControlShader)
{
program.AddGraphicsPipeline(ref Internal, null);
return null;
}
Pipeline pipelineHandle = default; Pipeline pipelineHandle = default;
bool isMoltenVk = gd.IsMoltenVk; bool isMoltenVk = gd.IsMoltenVk;
@ -417,20 +426,10 @@ namespace Ryujinx.Graphics.Vulkan
{ {
SType = StructureType.PipelineVertexInputStateCreateInfo, SType = StructureType.PipelineVertexInputStateCreateInfo,
VertexAttributeDescriptionCount = VertexAttributeDescriptionsCount, VertexAttributeDescriptionCount = VertexAttributeDescriptionsCount,
PVertexAttributeDescriptions = isMoltenVk ? pVertexAttributeDescriptions2 : pVertexAttributeDescriptions,
VertexBindingDescriptionCount = VertexBindingDescriptionsCount, VertexBindingDescriptionCount = VertexBindingDescriptionsCount,
PVertexBindingDescriptions = pVertexBindingDescriptions, PVertexBindingDescriptions = pVertexBindingDescriptions,
}; };
// Using patches topology without a tessellation shader is invalid.
// If we find such a case, return null pipeline to skip the draw.
if (Topology == PrimitiveTopology.PatchList && !HasTessellationControlShader)
{
program.AddGraphicsPipeline(ref Internal, null);
return null;
}
var inputAssemblyState = new PipelineInputAssemblyStateCreateInfo var inputAssemblyState = new PipelineInputAssemblyStateCreateInfo
{ {
SType = StructureType.PipelineInputAssemblyStateCreateInfo, SType = StructureType.PipelineInputAssemblyStateCreateInfo,
@ -456,6 +455,8 @@ namespace Ryujinx.Graphics.Vulkan
if (isMoltenVk) if (isMoltenVk)
{ {
vertexInputState.PVertexAttributeDescriptions = pVertexAttributeDescriptions2;
//When widelines feature is not supported it must be 1.0f per spec. //When widelines feature is not supported it must be 1.0f per spec.
rasterizationState.LineWidth = 1.0f; rasterizationState.LineWidth = 1.0f;
} }
@ -584,6 +585,8 @@ namespace Ryujinx.Graphics.Vulkan
if (!isMoltenVk) if (!isMoltenVk)
{ {
vertexInputState.PVertexAttributeDescriptions = pVertexAttributeDescriptions;
baseDynamicStatesCount++; baseDynamicStatesCount++;
} }