LineWidth is not supported on MoltenVK
This commit is contained in:
parent
cc085bcc92
commit
865eb6b69a
3 changed files with 36 additions and 11 deletions
|
@ -967,8 +967,11 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetLineParameters(float width, bool smooth)
|
public void SetLineParameters(float width, bool smooth)
|
||||||
|
{
|
||||||
|
if (!Gd.IsMoltenVk)
|
||||||
{
|
{
|
||||||
DynamicState.SetLineWidth(Gd.Capabilities.SupportsWideLines ? width : 1.0f);
|
DynamicState.SetLineWidth(Gd.Capabilities.SupportsWideLines ? width : 1.0f);
|
||||||
|
}
|
||||||
|
|
||||||
SignalStateChange();
|
SignalStateChange();
|
||||||
}
|
}
|
||||||
|
@ -1502,7 +1505,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
_vertexBuffersDirty = ulong.MaxValue >> (64 - _vertexBuffers.Length);
|
_vertexBuffersDirty = ulong.MaxValue >> (64 - _vertexBuffers.Length);
|
||||||
|
|
||||||
_descriptorSetUpdater.SignalCommandBufferChange();
|
_descriptorSetUpdater.SignalCommandBufferChange();
|
||||||
DynamicState.ForceAllDirty();
|
DynamicState.ForceAllDirty(Gd);
|
||||||
_currentPipelineHandle = 0;
|
_currentPipelineHandle = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,8 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
StencilTestEnable = 1 << 9,
|
StencilTestEnable = 1 << 9,
|
||||||
Toplogy = 1 << 10,
|
Toplogy = 1 << 10,
|
||||||
LineWidth = 1 << 11,
|
LineWidth = 1 << 11,
|
||||||
All = Blend | DepthBias | Scissor | Stencil | Viewport | CullMode | FrontFace | DepthTestBool | DepthTestCompareOp | StencilTestEnable | Toplogy | LineWidth,
|
Standard = Blend | DepthBias | Scissor | Stencil | Viewport | LineWidth,
|
||||||
|
Extended = CullMode | FrontFace | DepthTestBool | DepthTestCompareOp | StencilTestEnable | Toplogy,
|
||||||
}
|
}
|
||||||
|
|
||||||
private DirtyFlags _dirty;
|
private DirtyFlags _dirty;
|
||||||
|
@ -204,9 +205,19 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
_dirty |= DirtyFlags.LineWidth;
|
_dirty |= DirtyFlags.LineWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ForceAllDirty()
|
public void ForceAllDirty(VulkanRenderer gd)
|
||||||
{
|
{
|
||||||
_dirty = DirtyFlags.All;
|
_dirty = DirtyFlags.Standard;
|
||||||
|
|
||||||
|
if (gd.Capabilities.SupportsExtendedDynamicState)
|
||||||
|
{
|
||||||
|
_dirty = DirtyFlags.Standard | DirtyFlags.Extended;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gd.IsMoltenVk)
|
||||||
|
{
|
||||||
|
_dirty &= ~DirtyFlags.LineWidth;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ReplayIfDirty(Vk api, CommandBuffer commandBuffer)
|
public void ReplayIfDirty(Vk api, CommandBuffer commandBuffer)
|
||||||
|
@ -350,8 +361,11 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RecordLineWidth(Vk api, CommandBuffer commandBuffer)
|
private void RecordLineWidth(Vk api, CommandBuffer commandBuffer)
|
||||||
|
{
|
||||||
|
if (!OperatingSystem.IsMacOS())
|
||||||
{
|
{
|
||||||
api.CmdSetLineWidth(commandBuffer, _linewidth);
|
api.CmdSetLineWidth(commandBuffer, _linewidth);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -482,6 +482,11 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
DepthBiasEnable = DepthBiasEnable,
|
DepthBiasEnable = DepthBiasEnable,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (isMoltenVk)
|
||||||
|
{
|
||||||
|
rasterizationState.LineWidth = 1.0f;
|
||||||
|
}
|
||||||
|
|
||||||
if (!supportsExtDynamicState)
|
if (!supportsExtDynamicState)
|
||||||
{
|
{
|
||||||
rasterizationState.CullMode = CullMode;
|
rasterizationState.CullMode = CullMode;
|
||||||
|
@ -599,7 +604,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
colorBlendState.PNext = &colorBlendAdvancedState;
|
colorBlendState.PNext = &colorBlendAdvancedState;
|
||||||
}
|
}
|
||||||
|
|
||||||
int dynamicStatesCount = supportsExtDynamicState ? (isMoltenVk ? 16 : 17) : 8;
|
int dynamicStatesCount = supportsExtDynamicState ? (isMoltenVk ? 16 : 17) : (isMoltenVk ? 7 : 8);
|
||||||
|
|
||||||
DynamicState* dynamicStates = stackalloc DynamicState[dynamicStatesCount];
|
DynamicState* dynamicStates = stackalloc DynamicState[dynamicStatesCount];
|
||||||
|
|
||||||
|
@ -610,8 +615,11 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
dynamicStates[4] = DynamicState.StencilWriteMask;
|
dynamicStates[4] = DynamicState.StencilWriteMask;
|
||||||
dynamicStates[5] = DynamicState.StencilReference;
|
dynamicStates[5] = DynamicState.StencilReference;
|
||||||
dynamicStates[6] = DynamicState.BlendConstants;
|
dynamicStates[6] = DynamicState.BlendConstants;
|
||||||
dynamicStates[7] = DynamicState.LineWidth;
|
|
||||||
|
|
||||||
|
if(!isMoltenVk)
|
||||||
|
{
|
||||||
|
dynamicStates[7] = DynamicState.LineWidth;
|
||||||
|
}
|
||||||
|
|
||||||
if (supportsExtDynamicState)
|
if (supportsExtDynamicState)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue