Need to test this on Windows
This commit is contained in:
parent
91c3ac2701
commit
1fa1c7b01d
4 changed files with 16 additions and 15 deletions
|
@ -674,9 +674,9 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
|
|
||||||
if (_supportExtDynamic)
|
if (_supportExtDynamic)
|
||||||
{
|
{
|
||||||
if (oldTopology.ConvertToClass() != _newState.Topology.ConvertToClass())
|
if (oldTopology != _newState.Topology.ConvertToClass())
|
||||||
{
|
{
|
||||||
_newState.Topology = oldTopology.ConvertToClass();
|
_newState.Topology = oldTopology;
|
||||||
}
|
}
|
||||||
|
|
||||||
DynamicState.SetCullMode(oldCullMode);
|
DynamicState.SetCullMode(oldCullMode);
|
||||||
|
@ -971,7 +971,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
// so we need to force disable them here.
|
// so we need to force disable them here.
|
||||||
bool logicOpEnable = enable && (Gd.Vendor == Vendor.Nvidia || _newState.Internal.LogicOpsAllowed);
|
bool logicOpEnable = enable && (Gd.Vendor == Vendor.Nvidia || _newState.Internal.LogicOpsAllowed);
|
||||||
|
|
||||||
_newState.LogicOpEnable = logicOpEnable;
|
_newState.LogicOpEnable = enable;
|
||||||
|
|
||||||
if (Gd.Capabilities.SupportsExtendedDynamicState2.ExtendedDynamicState2LogicOp)
|
if (Gd.Capabilities.SupportsExtendedDynamicState2.ExtendedDynamicState2LogicOp)
|
||||||
{
|
{
|
||||||
|
@ -979,7 +979,6 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
{
|
{
|
||||||
DynamicState.SetLogicOp(op.Convert());
|
DynamicState.SetLogicOp(op.Convert());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1041,8 +1040,6 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
|
|
||||||
public void SetPrimitiveTopology(PrimitiveTopology topology)
|
public void SetPrimitiveTopology(PrimitiveTopology topology)
|
||||||
{
|
{
|
||||||
topology = _newState.HasTessellationControlShader ? PrimitiveTopology.Patches : topology;
|
|
||||||
|
|
||||||
_topology = topology;
|
_topology = topology;
|
||||||
|
|
||||||
var vkTopology = Gd.TopologyRemap(topology).Convert();
|
var vkTopology = Gd.TopologyRemap(topology).Convert();
|
||||||
|
@ -1402,7 +1399,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
|
|
||||||
_newState.Internal.VertexBindingDescriptions[descriptorIndex] = new VertexInputBindingDescription(
|
_newState.Internal.VertexBindingDescriptions[descriptorIndex] = new VertexInputBindingDescription(
|
||||||
(uint)binding,
|
(uint)binding,
|
||||||
_supportExtDynamic && !Gd.IsMoltenVk ? 0 : (uint)vertexBuffer.Stride,
|
_supportExtDynamic && !Gd.IsMoltenVk ? default : (uint)vertexBuffer.Stride,
|
||||||
inputRate);
|
inputRate);
|
||||||
|
|
||||||
int vbSize = vertexBuffer.Buffer.Size;
|
int vbSize = vertexBuffer.Buffer.Size;
|
||||||
|
|
|
@ -229,6 +229,8 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
|
|
||||||
pipeline.Topology = topology;
|
pipeline.Topology = topology;
|
||||||
|
|
||||||
|
pipeline.LogicOpEnable = state.LogicOpEnable;
|
||||||
|
|
||||||
int vaCount = Math.Min(Constants.MaxVertexAttributes, state.VertexAttribCount);
|
int vaCount = Math.Min(Constants.MaxVertexAttributes, state.VertexAttribCount);
|
||||||
int vbCount = Math.Min(Constants.MaxVertexBuffers, state.VertexBufferCount);
|
int vbCount = Math.Min(Constants.MaxVertexBuffers, state.VertexBufferCount);
|
||||||
|
|
||||||
|
@ -272,7 +274,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
// TODO: Support divisor > 1
|
// TODO: Support divisor > 1
|
||||||
pipeline.Internal.VertexBindingDescriptions[descriptorIndex++] = new VertexInputBindingDescription(
|
pipeline.Internal.VertexBindingDescriptions[descriptorIndex++] = new VertexInputBindingDescription(
|
||||||
(uint)i + 1,
|
(uint)i + 1,
|
||||||
extendedDynamicState && !gd.IsMoltenVk ? 0 : (uint)alignedStride,
|
extendedDynamicState && !gd.IsMoltenVk ? default : (uint)alignedStride,
|
||||||
inputRate);
|
inputRate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -336,9 +338,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
pipeline.Internal.LogicOpsAllowed = attachmentCount == 0 || !allFormatsFloatOrSrgb;
|
pipeline.Internal.LogicOpsAllowed = attachmentCount == 0 || !allFormatsFloatOrSrgb;
|
||||||
|
|
||||||
bool logicOpEnable = state.LogicOpEnable &&
|
bool logicOpEnable = state.LogicOpEnable &&
|
||||||
(gd.Vendor == Vendor.Nvidia || (attachmentCount == 0 || !allFormatsFloatOrSrgb));
|
(gd.Vendor == Vendor.Nvidia || pipeline.Internal.LogicOpsAllowed);
|
||||||
|
|
||||||
pipeline.LogicOpEnable = logicOpEnable;
|
|
||||||
|
|
||||||
if (!extendedDynamicState2.ExtendedDynamicState2LogicOp)
|
if (!extendedDynamicState2.ExtendedDynamicState2LogicOp)
|
||||||
{
|
{
|
||||||
|
|
|
@ -276,8 +276,6 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
|
|
||||||
public void ReplayIfDirty(VulkanRenderer gd, CommandBuffer commandBuffer)
|
public void ReplayIfDirty(VulkanRenderer gd, CommandBuffer commandBuffer)
|
||||||
{
|
{
|
||||||
_ = gd.Api;
|
|
||||||
|
|
||||||
if (_dirty.HasFlag(DirtyFlags.Blend))
|
if (_dirty.HasFlag(DirtyFlags.Blend))
|
||||||
{
|
{
|
||||||
RecordBlend(gd.Api, commandBuffer);
|
RecordBlend(gd.Api, commandBuffer);
|
||||||
|
|
|
@ -420,10 +420,12 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
PVertexBindingDescriptions = pVertexBindingDescriptions,
|
PVertexBindingDescriptions = pVertexBindingDescriptions,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var topology = HasTessellationControlShader ? PrimitiveTopology.PatchList : Topology;
|
||||||
|
|
||||||
var inputAssemblyState = new PipelineInputAssemblyStateCreateInfo
|
var inputAssemblyState = new PipelineInputAssemblyStateCreateInfo
|
||||||
{
|
{
|
||||||
SType = StructureType.PipelineInputAssemblyStateCreateInfo,
|
SType = StructureType.PipelineInputAssemblyStateCreateInfo,
|
||||||
Topology = Topology,
|
Topology = topology,
|
||||||
};
|
};
|
||||||
|
|
||||||
PipelineTessellationStateCreateInfo tessellationState;
|
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
|
var colorBlendState = new PipelineColorBlendStateCreateInfo
|
||||||
{
|
{
|
||||||
SType = StructureType.PipelineColorBlendStateCreateInfo,
|
SType = StructureType.PipelineColorBlendStateCreateInfo,
|
||||||
AttachmentCount = ColorBlendAttachmentStateCount,
|
AttachmentCount = ColorBlendAttachmentStateCount,
|
||||||
PAttachments = pColorBlendAttachmentState,
|
PAttachments = pColorBlendAttachmentState,
|
||||||
LogicOpEnable = LogicOpEnable,
|
LogicOpEnable = logicOpEnable,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!gd.Capabilities.SupportsExtendedDynamicState2.ExtendedDynamicState2LogicOp)
|
if (!gd.Capabilities.SupportsExtendedDynamicState2.ExtendedDynamicState2LogicOp)
|
||||||
|
|
Loading…
Reference in a new issue