More comments and formatting fixes

This commit is contained in:
sunshineinabox 2024-05-18 15:22:23 -07:00
parent eeecd894b9
commit fd9b4cc10f
3 changed files with 13 additions and 12 deletions

View file

@ -92,7 +92,7 @@ namespace Ryujinx.Graphics.Vulkan
private const float Epsilon = 1e-6f; private const float Epsilon = 1e-6f;
private bool FloatCompare(float a, float b) private readonly bool FloatCompare(float a, float b)
{ {
return Math.Abs(a - b) < Epsilon; return Math.Abs(a - b) < Epsilon;
} }
@ -155,12 +155,12 @@ namespace Ryujinx.Graphics.Vulkan
} }
} }
public void SetStencilOp(StencilOp backFailOp, StencilOp backPassOp, StencilOp backDepthFailOp, public void SetStencilOp(StencilOp backFailOp, StencilOp backPassOp, StencilOp backDepthFailOp,
CompareOp backCompareOp, StencilOp frontFailOp, StencilOp frontPassOp, StencilOp frontDepthFailOp, CompareOp backCompareOp, StencilOp frontFailOp, StencilOp frontPassOp, StencilOp frontDepthFailOp,
CompareOp frontCompareOp) CompareOp frontCompareOp)
{ {
if (_backfailop != backFailOp || _backpassop != backPassOp || _backdepthfailop != backDepthFailOp || if (_backfailop != backFailOp || _backpassop != backPassOp || _backdepthfailop != backDepthFailOp ||
_backcompareop != backCompareOp || _frontfailop != frontFailOp || _frontpassop != frontPassOp || _backcompareop != backCompareOp || _frontfailop != frontFailOp || _frontpassop != frontPassOp ||
_frontdepthfailop != frontDepthFailOp || _frontcompareop != frontCompareOp) _frontdepthfailop != frontDepthFailOp || _frontcompareop != frontCompareOp)
{ {
_backfailop = backFailOp; _backfailop = backFailOp;
@ -175,11 +175,11 @@ namespace Ryujinx.Graphics.Vulkan
} }
} }
public void SetStencilMask(uint backCompareMask, uint backWriteMask, uint backReference, public void SetStencilMask(uint backCompareMask, uint backWriteMask, uint backReference,
uint frontCompareMask, uint frontWriteMask, uint frontReference) uint frontCompareMask, uint frontWriteMask, uint frontReference)
{ {
if (_backCompareMask != backCompareMask || _backWriteMask != backWriteMask || if (_backCompareMask != backCompareMask || _backWriteMask != backWriteMask ||
_backReference != backReference || _frontCompareMask != frontCompareMask || _backReference != backReference || _frontCompareMask != frontCompareMask ||
_frontWriteMask != frontWriteMask || _frontReference != frontReference) _frontWriteMask != frontWriteMask || _frontReference != frontReference)
{ {
_backCompareMask = backCompareMask; _backCompareMask = backCompareMask;
@ -465,7 +465,7 @@ namespace Ryujinx.Graphics.Vulkan
api.CmdSetBlendConstants(commandBuffer, _blendConstants.AsSpan()); api.CmdSetBlendConstants(commandBuffer, _blendConstants.AsSpan());
} }
private void RecordDepthBias(VulkanRenderer gd, CommandBuffer commandBuffer) private readonly void RecordDepthBias(VulkanRenderer gd, CommandBuffer commandBuffer)
{ {
gd.Api.CmdSetDepthBias(commandBuffer, _depthBiasConstantFactor, _depthBiasClamp, _depthBiasSlopeFactor); gd.Api.CmdSetDepthBias(commandBuffer, _depthBiasConstantFactor, _depthBiasClamp, _depthBiasSlopeFactor);
@ -568,7 +568,7 @@ namespace Ryujinx.Graphics.Vulkan
{ {
return; return;
} }
gd.ExtendedDynamicState2Api.CmdSetLogicOp(commandBuffer, _logicOp); gd.ExtendedDynamicState2Api.CmdSetLogicOp(commandBuffer, _logicOp);
} }

View file

@ -481,6 +481,7 @@ namespace Ryujinx.Graphics.Vulkan
if (isMoltenVk) if (isMoltenVk)
{ {
//When widelines feature is not supported it must be 1.0f per spec.
rasterizationState.LineWidth = 1.0f; rasterizationState.LineWidth = 1.0f;
} }
@ -684,7 +685,7 @@ namespace Ryujinx.Graphics.Vulkan
{ {
if (!isMoltenVk) if (!isMoltenVk)
{ {
//Requires Metal 3.1 //Requires Metal 3.1 and new MoltenVK
dynamicStates[currentIndex++] = DynamicState.VertexInputBindingStrideExt; dynamicStates[currentIndex++] = DynamicState.VertexInputBindingStrideExt;
} }
dynamicStates[currentIndex++] = DynamicState.CullModeExt; dynamicStates[currentIndex++] = DynamicState.CullModeExt;

View file

@ -502,7 +502,7 @@ namespace Ryujinx.Graphics.Vulkan
supportedFeaturesExtExtendedDynamicState3.ExtendedDynamicState3LogicOpEnable = false; supportedFeaturesExtExtendedDynamicState3.ExtendedDynamicState3LogicOpEnable = false;
supportedFeaturesExtExtendedDynamicState3.ExtendedDynamicState3AlphaToCoverageEnable = false; supportedFeaturesExtExtendedDynamicState3.ExtendedDynamicState3AlphaToCoverageEnable = false;
extendedDynamicState3Features = supportedFeaturesExtExtendedDynamicState3; extendedDynamicState3Features = supportedFeaturesExtExtendedDynamicState3;
var featuresVk11 = new PhysicalDeviceVulkan11Features var featuresVk11 = new PhysicalDeviceVulkan11Features