mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-12-27 02:53:04 +00:00
Code review suggestions
This commit is contained in:
parent
dff81088e8
commit
2d0c1c3a1c
4 changed files with 8 additions and 21 deletions
|
@ -335,8 +335,6 @@ namespace Ryujinx.Graphics.OpenGL
|
||||||
return CullFaceMode.Front;
|
return CullFaceMode.Front;
|
||||||
case Face.FrontAndBack:
|
case Face.FrontAndBack:
|
||||||
return CullFaceMode.FrontAndBack;
|
return CullFaceMode.FrontAndBack;
|
||||||
case Face.None:
|
|
||||||
return (CullFaceMode)All.None;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(Face)} enum value: {face}.");
|
Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(Face)} enum value: {face}.");
|
||||||
|
|
|
@ -393,14 +393,11 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
{
|
{
|
||||||
if (gd.Capabilities.SupportsExtendedDynamicState)
|
if (gd.Capabilities.SupportsExtendedDynamicState)
|
||||||
{
|
{
|
||||||
|
gd.ExtendedDynamicStateApi.CmdSetScissorWithCount(commandBuffer, (uint)ScissorsCount, _scissors.AsSpan());
|
||||||
gd.ExtendedDynamicStateApi.CmdSetScissorWithCount(commandBuffer, (uint)ScissorsCount,
|
|
||||||
_scissors.AsSpan());
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gd.Api.CmdSetScissor(commandBuffer, 0, (uint)ScissorsCount,
|
gd.Api.CmdSetScissor(commandBuffer, 0, (uint)ScissorsCount, _scissors.AsSpan());
|
||||||
_scissors.AsSpan());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -419,10 +416,8 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
{
|
{
|
||||||
api.CmdSetStencilTestEnable(commandBuffer, StencilTestEnable);
|
api.CmdSetStencilTestEnable(commandBuffer, StencilTestEnable);
|
||||||
|
|
||||||
api.CmdSetStencilOp(commandBuffer, StencilFaceFlags.FaceBackBit, _backFailOp, _backPassOp,
|
api.CmdSetStencilOp(commandBuffer, StencilFaceFlags.FaceBackBit, _backFailOp, _backPassOp, _backDepthFailOp, _backCompareOp);
|
||||||
_backDepthFailOp, _backCompareOp);
|
api.CmdSetStencilOp(commandBuffer, StencilFaceFlags.FaceFrontBit, _frontFailOp, _frontPassOp, _frontDepthFailOp, _frontCompareOp);
|
||||||
api.CmdSetStencilOp(commandBuffer, StencilFaceFlags.FaceFrontBit, _frontFailOp, _frontPassOp,
|
|
||||||
_frontDepthFailOp, _frontCompareOp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RecordViewport(VulkanRenderer gd, CommandBuffer commandBuffer)
|
private void RecordViewport(VulkanRenderer gd, CommandBuffer commandBuffer)
|
||||||
|
@ -434,13 +429,11 @@ 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());
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gd.Api.CmdSetViewport(commandBuffer, 0, ViewportsCount,
|
gd.Api.CmdSetViewport(commandBuffer, 0, ViewportsCount, Viewports.AsSpan());
|
||||||
Viewports.AsSpan());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
{
|
{
|
||||||
struct PipelineState : IDisposable
|
struct PipelineState : IDisposable
|
||||||
{
|
{
|
||||||
private const int RequiredSubgroupSize = 32;
|
|
||||||
private const int MaxDynamicStatesCount = 23;
|
private const int MaxDynamicStatesCount = 23;
|
||||||
|
|
||||||
public PipelineUid Internal;
|
public PipelineUid Internal;
|
||||||
|
@ -406,10 +405,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
PrimitiveRestartEnable &= topologySupportsRestart;
|
PrimitiveRestartEnable &= topologySupportsRestart;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_supportsExtDynamicState && (Topology != PrimitiveTopology.LineList ||
|
if (_supportsExtDynamicState)
|
||||||
Topology != PrimitiveTopology.TriangleStrip ||
|
|
||||||
Topology != PrimitiveTopology.PointList ||
|
|
||||||
Topology != PrimitiveTopology.PatchList))
|
|
||||||
{
|
{
|
||||||
Topology = Topology.ConvertToClass();
|
Topology = Topology.ConvertToClass();
|
||||||
}
|
}
|
||||||
|
|
|
@ -423,7 +423,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
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.
|
||||||
// Disabled because currently causing Device Lost error on nVidia.
|
// Disabled because currently causing Device Lost error on NVIDIA.
|
||||||
featuresExtendedDynamicState2.ExtendedDynamicState2PatchControlPoints = false;
|
featuresExtendedDynamicState2.ExtendedDynamicState2PatchControlPoints = false;
|
||||||
|
|
||||||
Capabilities = new HardwareCapabilities(
|
Capabilities = new HardwareCapabilities(
|
||||||
|
|
Loading…
Reference in a new issue