Code review suggestions

This commit is contained in:
sunshineinabox 2024-09-13 08:13:44 -07:00
parent dff81088e8
commit 2d0c1c3a1c
4 changed files with 8 additions and 21 deletions

View file

@ -335,8 +335,6 @@ namespace Ryujinx.Graphics.OpenGL
return CullFaceMode.Front;
case Face.FrontAndBack:
return CullFaceMode.FrontAndBack;
case Face.None:
return (CullFaceMode)All.None;
}
Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(Face)} enum value: {face}.");

View file

@ -393,14 +393,11 @@ namespace Ryujinx.Graphics.Vulkan
{
if (gd.Capabilities.SupportsExtendedDynamicState)
{
gd.ExtendedDynamicStateApi.CmdSetScissorWithCount(commandBuffer, (uint)ScissorsCount,
_scissors.AsSpan());
gd.ExtendedDynamicStateApi.CmdSetScissorWithCount(commandBuffer, (uint)ScissorsCount, _scissors.AsSpan());
}
else
{
gd.Api.CmdSetScissor(commandBuffer, 0, (uint)ScissorsCount,
_scissors.AsSpan());
gd.Api.CmdSetScissor(commandBuffer, 0, (uint)ScissorsCount, _scissors.AsSpan());
}
}
}
@ -419,10 +416,8 @@ namespace Ryujinx.Graphics.Vulkan
{
api.CmdSetStencilTestEnable(commandBuffer, StencilTestEnable);
api.CmdSetStencilOp(commandBuffer, StencilFaceFlags.FaceBackBit, _backFailOp, _backPassOp,
_backDepthFailOp, _backCompareOp);
api.CmdSetStencilOp(commandBuffer, StencilFaceFlags.FaceFrontBit, _frontFailOp, _frontPassOp,
_frontDepthFailOp, _frontCompareOp);
api.CmdSetStencilOp(commandBuffer, StencilFaceFlags.FaceBackBit, _backFailOp, _backPassOp, _backDepthFailOp, _backCompareOp);
api.CmdSetStencilOp(commandBuffer, StencilFaceFlags.FaceFrontBit, _frontFailOp, _frontPassOp, _frontDepthFailOp, _frontCompareOp);
}
private void RecordViewport(VulkanRenderer gd, CommandBuffer commandBuffer)
@ -434,13 +429,11 @@ namespace Ryujinx.Graphics.Vulkan
if (gd.Capabilities.SupportsExtendedDynamicState)
{
gd.ExtendedDynamicStateApi.CmdSetViewportWithCount(commandBuffer, ViewportsCount,
Viewports.AsSpan());
gd.ExtendedDynamicStateApi.CmdSetViewportWithCount(commandBuffer, ViewportsCount, Viewports.AsSpan());
}
else
{
gd.Api.CmdSetViewport(commandBuffer, 0, ViewportsCount,
Viewports.AsSpan());
gd.Api.CmdSetViewport(commandBuffer, 0, ViewportsCount, Viewports.AsSpan());
}
}

View file

@ -7,7 +7,6 @@ namespace Ryujinx.Graphics.Vulkan
{
struct PipelineState : IDisposable
{
private const int RequiredSubgroupSize = 32;
private const int MaxDynamicStatesCount = 23;
public PipelineUid Internal;
@ -406,10 +405,7 @@ namespace Ryujinx.Graphics.Vulkan
PrimitiveRestartEnable &= topologySupportsRestart;
}
if (_supportsExtDynamicState && (Topology != PrimitiveTopology.LineList ||
Topology != PrimitiveTopology.TriangleStrip ||
Topology != PrimitiveTopology.PointList ||
Topology != PrimitiveTopology.PatchList))
if (_supportsExtDynamicState)
{
Topology = Topology.ConvertToClass();
}

View file

@ -423,7 +423,7 @@ namespace Ryujinx.Graphics.Vulkan
properties.Limits.FramebufferStencilSampleCounts;
// Temporarily disable this, can be added back at a later date, make it easy to re-enable.
// Disabled because currently causing Device Lost error on nVidia.
// Disabled because currently causing Device Lost error on NVIDIA.
featuresExtendedDynamicState2.ExtendedDynamicState2PatchControlPoints = false;
Capabilities = new HardwareCapabilities(