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

Revert a change

This commit is contained in:
sunshineinabox 2024-09-02 14:37:29 -07:00
parent a7409e6fba
commit 91c3ac2701
4 changed files with 11 additions and 20 deletions

View file

@ -1080,8 +1080,6 @@ namespace Ryujinx.Graphics.Vulkan
_newState.HasTessellationControlShader = internalProgram.HasTessellationControlShader; _newState.HasTessellationControlShader = internalProgram.HasTessellationControlShader;
_newState.StagesCount = (uint)stages.Length; _newState.StagesCount = (uint)stages.Length;
_newState.Topology = internalProgram.ShaderTopology;
stages.CopyTo(_newState.Stages.AsSpan()[..stages.Length]); stages.CopyTo(_newState.Stages.AsSpan()[..stages.Length]);
SignalStateChange(); SignalStateChange();
@ -1702,7 +1700,7 @@ namespace Ryujinx.Graphics.Vulkan
{ {
DynamicState.SetFeedbackLoop(aspects); DynamicState.SetFeedbackLoop(aspects);
} }
else else if (Gd.Capabilities.SupportsAttachmentFeedbackLoop)
{ {
_newState.FeedbackLoopAspects = aspects; _newState.FeedbackLoopAspects = aspects;
} }
@ -1718,11 +1716,6 @@ namespace Ryujinx.Graphics.Vulkan
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
private bool UpdateFeedbackLoop() private bool UpdateFeedbackLoop()
{ {
if (!Gd.Capabilities.SupportsAttachmentFeedbackLoop)
{
return false;
}
List<TextureView> hazards = _descriptorSetUpdater.FeedbackLoopHazards; List<TextureView> hazards = _descriptorSetUpdater.FeedbackLoopHazards;
if ((hazards?.Count ?? 0) > 0) if ((hazards?.Count ?? 0) > 0)

View file

@ -153,13 +153,15 @@ namespace Ryujinx.Graphics.Vulkan
0); 0);
} }
public static PipelineState ToVulkanPipelineState(this ProgramPipelineState state, VulkanRenderer gd, bool hasTCS) public static PipelineState ToVulkanPipelineState(this ProgramPipelineState state, VulkanRenderer gd)
{ {
var extendedDynamicState2 = gd.Capabilities.SupportsExtendedDynamicState2; var extendedDynamicState2 = gd.Capabilities.SupportsExtendedDynamicState2;
var extendedDynamicState = gd.Capabilities.SupportsExtendedDynamicState; var extendedDynamicState = gd.Capabilities.SupportsExtendedDynamicState;
var topology = extendedDynamicState ? gd.TopologyRemap(state.Topology).Convert().ConvertToClass() : gd.TopologyRemap(state.Topology).Convert();
PipelineState pipeline = new(); PipelineState pipeline = new();
pipeline.Initialize(gd.Capabilities); pipeline.Initialize(gd.Capabilities, topology);
// It is assumed that Dynamic State is enabled when this conversion is used. // It is assumed that Dynamic State is enabled when this conversion is used.
pipeline.DepthBoundsTestEnable = false; // Not implemented. pipeline.DepthBoundsTestEnable = false; // Not implemented.
@ -225,8 +227,7 @@ namespace Ryujinx.Graphics.Vulkan
pipeline.StencilBackDepthFailOp = extendedDynamicState ? 0 : state.StencilTest.BackDpFail.Convert(); pipeline.StencilBackDepthFailOp = extendedDynamicState ? 0 : state.StencilTest.BackDpFail.Convert();
pipeline.StencilBackCompareOp = extendedDynamicState ? 0 : state.StencilTest.BackFunc.Convert(); pipeline.StencilBackCompareOp = extendedDynamicState ? 0 : state.StencilTest.BackFunc.Convert();
var topology = hasTCS ? PrimitiveTopology.Patches : state.Topology; pipeline.Topology = topology;
pipeline.Topology = extendedDynamicState ? gd.TopologyRemap(topology).Convert().ConvertToClass() : gd.TopologyRemap(topology).Convert();
int vaCount = Math.Min(Constants.MaxVertexAttributes, state.VertexAttribCount); int vaCount = Math.Min(Constants.MaxVertexAttributes, state.VertexAttribCount);
int vbCount = Math.Min(Constants.MaxVertexBuffers, state.VertexBufferCount); int vbCount = Math.Min(Constants.MaxVertexBuffers, state.VertexBufferCount);

View file

@ -258,7 +258,7 @@ namespace Ryujinx.Graphics.Vulkan
private bool _supportsFeedBackLoopDynamicState; private bool _supportsFeedBackLoopDynamicState;
public void Initialize(HardwareCapabilities capabilities) public void Initialize(HardwareCapabilities capabilities, PrimitiveTopology topology = default)
{ {
HasTessellationControlShader = false; HasTessellationControlShader = false;
Stages = new NativeArray<PipelineShaderStageCreateInfo>(Constants.MaxShaderStages); Stages = new NativeArray<PipelineShaderStageCreateInfo>(Constants.MaxShaderStages);
@ -277,13 +277,14 @@ namespace Ryujinx.Graphics.Vulkan
_supportsExtDynamicState2 = capabilities.SupportsExtendedDynamicState2; _supportsExtDynamicState2 = capabilities.SupportsExtendedDynamicState2;
_supportsFeedBackLoopDynamicState = capabilities.SupportsDynamicAttachmentFeedbackLoop; _supportsFeedBackLoopDynamicState = capabilities.SupportsDynamicAttachmentFeedbackLoop;
if (_supportsFeedBackLoopDynamicState || !capabilities.SupportsAttachmentFeedbackLoop) if (!capabilities.SupportsAttachmentFeedbackLoop)
{ {
FeedbackLoopAspects = FeedbackLoopAspects.None; FeedbackLoopAspects = FeedbackLoopAspects.None;
} }
if (_supportsExtDynamicState) if (_supportsExtDynamicState)
{ {
Topology = topology;
StencilFrontFailOp = 0; StencilFrontFailOp = 0;
StencilFrontPassOp = 0; StencilFrontPassOp = 0;
StencilFrontDepthFailOp = 0; StencilFrontDepthFailOp = 0;
@ -649,7 +650,7 @@ namespace Ryujinx.Graphics.Vulkan
PipelineCreateFlags flags = 0; PipelineCreateFlags flags = 0;
if (gd.Capabilities.SupportsAttachmentFeedbackLoop) if (gd.Capabilities.SupportsAttachmentFeedbackLoop && !_supportsFeedBackLoopDynamicState)
{ {
FeedbackLoopAspects aspects = FeedbackLoopAspects; FeedbackLoopAspects aspects = FeedbackLoopAspects;

View file

@ -24,8 +24,6 @@ namespace Ryujinx.Graphics.Vulkan
public bool IsCompute { get; } public bool IsCompute { get; }
public bool HasTessellationControlShader => (Stages & (1u << 3)) != 0; public bool HasTessellationControlShader => (Stages & (1u << 3)) != 0;
public PrimitiveTopology ShaderTopology;
public bool UpdateTexturesWithoutTemplate { get; } public bool UpdateTexturesWithoutTemplate { get; }
public uint Stages { get; } public uint Stages { get; }
@ -552,9 +550,7 @@ namespace Ryujinx.Graphics.Vulkan
// The active attachment formats have been provided by the abstraction layer. // The active attachment formats have been provided by the abstraction layer.
var renderPass = CreateDummyRenderPass(); var renderPass = CreateDummyRenderPass();
PipelineState pipeline = _state.ToVulkanPipelineState(_gd, HasTessellationControlShader); PipelineState pipeline = _state.ToVulkanPipelineState(_gd);
ShaderTopology = pipeline.Topology;
// Copy the shader stage info to the pipeline. // Copy the shader stage info to the pipeline.
var stages = pipeline.Stages.AsSpan(); var stages = pipeline.Stages.AsSpan();