Need to test this on Windows

This commit is contained in:
sunshineinabox 2024-09-02 20:18:24 -07:00
parent 91c3ac2701
commit 1fa1c7b01d
4 changed files with 16 additions and 15 deletions

View File

@ -674,9 +674,9 @@ namespace Ryujinx.Graphics.Vulkan
if (_supportExtDynamic)
{
if (oldTopology.ConvertToClass() != _newState.Topology.ConvertToClass())
if (oldTopology != _newState.Topology.ConvertToClass())
{
_newState.Topology = oldTopology.ConvertToClass();
_newState.Topology = oldTopology;
}
DynamicState.SetCullMode(oldCullMode);
@ -971,7 +971,7 @@ namespace Ryujinx.Graphics.Vulkan
// so we need to force disable them here.
bool logicOpEnable = enable && (Gd.Vendor == Vendor.Nvidia || _newState.Internal.LogicOpsAllowed);
_newState.LogicOpEnable = logicOpEnable;
_newState.LogicOpEnable = enable;
if (Gd.Capabilities.SupportsExtendedDynamicState2.ExtendedDynamicState2LogicOp)
{
@ -979,7 +979,6 @@ namespace Ryujinx.Graphics.Vulkan
{
DynamicState.SetLogicOp(op.Convert());
}
}
else
{
@ -1041,8 +1040,6 @@ namespace Ryujinx.Graphics.Vulkan
public void SetPrimitiveTopology(PrimitiveTopology topology)
{
topology = _newState.HasTessellationControlShader ? PrimitiveTopology.Patches : topology;
_topology = topology;
var vkTopology = Gd.TopologyRemap(topology).Convert();
@ -1402,7 +1399,7 @@ namespace Ryujinx.Graphics.Vulkan
_newState.Internal.VertexBindingDescriptions[descriptorIndex] = new VertexInputBindingDescription(
(uint)binding,
_supportExtDynamic && !Gd.IsMoltenVk ? 0 : (uint)vertexBuffer.Stride,
_supportExtDynamic && !Gd.IsMoltenVk ? default : (uint)vertexBuffer.Stride,
inputRate);
int vbSize = vertexBuffer.Buffer.Size;

View File

@ -229,6 +229,8 @@ namespace Ryujinx.Graphics.Vulkan
pipeline.Topology = topology;
pipeline.LogicOpEnable = state.LogicOpEnable;
int vaCount = Math.Min(Constants.MaxVertexAttributes, state.VertexAttribCount);
int vbCount = Math.Min(Constants.MaxVertexBuffers, state.VertexBufferCount);
@ -272,7 +274,7 @@ namespace Ryujinx.Graphics.Vulkan
// TODO: Support divisor > 1
pipeline.Internal.VertexBindingDescriptions[descriptorIndex++] = new VertexInputBindingDescription(
(uint)i + 1,
extendedDynamicState && !gd.IsMoltenVk ? 0 : (uint)alignedStride,
extendedDynamicState && !gd.IsMoltenVk ? default : (uint)alignedStride,
inputRate);
}
}
@ -336,9 +338,7 @@ namespace Ryujinx.Graphics.Vulkan
pipeline.Internal.LogicOpsAllowed = attachmentCount == 0 || !allFormatsFloatOrSrgb;
bool logicOpEnable = state.LogicOpEnable &&
(gd.Vendor == Vendor.Nvidia || (attachmentCount == 0 || !allFormatsFloatOrSrgb));
pipeline.LogicOpEnable = logicOpEnable;
(gd.Vendor == Vendor.Nvidia || pipeline.Internal.LogicOpsAllowed);
if (!extendedDynamicState2.ExtendedDynamicState2LogicOp)
{

View File

@ -276,8 +276,6 @@ namespace Ryujinx.Graphics.Vulkan
public void ReplayIfDirty(VulkanRenderer gd, CommandBuffer commandBuffer)
{
_ = gd.Api;
if (_dirty.HasFlag(DirtyFlags.Blend))
{
RecordBlend(gd.Api, commandBuffer);

View File

@ -420,10 +420,12 @@ namespace Ryujinx.Graphics.Vulkan
PVertexBindingDescriptions = pVertexBindingDescriptions,
};
var topology = HasTessellationControlShader ? PrimitiveTopology.PatchList : Topology;
var inputAssemblyState = new PipelineInputAssemblyStateCreateInfo
{
SType = StructureType.PipelineInputAssemblyStateCreateInfo,
Topology = Topology,
Topology = topology,
};
PipelineTessellationStateCreateInfo tessellationState;
@ -554,12 +556,16 @@ namespace Ryujinx.Graphics.Vulkan
}
}
// Vendors other than NVIDIA have a bug where it enables logical operations even for float formats,
// so we need to force disable them here.
bool logicOpEnable = LogicOpEnable && (gd.Vendor == Vendor.Nvidia || Internal.LogicOpsAllowed);
var colorBlendState = new PipelineColorBlendStateCreateInfo
{
SType = StructureType.PipelineColorBlendStateCreateInfo,
AttachmentCount = ColorBlendAttachmentStateCount,
PAttachments = pColorBlendAttachmentState,
LogicOpEnable = LogicOpEnable,
LogicOpEnable = logicOpEnable,
};
if (!gd.Capabilities.SupportsExtendedDynamicState2.ExtendedDynamicState2LogicOp)