Vulkan: Skip draws when patches topology is used without a tessellation shader (#6508)
This commit is contained in:
parent
66b1d59c66
commit
791bf22109
3 changed files with 14 additions and 0 deletions
|
@ -311,6 +311,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
set => Internal.Id9 = (Internal.Id9 & 0xFFFFFFFFFFFFFFBF) | ((value ? 1UL : 0UL) << 6);
|
||||
}
|
||||
|
||||
public bool HasTessellationControlShader;
|
||||
public NativeArray<PipelineShaderStageCreateInfo> Stages;
|
||||
public PipelineLayout PipelineLayout;
|
||||
public SpecData SpecializationData;
|
||||
|
@ -319,6 +320,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
|
||||
public void Initialize()
|
||||
{
|
||||
HasTessellationControlShader = false;
|
||||
Stages = new NativeArray<PipelineShaderStageCreateInfo>(Constants.MaxShaderStages);
|
||||
|
||||
AdvancedBlendSrcPreMultiplied = true;
|
||||
|
@ -419,6 +421,15 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
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;
|
||||
}
|
||||
|
||||
bool primitiveRestartEnable = PrimitiveRestartEnable;
|
||||
|
||||
bool topologySupportsRestart;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue