Revert Silk.NET to main branch version.
Remove VK_EXT_extended_dynamic_state3 functionality until later PR
This commit is contained in:
parent
fb4ef3347a
commit
f43413f374
7 changed files with 46 additions and 386 deletions
|
@ -39,9 +39,9 @@
|
|||
<PackageVersion Include="securifybv.ShellLink" Version="0.1.0" />
|
||||
<PackageVersion Include="shaderc.net" Version="0.1.0" />
|
||||
<PackageVersion Include="SharpZipLib" Version="1.4.2" />
|
||||
<PackageVersion Include="Silk.NET.Vulkan" Version="2.21.0" />
|
||||
<PackageVersion Include="Silk.NET.Vulkan.Extensions.EXT" Version="2.21.0" />
|
||||
<PackageVersion Include="Silk.NET.Vulkan.Extensions.KHR" Version="2.21.0" />
|
||||
<PackageVersion Include="Silk.NET.Vulkan" Version="2.16.0" />
|
||||
<PackageVersion Include="Silk.NET.Vulkan.Extensions.EXT" Version="2.16.0" />
|
||||
<PackageVersion Include="Silk.NET.Vulkan.Extensions.KHR" Version="2.16.0" />
|
||||
<PackageVersion Include="SixLabors.ImageSharp" Version="2.1.8" />
|
||||
<PackageVersion Include="SixLabors.ImageSharp.Drawing" Version="1.0.0" />
|
||||
<PackageVersion Include="SPB" Version="0.0.4-build32" />
|
||||
|
@ -49,4 +49,4 @@
|
|||
<PackageVersion Include="System.Management" Version="8.0.0" />
|
||||
<PackageVersion Include="UnicornEngine.Unicorn" Version="2.0.2-rc1-fb78016" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
|
|
@ -32,7 +32,6 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
public readonly bool SupportsConditionalRendering;
|
||||
public readonly bool SupportsExtendedDynamicState;
|
||||
public readonly bool SupportsExtendedDynamicState2;
|
||||
public readonly bool SupportsExtendedDynamicState3;
|
||||
public readonly bool SupportsMultiView;
|
||||
public readonly bool SupportsNullDescriptors;
|
||||
public readonly bool SupportsPushDescriptors;
|
||||
|
@ -73,7 +72,6 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
bool supportsConditionalRendering,
|
||||
bool supportsExtendedDynamicState,
|
||||
bool supportsExtendedDynamicState2,
|
||||
bool supportsExtendedDynamicState3,
|
||||
bool supportsMultiView,
|
||||
bool supportsNullDescriptors,
|
||||
bool supportsPushDescriptors,
|
||||
|
@ -113,7 +111,6 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
SupportsConditionalRendering = supportsConditionalRendering;
|
||||
SupportsExtendedDynamicState = supportsExtendedDynamicState;
|
||||
SupportsExtendedDynamicState2 = supportsExtendedDynamicState2;
|
||||
SupportsExtendedDynamicState3 = supportsExtendedDynamicState3;
|
||||
SupportsMultiView = supportsMultiView;
|
||||
SupportsNullDescriptors = supportsNullDescriptors;
|
||||
SupportsPushDescriptors = supportsPushDescriptors;
|
||||
|
|
|
@ -129,7 +129,6 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
|
||||
_supportExtDynamic2 = gd.Capabilities.SupportsExtendedDynamicState2;
|
||||
|
||||
|
||||
_newState.Initialize();
|
||||
}
|
||||
|
||||
|
@ -697,7 +696,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
var oldStencilTestEnable = _supportExtDynamic ? DynamicState.StencilTestEnable : _newState.StencilTestEnable;
|
||||
var oldDepthTestEnable = _supportExtDynamic ? DynamicState.DepthTestEnable : _newState.DepthTestEnable;
|
||||
var oldDepthWriteEnable = _supportExtDynamic ? DynamicState.DepthWriteEnable : _newState.DepthWriteEnable;
|
||||
var oldTopology = Gd.SupportsUnrestrictedDynamicTopology ? DynamicState.Topology : _newState.Topology;
|
||||
var oldTopology = _newState.Topology;
|
||||
var oldViewports = DynamicState.Viewports;
|
||||
var oldViewportsCount = _supportExtDynamic ? DynamicState.ViewportsCount : _newState.ViewportsCount;
|
||||
|
||||
|
@ -740,14 +739,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
_newState.ViewportsCount = oldViewportsCount;
|
||||
}
|
||||
|
||||
if (Gd.SupportsUnrestrictedDynamicTopology)
|
||||
{
|
||||
DynamicState.SetPrimitiveTopology(oldTopology);
|
||||
}
|
||||
else
|
||||
{
|
||||
_newState.Topology = oldTopology;
|
||||
}
|
||||
_newState.Topology = oldTopology;
|
||||
|
||||
DynamicState.SetViewports(ref oldViewports, oldViewportsCount);
|
||||
|
||||
|
@ -891,14 +883,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
|
||||
public void SetDepthClamp(bool clamp)
|
||||
{
|
||||
if (Gd.ExtendedDynamicState3Features.ExtendedDynamicState3DepthClampEnable)
|
||||
{
|
||||
DynamicState.SetDepthClampEnable(clamp);
|
||||
}
|
||||
else
|
||||
{
|
||||
_newState.DepthClampEnable = clamp;
|
||||
}
|
||||
_newState.DepthClampEnable = clamp;
|
||||
|
||||
SignalStateChange();
|
||||
}
|
||||
|
@ -906,19 +891,11 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
public void SetDepthMode(DepthMode mode)
|
||||
{
|
||||
bool oldMode;
|
||||
bool supportsDepthClipandDynamicState = Gd.ExtendedDynamicState3Features.ExtendedDynamicState3DepthClipNegativeOneToOne;
|
||||
if (supportsDepthClipandDynamicState)
|
||||
{
|
||||
oldMode = DynamicState.DepthMode;
|
||||
DynamicState.SetDepthMode(mode == DepthMode.MinusOneToOne);
|
||||
}
|
||||
else
|
||||
{
|
||||
oldMode = _newState.DepthMode;
|
||||
_newState.DepthMode = mode == DepthMode.MinusOneToOne;
|
||||
}
|
||||
|
||||
if ((supportsDepthClipandDynamicState ? DynamicState.DepthMode : _newState.DepthMode) != oldMode)
|
||||
oldMode = _newState.DepthMode;
|
||||
_newState.DepthMode = mode == DepthMode.MinusOneToOne;
|
||||
|
||||
if (_newState.DepthMode != oldMode)
|
||||
{
|
||||
SignalStateChange();
|
||||
}
|
||||
|
@ -1028,38 +1005,16 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
// so we need to force disable them here.
|
||||
bool logicOpEnable = enable && (Gd.Vendor == Vendor.Nvidia || _newState.Internal.LogicOpsAllowed);
|
||||
|
||||
if (Gd.ExtendedDynamicState3Features.ExtendedDynamicState3LogicOpEnable)
|
||||
{
|
||||
DynamicState.SetLogicOpEnable(logicOpEnable);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
_newState.LogicOpEnable = logicOpEnable;
|
||||
}
|
||||
_newState.LogicOpEnable = logicOpEnable;
|
||||
|
||||
SignalStateChange();
|
||||
}
|
||||
|
||||
public void SetMultisampleState(MultisampleDescriptor multisample)
|
||||
{
|
||||
if (Gd.ExtendedDynamicState3Features.ExtendedDynamicState3AlphaToCoverageEnable)
|
||||
{
|
||||
DynamicState.SetAlphaToCoverEnable(multisample.AlphaToCoverageEnable);
|
||||
}
|
||||
else
|
||||
{
|
||||
_newState.AlphaToCoverageEnable = multisample.AlphaToCoverageEnable;
|
||||
}
|
||||
_newState.AlphaToCoverageEnable = multisample.AlphaToCoverageEnable;
|
||||
|
||||
if (Gd.ExtendedDynamicState3Features.ExtendedDynamicState3AlphaToOneEnable)
|
||||
{
|
||||
DynamicState.SetAlphaToOneEnable(multisample.AlphaToOneEnable);
|
||||
}
|
||||
else
|
||||
{
|
||||
_newState.AlphaToOneEnable = multisample.AlphaToOneEnable;
|
||||
}
|
||||
_newState.AlphaToOneEnable = multisample.AlphaToOneEnable;
|
||||
|
||||
SignalStateChange();
|
||||
}
|
||||
|
@ -1139,14 +1094,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
|
||||
var vkTopology = Gd.TopologyRemap(topology).Convert();
|
||||
|
||||
if (Gd.SupportsUnrestrictedDynamicTopology)
|
||||
{
|
||||
DynamicState.SetPrimitiveTopology(vkTopology);
|
||||
}
|
||||
else
|
||||
{
|
||||
_newState.Topology = vkTopology;
|
||||
}
|
||||
_newState.Topology = vkTopology;
|
||||
|
||||
SignalStateChange();
|
||||
}
|
||||
|
|
|
@ -23,14 +23,14 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
private uint _frontReference;
|
||||
|
||||
private bool _opToo;
|
||||
private StencilOp _backfailop;
|
||||
private StencilOp _backpassop;
|
||||
private StencilOp _backdepthfailop;
|
||||
private CompareOp _backcompareop;
|
||||
private StencilOp _frontfailop;
|
||||
private StencilOp _frontpassop;
|
||||
private StencilOp _frontdepthfailop;
|
||||
private CompareOp _frontcompareop;
|
||||
private StencilOp _backFailOp;
|
||||
private StencilOp _backPassOp;
|
||||
private StencilOp _backDepthFailOp;
|
||||
private CompareOp _backCompareOp;
|
||||
private StencilOp _frontFailOp;
|
||||
private StencilOp _frontPassOp;
|
||||
private StencilOp _frontDepthFailOp;
|
||||
private CompareOp _frontCompareOp;
|
||||
|
||||
private float _lineWidth;
|
||||
|
||||
|
@ -54,19 +54,8 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
|
||||
private uint _patchControlPoints;
|
||||
|
||||
private bool _logicOpEnable;
|
||||
|
||||
private bool _depthClampEnable;
|
||||
|
||||
private bool _alphaToCoverEnable;
|
||||
private bool _alphaToOneEnable;
|
||||
|
||||
public bool DepthMode;
|
||||
|
||||
private bool _primitiveRestartEnable;
|
||||
|
||||
public PrimitiveTopology Topology;
|
||||
|
||||
[Flags]
|
||||
private enum DirtyFlags
|
||||
{
|
||||
|
@ -84,18 +73,11 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
LineWidth = 1 << 10,
|
||||
RasterDiscard = 1 << 11,
|
||||
LogicOp = 1 << 12,
|
||||
DepthClampEnable = 1 << 13,
|
||||
LogicOpEnable = 1 << 14,
|
||||
AlphaToCover = 1 << 15,
|
||||
AlphaToOne = 1 << 16,
|
||||
PatchControlPoints = 1 << 17,
|
||||
DepthMode = 1 << 18,
|
||||
PrimitiveRestart = 1 << 19,
|
||||
PrimitiveTopology = 1 << 20,
|
||||
PatchControlPoints = 1 << 13,
|
||||
PrimitiveRestart = 1 << 14,
|
||||
Standard = Blend | DepthBias | Scissor | Stencil | Viewport | LineWidth,
|
||||
Extended = CullMode | FrontFace | DepthTestBool | DepthTestCompareOp | StencilTestEnable,
|
||||
Extended2 = RasterDiscard | LogicOp | PatchControlPoints | PrimitiveRestart,
|
||||
Extended3 = DepthClampEnable | LogicOpEnable | AlphaToCover | AlphaToOne | DepthMode | PrimitiveTopology,
|
||||
}
|
||||
|
||||
private DirtyFlags _dirty;
|
||||
|
@ -142,14 +124,14 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
CompareOp backCompareOp, StencilOp frontFailOp, StencilOp frontPassOp, StencilOp frontDepthFailOp,
|
||||
CompareOp frontCompareOp)
|
||||
{
|
||||
_backfailop = backFailOp;
|
||||
_backpassop = backPassOp;
|
||||
_backdepthfailop = backDepthFailOp;
|
||||
_backcompareop = backCompareOp;
|
||||
_frontfailop = frontFailOp;
|
||||
_frontpassop = frontPassOp;
|
||||
_frontdepthfailop = frontDepthFailOp;
|
||||
_frontcompareop = frontCompareOp;
|
||||
_backFailOp = backFailOp;
|
||||
_backPassOp = backPassOp;
|
||||
_backDepthFailOp = backDepthFailOp;
|
||||
_backCompareOp = backCompareOp;
|
||||
_frontFailOp = frontFailOp;
|
||||
_frontPassOp = frontPassOp;
|
||||
_frontDepthFailOp = frontDepthFailOp;
|
||||
_frontCompareOp = frontCompareOp;
|
||||
_opToo = true;
|
||||
}
|
||||
|
||||
|
@ -221,12 +203,6 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
_dirty |= DirtyFlags.PrimitiveRestart;
|
||||
}
|
||||
|
||||
public void SetPrimitiveTopology(PrimitiveTopology topology)
|
||||
{
|
||||
Topology = topology;
|
||||
_dirty |= DirtyFlags.PrimitiveTopology;
|
||||
}
|
||||
|
||||
public void SetLogicOp(LogicOp op)
|
||||
{
|
||||
_logicOp = op;
|
||||
|
@ -239,36 +215,6 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
_dirty |= DirtyFlags.PatchControlPoints;
|
||||
}
|
||||
|
||||
public void SetLogicOpEnable(bool logicOpEnable)
|
||||
{
|
||||
_logicOpEnable = logicOpEnable;
|
||||
_dirty |= DirtyFlags.LogicOpEnable;
|
||||
}
|
||||
|
||||
public void SetDepthClampEnable(bool depthClampEnable)
|
||||
{
|
||||
_depthClampEnable = depthClampEnable;
|
||||
_dirty |= DirtyFlags.DepthClampEnable;
|
||||
}
|
||||
|
||||
public void SetAlphaToCoverEnable(bool alphaToCoverEnable)
|
||||
{
|
||||
_alphaToCoverEnable = alphaToCoverEnable;
|
||||
_dirty |= DirtyFlags.AlphaToCover;
|
||||
}
|
||||
|
||||
public void SetAlphaToOneEnable(bool alphaToOneEnable)
|
||||
{
|
||||
_alphaToOneEnable = alphaToOneEnable;
|
||||
_dirty |= DirtyFlags.AlphaToOne;
|
||||
}
|
||||
|
||||
public void SetDepthMode(bool mode)
|
||||
{
|
||||
DepthMode = mode;
|
||||
_dirty |= DirtyFlags.DepthMode;
|
||||
}
|
||||
|
||||
public void ForceAllDirty(VulkanRenderer gd)
|
||||
{
|
||||
_dirty = DirtyFlags.Standard;
|
||||
|
@ -283,11 +229,6 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
_dirty = DirtyFlags.Standard | DirtyFlags.Extended | DirtyFlags.Extended2;
|
||||
}
|
||||
|
||||
if (gd.Capabilities.SupportsExtendedDynamicState3)
|
||||
{
|
||||
_dirty = DirtyFlags.Standard | DirtyFlags.Extended | DirtyFlags.Extended2 | DirtyFlags.Extended3;
|
||||
}
|
||||
|
||||
if (gd.IsMoltenVk)
|
||||
{
|
||||
_dirty &= ~DirtyFlags.LineWidth;
|
||||
|
@ -302,36 +243,6 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
{
|
||||
_dirty &= ~DirtyFlags.PatchControlPoints;
|
||||
}
|
||||
|
||||
if (!gd.ExtendedDynamicState3Features.ExtendedDynamicState3AlphaToCoverageEnable)
|
||||
{
|
||||
_dirty &= ~DirtyFlags.AlphaToCover;
|
||||
}
|
||||
|
||||
if (!gd.ExtendedDynamicState3Features.ExtendedDynamicState3AlphaToOneEnable)
|
||||
{
|
||||
_dirty &= ~DirtyFlags.AlphaToOne;
|
||||
}
|
||||
|
||||
if (!gd.ExtendedDynamicState3Features.ExtendedDynamicState3DepthClampEnable)
|
||||
{
|
||||
_dirty &= ~DirtyFlags.DepthClampEnable;
|
||||
}
|
||||
|
||||
if (!gd.ExtendedDynamicState3Features.ExtendedDynamicState3LogicOpEnable)
|
||||
{
|
||||
_dirty &= ~DirtyFlags.LogicOpEnable;
|
||||
}
|
||||
|
||||
if (!gd.ExtendedDynamicState3Features.ExtendedDynamicState3DepthClipNegativeOneToOne)
|
||||
{
|
||||
_dirty &= ~DirtyFlags.DepthMode;
|
||||
}
|
||||
|
||||
if (!gd.SupportsUnrestrictedDynamicTopology)
|
||||
{
|
||||
_dirty &= ~DirtyFlags.PrimitiveTopology;
|
||||
}
|
||||
}
|
||||
|
||||
public void ReplayIfDirty(VulkanRenderer gd, CommandBuffer commandBuffer)
|
||||
|
@ -401,7 +312,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
RecordPrimitiveRestartEnable(gd, commandBuffer);
|
||||
}
|
||||
|
||||
if (_dirty.HasFlag(DirtyFlags.PrimitiveTopology))
|
||||
if (_dirty.HasFlag(DirtyFlags.PrimitiveRestart))
|
||||
{
|
||||
RecordPrimitiveRestartEnable(gd, commandBuffer);
|
||||
}
|
||||
|
@ -416,36 +327,6 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
RecordPatchControlPoints(gd, commandBuffer);
|
||||
}
|
||||
|
||||
if (_dirty.HasFlag(DirtyFlags.LogicOpEnable))
|
||||
{
|
||||
RecordLogicOpEnable(gd, commandBuffer);
|
||||
}
|
||||
|
||||
if (_dirty.HasFlag(DirtyFlags.DepthClampEnable))
|
||||
{
|
||||
RecordDepthClampEnable(gd, commandBuffer);
|
||||
}
|
||||
|
||||
if (_dirty.HasFlag(DirtyFlags.AlphaToCover))
|
||||
{
|
||||
RecordAlphaToCoverEnable(gd, commandBuffer);
|
||||
}
|
||||
|
||||
if (_dirty.HasFlag(DirtyFlags.AlphaToOne))
|
||||
{
|
||||
RecordAlphaToOneEnable(gd, commandBuffer);
|
||||
}
|
||||
|
||||
if (_dirty.HasFlag(DirtyFlags.DepthMode))
|
||||
{
|
||||
RecordDepthMode(gd, commandBuffer);
|
||||
}
|
||||
|
||||
if (_dirty.HasFlag(DirtyFlags.PrimitiveTopology))
|
||||
{
|
||||
RecordPrimitiveTopology(gd, commandBuffer);
|
||||
}
|
||||
|
||||
_dirty = DirtyFlags.None;
|
||||
}
|
||||
|
||||
|
@ -491,10 +372,10 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
{
|
||||
if (_opToo)
|
||||
{
|
||||
gd.ExtendedDynamicStateApi.CmdSetStencilOp(commandBuffer, StencilFaceFlags.FaceBackBit, _backfailop, _backpassop,
|
||||
_backdepthfailop, _backcompareop);
|
||||
gd.ExtendedDynamicStateApi.CmdSetStencilOp(commandBuffer, StencilFaceFlags.FaceFrontBit, _frontfailop, _frontpassop,
|
||||
_frontdepthfailop, _frontcompareop);
|
||||
gd.ExtendedDynamicStateApi.CmdSetStencilOp(commandBuffer, StencilFaceFlags.FaceBackBit, _backFailOp, _backPassOp,
|
||||
_backDepthFailOp, _backCompareOp);
|
||||
gd.ExtendedDynamicStateApi.CmdSetStencilOp(commandBuffer, StencilFaceFlags.FaceFrontBit, _frontFailOp, _frontPassOp,
|
||||
_frontDepthFailOp, _frontCompareOp);
|
||||
}
|
||||
|
||||
gd.Api.CmdSetStencilCompareMask(commandBuffer, StencilFaceFlags.FaceBackBit, _backCompareMask);
|
||||
|
@ -562,46 +443,16 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
gd.ExtendedDynamicState2Api.CmdSetPrimitiveRestartEnable(commandBuffer, _primitiveRestartEnable);
|
||||
}
|
||||
|
||||
private readonly void RecordPrimitiveTopology(VulkanRenderer gd, CommandBuffer commandBuffer)
|
||||
{
|
||||
gd.ExtendedDynamicStateApi.CmdSetPrimitiveTopology(commandBuffer, Topology);
|
||||
}
|
||||
|
||||
private readonly void RecordLogicOp(VulkanRenderer gd, CommandBuffer commandBuffer)
|
||||
{
|
||||
gd.ExtendedDynamicState2Api.CmdSetLogicOp(commandBuffer, _logicOp);
|
||||
}
|
||||
|
||||
private readonly void RecordLogicOpEnable(VulkanRenderer gd, CommandBuffer commandBuffer)
|
||||
{
|
||||
gd.ExtendedDynamicState3Api.CmdSetLogicOpEnable(commandBuffer, _logicOpEnable);
|
||||
}
|
||||
|
||||
private readonly void RecordDepthClampEnable(VulkanRenderer gd, CommandBuffer commandBuffer)
|
||||
{
|
||||
gd.ExtendedDynamicState3Api.CmdSetDepthClampEnable(commandBuffer, _depthClampEnable);
|
||||
}
|
||||
|
||||
private readonly void RecordAlphaToCoverEnable(VulkanRenderer gd, CommandBuffer commandBuffer)
|
||||
{
|
||||
gd.ExtendedDynamicState3Api.CmdSetAlphaToCoverageEnable(commandBuffer, _alphaToCoverEnable);
|
||||
}
|
||||
|
||||
private readonly void RecordAlphaToOneEnable(VulkanRenderer gd, CommandBuffer commandBuffer)
|
||||
{
|
||||
gd.ExtendedDynamicState3Api.CmdSetAlphaToOneEnable(commandBuffer, _alphaToOneEnable);
|
||||
}
|
||||
|
||||
private readonly void RecordPatchControlPoints(VulkanRenderer gd, CommandBuffer commandBuffer)
|
||||
{
|
||||
gd.ExtendedDynamicState2Api.CmdSetPatchControlPoints(commandBuffer, _patchControlPoints);
|
||||
}
|
||||
|
||||
private readonly void RecordDepthMode(VulkanRenderer gd, CommandBuffer commandBuffer)
|
||||
{
|
||||
gd.ExtendedDynamicState3Api.CmdSetDepthClipNegativeOneToOne(commandBuffer, DepthMode);
|
||||
}
|
||||
|
||||
private readonly void RecordLineWidth(Vk api, CommandBuffer commandBuffer)
|
||||
{
|
||||
if (!OperatingSystem.IsMacOS())
|
||||
|
|
|
@ -407,8 +407,6 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
|
||||
bool supportsExtDynamicState = gd.Capabilities.SupportsExtendedDynamicState;
|
||||
bool supportsExtDynamicState2 = gd.Capabilities.SupportsExtendedDynamicState2;
|
||||
bool supportsExtDynamicState3 = gd.Capabilities.SupportsExtendedDynamicState3;
|
||||
|
||||
|
||||
fixed (VertexInputAttributeDescription* pVertexAttributeDescriptions = &Internal.VertexAttributeDescriptions[0])
|
||||
fixed (VertexInputAttributeDescription* pVertexAttributeDescriptions2 = &_vertexAttributeDescriptions2[0])
|
||||
|
@ -436,13 +434,9 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
var inputAssemblyState = new PipelineInputAssemblyStateCreateInfo
|
||||
{
|
||||
SType = StructureType.PipelineInputAssemblyStateCreateInfo,
|
||||
Topology = Topology,
|
||||
};
|
||||
|
||||
if (!gd.SupportsUnrestrictedDynamicTopology)
|
||||
{
|
||||
inputAssemblyState.Topology = Topology;
|
||||
}
|
||||
|
||||
var tessellationState = new PipelineTessellationStateCreateInfo
|
||||
{
|
||||
SType = StructureType.PipelineTessellationStateCreateInfo,
|
||||
|
@ -457,13 +451,9 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
{
|
||||
SType = StructureType.PipelineRasterizationStateCreateInfo,
|
||||
PolygonMode = PolygonMode,
|
||||
DepthClampEnable = DepthClampEnable,
|
||||
};
|
||||
|
||||
if (!gd.ExtendedDynamicState3Features.ExtendedDynamicState3DepthClampEnable)
|
||||
{
|
||||
rasterizationState.DepthClampEnable = DepthClampEnable;
|
||||
}
|
||||
|
||||
if (isMoltenVk)
|
||||
{
|
||||
//When widelines feature is not supported it must be 1.0f per spec.
|
||||
|
@ -482,7 +472,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
SType = StructureType.PipelineViewportStateCreateInfo,
|
||||
};
|
||||
|
||||
if (gd.Capabilities.SupportsDepthClipControl && !gd.ExtendedDynamicState3Features.ExtendedDynamicState3DepthClipNegativeOneToOne)
|
||||
if (gd.Capabilities.SupportsDepthClipControl)
|
||||
{
|
||||
var viewportDepthClipControlState = new PipelineViewportDepthClipControlCreateInfoEXT
|
||||
{
|
||||
|
@ -499,18 +489,10 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
SampleShadingEnable = false,
|
||||
RasterizationSamples = TextureStorage.ConvertToSampleCountFlags(gd.Capabilities.SupportedSampleCounts, SamplesCount),
|
||||
MinSampleShading = 1,
|
||||
AlphaToCoverageEnable = AlphaToCoverageEnable,
|
||||
AlphaToOneEnable = AlphaToOneEnable,
|
||||
};
|
||||
|
||||
if (!gd.ExtendedDynamicState3Features.ExtendedDynamicState3AlphaToCoverageEnable)
|
||||
{
|
||||
multisampleState.AlphaToCoverageEnable = AlphaToCoverageEnable;
|
||||
}
|
||||
|
||||
if (!gd.ExtendedDynamicState3Features.ExtendedDynamicState3AlphaToOneEnable)
|
||||
{
|
||||
multisampleState.AlphaToOneEnable = AlphaToOneEnable;
|
||||
}
|
||||
|
||||
var depthStencilState = new PipelineDepthStencilStateCreateInfo
|
||||
{
|
||||
SType = StructureType.PipelineDepthStencilStateCreateInfo,
|
||||
|
@ -579,6 +561,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
SType = StructureType.PipelineColorBlendStateCreateInfo,
|
||||
AttachmentCount = ColorBlendAttachmentStateCount,
|
||||
PAttachments = pColorBlendAttachmentState,
|
||||
LogicOpEnable = LogicOpEnable,
|
||||
};
|
||||
|
||||
if (!gd.ExtendedDynamicState2Features.ExtendedDynamicState2LogicOp)
|
||||
|
@ -586,11 +569,6 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
colorBlendState.LogicOp = LogicOp;
|
||||
}
|
||||
|
||||
if (!gd.ExtendedDynamicState3Features.ExtendedDynamicState3LogicOpEnable)
|
||||
{
|
||||
colorBlendState.LogicOpEnable = LogicOpEnable;
|
||||
}
|
||||
|
||||
PipelineColorBlendAdvancedStateCreateInfoEXT colorBlendAdvancedState;
|
||||
|
||||
if (!AdvancedBlendSrcPreMultiplied ||
|
||||
|
@ -634,35 +612,6 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
}
|
||||
}
|
||||
|
||||
if (supportsExtDynamicState3)
|
||||
{
|
||||
if (gd.ExtendedDynamicState3Features.ExtendedDynamicState3DepthClampEnable)
|
||||
{
|
||||
additionalDynamicStatesCount++;
|
||||
}
|
||||
if (gd.ExtendedDynamicState3Features.ExtendedDynamicState3LogicOpEnable)
|
||||
{
|
||||
additionalDynamicStatesCount++;
|
||||
}
|
||||
if (gd.ExtendedDynamicState3Features.ExtendedDynamicState3AlphaToCoverageEnable)
|
||||
{
|
||||
additionalDynamicStatesCount++;
|
||||
}
|
||||
if (gd.ExtendedDynamicState3Features.ExtendedDynamicState3AlphaToOneEnable)
|
||||
{
|
||||
additionalDynamicStatesCount++;
|
||||
}
|
||||
if (gd.ExtendedDynamicState3Features.ExtendedDynamicState3DepthClipNegativeOneToOne)
|
||||
{
|
||||
additionalDynamicStatesCount++;
|
||||
}
|
||||
|
||||
if (gd.SupportsUnrestrictedDynamicTopology)
|
||||
{
|
||||
additionalDynamicStatesCount++;
|
||||
}
|
||||
}
|
||||
|
||||
int dynamicStatesCount = baseDynamicStatesCount + additionalDynamicStatesCount;
|
||||
DynamicState* dynamicStates = stackalloc DynamicState[dynamicStatesCount];
|
||||
|
||||
|
@ -716,35 +665,6 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
}
|
||||
}
|
||||
|
||||
if (supportsExtDynamicState3)
|
||||
{
|
||||
if (gd.ExtendedDynamicState3Features.ExtendedDynamicState3DepthClampEnable)
|
||||
{
|
||||
dynamicStates[currentIndex++] = DynamicState.DepthClampEnableExt;
|
||||
}
|
||||
if (gd.ExtendedDynamicState3Features.ExtendedDynamicState3LogicOpEnable)
|
||||
{
|
||||
dynamicStates[currentIndex++] = DynamicState.LogicOpEnableExt;
|
||||
}
|
||||
if (gd.ExtendedDynamicState3Features.ExtendedDynamicState3AlphaToCoverageEnable)
|
||||
{
|
||||
dynamicStates[currentIndex++] = DynamicState.AlphaToCoverageEnableExt;
|
||||
}
|
||||
if (gd.ExtendedDynamicState3Features.ExtendedDynamicState3AlphaToOneEnable)
|
||||
{
|
||||
dynamicStates[currentIndex++] = DynamicState.AlphaToOneEnableExt;
|
||||
}
|
||||
if (gd.ExtendedDynamicState3Features.ExtendedDynamicState3DepthClipNegativeOneToOne)
|
||||
{
|
||||
dynamicStates[currentIndex++] = DynamicState.DepthClipNegativeOneToOneExt;
|
||||
}
|
||||
|
||||
if (gd.SupportsUnrestrictedDynamicTopology)
|
||||
{
|
||||
dynamicStates[currentIndex++] = DynamicState.PrimitiveTopology;
|
||||
}
|
||||
}
|
||||
|
||||
var pipelineDynamicStateCreateInfo = new PipelineDynamicStateCreateInfo
|
||||
{
|
||||
SType = StructureType.PipelineDynamicStateCreateInfo,
|
||||
|
|
|
@ -24,7 +24,6 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
ExtConditionalRendering.ExtensionName,
|
||||
ExtExtendedDynamicState.ExtensionName,
|
||||
ExtExtendedDynamicState2.ExtensionName,
|
||||
ExtExtendedDynamicState3.ExtensionName,
|
||||
ExtTransformFeedback.ExtensionName,
|
||||
KhrDrawIndirectCount.ExtensionName,
|
||||
KhrPushDescriptor.ExtensionName,
|
||||
|
@ -264,7 +263,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
return InvalidIndex;
|
||||
}
|
||||
|
||||
internal static Device CreateDevice(Vk api, VulkanPhysicalDevice physicalDevice, uint queueFamilyIndex, uint queueCount, out PhysicalDeviceExtendedDynamicState2FeaturesEXT extendedDynamicState2Features, out PhysicalDeviceExtendedDynamicState3FeaturesEXT extendedDynamicState3Features)
|
||||
internal static Device CreateDevice(Vk api, VulkanPhysicalDevice physicalDevice, uint queueFamilyIndex, uint queueCount, out PhysicalDeviceExtendedDynamicState2FeaturesEXT extendedDynamicState2Features)
|
||||
{
|
||||
if (queueCount > QueuesCount)
|
||||
{
|
||||
|
@ -323,17 +322,6 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
features2.PNext = &supportedFeaturesExtExtendedDynamicState2;
|
||||
}
|
||||
|
||||
PhysicalDeviceExtendedDynamicState3FeaturesEXT supportedFeaturesExtExtendedDynamicState3 = new()
|
||||
{
|
||||
SType = StructureType.PhysicalDeviceExtendedDynamicState3FeaturesExt,
|
||||
PNext = features2.PNext,
|
||||
};
|
||||
|
||||
if (physicalDevice.IsDeviceExtensionPresent(ExtExtendedDynamicState3.ExtensionName))
|
||||
{
|
||||
features2.PNext = &supportedFeaturesExtExtendedDynamicState3;
|
||||
}
|
||||
|
||||
PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT supportedFeaturesPrimitiveTopologyListRestart = new()
|
||||
{
|
||||
SType = StructureType.PhysicalDevicePrimitiveTopologyListRestartFeaturesExt,
|
||||
|
@ -483,24 +471,6 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
extendedDynamicState2Features = supportedFeaturesExtExtendedDynamicState2;
|
||||
|
||||
|
||||
if (physicalDevice.IsDeviceExtensionPresent(ExtExtendedDynamicState3.ExtensionName))
|
||||
{
|
||||
var featuresExtendedDynamicState3 = new PhysicalDeviceExtendedDynamicState3FeaturesEXT()
|
||||
{
|
||||
SType = StructureType.PhysicalDeviceExtendedDynamicState3FeaturesExt,
|
||||
PNext = pExtendedFeatures,
|
||||
ExtendedDynamicState3LogicOpEnable = supportedFeaturesExtExtendedDynamicState3.ExtendedDynamicState3LogicOpEnable,
|
||||
ExtendedDynamicState3AlphaToCoverageEnable = supportedFeaturesExtExtendedDynamicState3.ExtendedDynamicState3AlphaToCoverageEnable,
|
||||
ExtendedDynamicState3AlphaToOneEnable = supportedFeaturesExtExtendedDynamicState3.ExtendedDynamicState3AlphaToOneEnable,
|
||||
ExtendedDynamicState3DepthClampEnable = supportedFeaturesExtExtendedDynamicState3.ExtendedDynamicState3DepthClampEnable,
|
||||
ExtendedDynamicState3DepthClipNegativeOneToOne = supportedFeaturesExtExtendedDynamicState3.ExtendedDynamicState3DepthClipNegativeOneToOne,
|
||||
};
|
||||
|
||||
pExtendedFeatures = &featuresExtendedDynamicState3;
|
||||
}
|
||||
|
||||
extendedDynamicState3Features = supportedFeaturesExtExtendedDynamicState3;
|
||||
|
||||
var featuresVk11 = new PhysicalDeviceVulkan11Features
|
||||
{
|
||||
SType = StructureType.PhysicalDeviceVulkan11Features,
|
||||
|
|
|
@ -36,8 +36,6 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
internal ExtConditionalRendering ConditionalRenderingApi { get; private set; }
|
||||
internal ExtExtendedDynamicState ExtendedDynamicStateApi { get; private set; }
|
||||
internal ExtExtendedDynamicState2 ExtendedDynamicState2Api { get; private set; }
|
||||
internal ExtExtendedDynamicState3 ExtendedDynamicState3Api { get; private set; }
|
||||
|
||||
internal KhrPushDescriptor PushDescriptorApi { get; private set; }
|
||||
internal ExtTransformFeedback TransformFeedbackApi { get; private set; }
|
||||
internal KhrDrawIndirectCount DrawIndirectCountApi { get; private set; }
|
||||
|
@ -102,10 +100,6 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
|
||||
public PhysicalDeviceExtendedDynamicState2FeaturesEXT ExtendedDynamicState2Features;
|
||||
|
||||
public PhysicalDeviceExtendedDynamicState3FeaturesEXT ExtendedDynamicState3Features;
|
||||
|
||||
public bool SupportsUnrestrictedDynamicTopology;
|
||||
|
||||
|
||||
public event EventHandler<ScreenCaptureImageInfo> ScreenCaptured;
|
||||
|
||||
|
@ -147,11 +141,6 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
ExtendedDynamicState2Api = extendedDynamicState2Api;
|
||||
}
|
||||
|
||||
if (Api.TryGetDeviceExtension(_instance.Instance, _device, out ExtExtendedDynamicState3 extendedDynamicState3Api))
|
||||
{
|
||||
ExtendedDynamicState3Api = extendedDynamicState3Api;
|
||||
}
|
||||
|
||||
if (Api.TryGetDeviceExtension(_instance.Instance, _device, out KhrPushDescriptor pushDescriptorApi))
|
||||
{
|
||||
PushDescriptorApi = pushDescriptorApi;
|
||||
|
@ -213,17 +202,6 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
properties2.PNext = &propertiesTransformFeedback;
|
||||
}
|
||||
|
||||
PhysicalDeviceExtendedDynamicState3PropertiesEXT propertiesExtendedDynamicState3 = new()
|
||||
{
|
||||
SType = StructureType.PhysicalDeviceExtendedDynamicState3PropertiesExt,
|
||||
};
|
||||
|
||||
if (_physicalDevice.IsDeviceExtensionPresent(ExtExtendedDynamicState3.ExtensionName))
|
||||
{
|
||||
propertiesExtendedDynamicState3.PNext = properties2.PNext;
|
||||
properties2.PNext = &propertiesExtendedDynamicState3;
|
||||
}
|
||||
|
||||
PhysicalDevicePortabilitySubsetPropertiesKHR propertiesPortabilitySubset = new()
|
||||
{
|
||||
SType = StructureType.PhysicalDevicePortabilitySubsetPropertiesKhr,
|
||||
|
@ -414,7 +392,6 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
_physicalDevice.IsDeviceExtensionPresent(ExtConditionalRendering.ExtensionName),
|
||||
_physicalDevice.IsDeviceExtensionPresent(ExtExtendedDynamicState.ExtensionName),
|
||||
_physicalDevice.IsDeviceExtensionPresent(ExtExtendedDynamicState2.ExtensionName),
|
||||
_physicalDevice.IsDeviceExtensionPresent(ExtExtendedDynamicState3.ExtensionName),
|
||||
features2.Features.MultiViewport && !(IsMoltenVk && Vendor == Vendor.Amd), // Workaround for AMD on MoltenVK issue
|
||||
featuresRobustness2.NullDescriptor || IsMoltenVk,
|
||||
supportsPushDescriptors && !IsMoltenVk,
|
||||
|
@ -438,8 +415,6 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
properties.Limits.SubTexelPrecisionBits,
|
||||
minResourceAlignment);
|
||||
|
||||
SupportsUnrestrictedDynamicTopology = propertiesExtendedDynamicState3.DynamicPrimitiveTopologyUnrestricted;
|
||||
|
||||
IsSharedMemory = MemoryAllocator.IsDeviceMemoryShared(_physicalDevice);
|
||||
|
||||
MemoryAllocator = new MemoryAllocator(Api, _physicalDevice, _device);
|
||||
|
@ -481,10 +456,9 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
|
||||
var queueFamilyIndex = VulkanInitialization.FindSuitableQueueFamily(Api, _physicalDevice, _surface, out uint maxQueueCount);
|
||||
|
||||
_device = VulkanInitialization.CreateDevice(Api, _physicalDevice, queueFamilyIndex, maxQueueCount, out PhysicalDeviceExtendedDynamicState2FeaturesEXT extendedDynamicState2Features, out PhysicalDeviceExtendedDynamicState3FeaturesEXT extendedDynamicState3Features);
|
||||
_device = VulkanInitialization.CreateDevice(Api, _physicalDevice, queueFamilyIndex, maxQueueCount, out PhysicalDeviceExtendedDynamicState2FeaturesEXT extendedDynamicState2Features);
|
||||
|
||||
ExtendedDynamicState2Features = extendedDynamicState2Features;
|
||||
ExtendedDynamicState3Features = extendedDynamicState3Features;
|
||||
|
||||
if (Api.TryGetDeviceExtension(_instance.Instance, _device, out KhrSwapchain swapchainApi))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue