Apply suggestions from code review

Simple suggestions from code review

Co-authored-by: gdkchan <gab.dark.100@gmail.com>
This commit is contained in:
sunshineinabox 2024-09-09 18:11:35 -07:00 committed by GitHub
parent d9c5b5c753
commit 4a3b10fa9f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 9 additions and 14 deletions

View file

@ -94,7 +94,6 @@ namespace Ryujinx.Graphics.Vulkan
private FeedbackLoopAspects _feedbackLoop; private FeedbackLoopAspects _feedbackLoop;
private bool _passWritesDepthStencil; private bool _passWritesDepthStencil;
private readonly PipelineColorBlendAttachmentState[] _storedBlend; private readonly PipelineColorBlendAttachmentState[] _storedBlend;
public ulong DrawCount { get; private set; } public ulong DrawCount { get; private set; }
public bool RenderPassActive { get; private set; } public bool RenderPassActive { get; private set; }
@ -1250,7 +1249,6 @@ namespace Ryujinx.Graphics.Vulkan
(uint)stencilTest.FrontMask, (uint)stencilTest.FrontMask,
(uint)stencilTest.FrontFuncRef); (uint)stencilTest.FrontFuncRef);
UpdatePassDepthStencil(); UpdatePassDepthStencil();
SignalStateChange(); SignalStateChange();
} }

View file

@ -215,8 +215,8 @@ namespace Ryujinx.Graphics.Vulkan
{ {
pipeline.PrimitiveRestartEnable = state.PrimitiveRestartEnable; pipeline.PrimitiveRestartEnable = state.PrimitiveRestartEnable;
pipeline.RasterizerDiscardEnable = state.RasterizerDiscard; pipeline.RasterizerDiscardEnable = state.RasterizerDiscard;
pipeline.DepthBiasEnable = ((state.BiasEnable != 0) && pipeline.DepthBiasEnable = (state.BiasEnable != 0) &&
(state.DepthBiasFactor != 0 && state.DepthBiasUnits != 0)); (state.DepthBiasFactor != 0 && state.DepthBiasUnits != 0);
} }
if (!extendedDynamicState2.ExtendedDynamicState2LogicOp) if (!extendedDynamicState2.ExtendedDynamicState2LogicOp)

View file

@ -3,7 +3,6 @@ using Silk.NET.Vulkan;
using Silk.NET.Vulkan.Extensions.EXT; using Silk.NET.Vulkan.Extensions.EXT;
using System; using System;
namespace Ryujinx.Graphics.Vulkan namespace Ryujinx.Graphics.Vulkan
{ {
struct PipelineDynamicState struct PipelineDynamicState
@ -74,7 +73,7 @@ namespace Ryujinx.Graphics.Vulkan
FrontFace = 1 << 7, FrontFace = 1 << 7,
DepthTestBool = 1 << 8, DepthTestBool = 1 << 8,
DepthTestCompareOp = 1 << 9, DepthTestCompareOp = 1 << 9,
StencilTestEnableandStencilOp = 1 << 10, StencilTestEnableAndStencilOp = 1 << 10,
LineWidth = 1 << 11, LineWidth = 1 << 11,
RasterDiscard = 1 << 12, RasterDiscard = 1 << 12,
LogicOp = 1 << 13, LogicOp = 1 << 13,
@ -203,7 +202,6 @@ namespace Ryujinx.Graphics.Vulkan
public void SetLineWidth(float width) public void SetLineWidth(float width)
{ {
_lineWidth = width; _lineWidth = width;
_dirty |= DirtyFlags.LineWidth; _dirty |= DirtyFlags.LineWidth;
} }
@ -412,7 +410,7 @@ namespace Ryujinx.Graphics.Vulkan
gd.Api.CmdSetStencilReference(commandBuffer, StencilFaceFlags.FaceFrontBit, _frontReference); gd.Api.CmdSetStencilReference(commandBuffer, StencilFaceFlags.FaceFrontBit, _frontReference);
} }
private readonly void RecordStencilTestandOp(ExtExtendedDynamicState api, CommandBuffer commandBuffer) private readonly void RecordStencilTestAndOp(ExtExtendedDynamicState api, CommandBuffer commandBuffer)
{ {
api.CmdSetStencilTestEnable(commandBuffer, StencilTestEnable); api.CmdSetStencilTestEnable(commandBuffer, StencilTestEnable);
@ -431,7 +429,6 @@ namespace Ryujinx.Graphics.Vulkan
if (gd.Capabilities.SupportsExtendedDynamicState) if (gd.Capabilities.SupportsExtendedDynamicState)
{ {
gd.ExtendedDynamicStateApi.CmdSetViewportWithCount(commandBuffer, ViewportsCount, gd.ExtendedDynamicStateApi.CmdSetViewportWithCount(commandBuffer, ViewportsCount,
Viewports.AsSpan()); Viewports.AsSpan());
} }
@ -491,7 +488,7 @@ namespace Ryujinx.Graphics.Vulkan
primitiveRestartEnable &= topologySupportsRestart; primitiveRestartEnable &= topologySupportsRestart;
//Cannot disable primitiveRestartEnable for these Topologies on MacOS // Cannot disable primitiveRestartEnable for these Topologies on MacOS.
if (gd.IsMoltenVk) if (gd.IsMoltenVk)
{ {
primitiveRestartEnable = true; primitiveRestartEnable = true;

View file

@ -503,7 +503,7 @@ namespace Ryujinx.Graphics.Vulkan
if (isMoltenVk) if (isMoltenVk)
{ {
//When widelines feature is not supported it must be 1.0f. // When widelines feature is not supported it must be 1.0f.
rasterizationState.LineWidth = 1.0f; rasterizationState.LineWidth = 1.0f;
} }
@ -634,8 +634,8 @@ namespace Ryujinx.Graphics.Vulkan
{ {
if (gd.SupportsMTL31 || !gd.IsMoltenVk) if (gd.SupportsMTL31 || !gd.IsMoltenVk)
{ {
//Requires Metal 3.1 and new MoltenVK however extended dynamic states extension is not // Requires Metal 3.1 and new MoltenVK, however extended dynamic states extension is not
//available on older verrsion of MVK so we can safely check only OS version // available on older versions of MVK, so we can safely check only OS version.
dynamicStates[dynamicStatesCount++] = DynamicState.VertexInputBindingStrideExt; dynamicStates[dynamicStatesCount++] = DynamicState.VertexInputBindingStrideExt;
} }
dynamicStates[0] = DynamicState.ViewportWithCountExt; dynamicStates[0] = DynamicState.ViewportWithCountExt;

View file

@ -422,7 +422,7 @@ namespace Ryujinx.Graphics.Vulkan
properties.Limits.FramebufferDepthSampleCounts & properties.Limits.FramebufferDepthSampleCounts &
properties.Limits.FramebufferStencilSampleCounts; properties.Limits.FramebufferStencilSampleCounts;
//Temporarily disable this can be added back at a later date, make it easy to re-enable. // Temporarily disable this, can be added back at a later date, make it easy to re-enable.
featuresExtendedDynamicState2.ExtendedDynamicState2PatchControlPoints = false; featuresExtendedDynamicState2.ExtendedDynamicState2PatchControlPoints = false;
Capabilities = new HardwareCapabilities( Capabilities = new HardwareCapabilities(