Some more small changes

This commit is contained in:
sunshineinabox 2024-05-18 22:14:38 -07:00
parent e84bb5cba0
commit 908d555f8e
2 changed files with 6 additions and 8 deletions

View File

@ -901,7 +901,9 @@ namespace Ryujinx.Graphics.Vulkan
public void SetDepthMode(DepthMode mode)
{
bool oldMode;
if (Gd.ExtendedDynamicState3Features.ExtendedDynamicState3DepthClipNegativeOneToOne)
bool supportsDepthClipandDynamicState = Gd.Capabilities.SupportsDepthClipControl &&
Gd.ExtendedDynamicState3Features.ExtendedDynamicState3DepthClipNegativeOneToOne;
if (supportsDepthClipandDynamicState)
{
oldMode = DynamicState.DepthMode;
DynamicState.SetDepthMode(mode == DepthMode.MinusOneToOne);
@ -912,7 +914,7 @@ namespace Ryujinx.Graphics.Vulkan
_newState.DepthMode = mode == DepthMode.MinusOneToOne;
}
if ((Gd.ExtendedDynamicState3Features.ExtendedDynamicState3DepthClipNegativeOneToOne ? DynamicState.DepthMode : _newState.DepthMode) != oldMode)
if ((supportsDepthClipandDynamicState ? DynamicState.DepthMode : _newState.DepthMode) != oldMode)
{
SignalStateChange();
}

View File

@ -517,18 +517,14 @@ namespace Ryujinx.Graphics.Vulkan
viewportState.ScissorCount = ScissorsCount;
}
if (gd.Capabilities.SupportsDepthClipControl)
if (gd.Capabilities.SupportsDepthClipControl && !gd.ExtendedDynamicState3Features.ExtendedDynamicState3DepthClipNegativeOneToOne)
{
var viewportDepthClipControlState = new PipelineViewportDepthClipControlCreateInfoEXT
{
SType = StructureType.PipelineViewportDepthClipControlCreateInfoExt,
NegativeOneToOne = DepthMode,
};
if (!gd.ExtendedDynamicState3Features.ExtendedDynamicState3DepthClipNegativeOneToOne)
{
viewportDepthClipControlState.NegativeOneToOne = DepthMode;
}
viewportState.PNext = &viewportDepthClipControlState;
}