Resolve two validation errors that were created by changes
1. One stating that the bound pipeline is identical to the previous with a dynamic state that was previously static (DepthBias) which might cause issues in non Vulkan SDK 1.3 conformant drivers. 2. DynamicState command is sent without current pipeline having the dynamic state enabled.
This commit is contained in:
parent
20101e2ea3
commit
48ad342ee9
2 changed files with 8 additions and 21 deletions
|
@ -793,25 +793,23 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
}
|
||||
|
||||
bool depthBiasEnable = (enables != PolygonModeMask.None) && (factor != 0 && units != 0);
|
||||
bool changed = false;
|
||||
|
||||
if (_newState.DepthBiasEnable != depthBiasEnable)
|
||||
{
|
||||
_newState.DepthBiasEnable = depthBiasEnable;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (depthBiasEnable)
|
||||
{
|
||||
DynamicState.SetDepthBias(factor, units, clamp);
|
||||
changed = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
DynamicState.SetDepthBias(0, 0, 0);
|
||||
}
|
||||
|
||||
if (changed)
|
||||
{
|
||||
SignalStateChange();
|
||||
}
|
||||
}
|
||||
|
||||
public void SetDepthClamp(bool clamp)
|
||||
{
|
||||
|
|
|
@ -565,12 +565,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
|
||||
bool supportsExtDynamicState = gd.Capabilities.SupportsExtendedDynamicState;
|
||||
|
||||
int dynamicStatesCount = supportsExtDynamicState ? 7 : 6;
|
||||
|
||||
if (DepthBiasEnable)
|
||||
{
|
||||
dynamicStatesCount++;
|
||||
}
|
||||
int dynamicStatesCount = supportsExtDynamicState ? 8 : 7;
|
||||
|
||||
DynamicState* dynamicStates = stackalloc DynamicState[dynamicStatesCount];
|
||||
|
||||
|
@ -580,17 +575,11 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
dynamicStates[3] = DynamicState.StencilWriteMask;
|
||||
dynamicStates[4] = DynamicState.StencilReference;
|
||||
dynamicStates[5] = DynamicState.BlendConstants;
|
||||
|
||||
dynamicStatesCount = 6;
|
||||
|
||||
if (DepthBiasEnable)
|
||||
{
|
||||
dynamicStates[dynamicStatesCount++] = DynamicState.DepthBias;
|
||||
}
|
||||
dynamicStates[6] = DynamicState.DepthBias;
|
||||
|
||||
if (supportsExtDynamicState)
|
||||
{
|
||||
dynamicStates[dynamicStatesCount++] = DynamicState.VertexInputBindingStrideExt;
|
||||
dynamicStates[7] = DynamicState.VertexInputBindingStrideExt;
|
||||
}
|
||||
|
||||
var pipelineDynamicStateCreateInfo = new PipelineDynamicStateCreateInfo
|
||||
|
|
Loading…
Reference in a new issue