mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-12-27 02:53:04 +00:00
Apply suggestions from code review
Simple suggestions from code review Co-authored-by: gdkchan <gab.dark.100@gmail.com>
This commit is contained in:
parent
d9c5b5c753
commit
4a3b10fa9f
5 changed files with 9 additions and 14 deletions
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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(
|
||||||
|
|
Loading…
Reference in a new issue