|
|
@ -1011,12 +1011,12 @@ void RasterizerVulkan::UpdateDynamicStates() { |
|
|
auto& regs = maxwell3d->regs; |
|
|
auto& regs = maxwell3d->regs; |
|
|
auto& flags = maxwell3d->dirty.flags; |
|
|
auto& flags = maxwell3d->dirty.flags; |
|
|
const auto topology = maxwell3d->draw_manager.draw_state.topology; |
|
|
const auto topology = maxwell3d->draw_manager.draw_state.topology; |
|
|
if (state_tracker.ChangePrimitiveTopology(topology)) { |
|
|
|
|
|
|
|
|
const bool topology_changed = state_tracker.ChangePrimitiveTopology(topology); |
|
|
|
|
|
if (topology_changed) { |
|
|
flags[Dirty::DepthBiasEnable] = true; |
|
|
flags[Dirty::DepthBiasEnable] = true; |
|
|
flags[Dirty::PrimitiveRestartEnable] = true; |
|
|
flags[Dirty::PrimitiveRestartEnable] = true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Core Dynamic States (Vulkan 1.0) - Always active regardless of dyna_state setting
|
|
|
|
|
|
UpdateViewportsState(regs); |
|
|
UpdateViewportsState(regs); |
|
|
UpdateScissorsState(regs); |
|
|
UpdateScissorsState(regs); |
|
|
UpdateDepthBias(regs); |
|
|
UpdateDepthBias(regs); |
|
|
@ -1025,7 +1025,6 @@ void RasterizerVulkan::UpdateDynamicStates() { |
|
|
UpdateStencilFaces(regs); |
|
|
UpdateStencilFaces(regs); |
|
|
UpdateLineWidth(regs); |
|
|
UpdateLineWidth(regs); |
|
|
|
|
|
|
|
|
// EDS1: CullMode, DepthCompare, FrontFace, StencilOp, DepthBoundsTest, DepthTest, DepthWrite, StencilTest
|
|
|
|
|
|
if (device.IsExtExtendedDynamicStateSupported()) { |
|
|
if (device.IsExtExtendedDynamicStateSupported()) { |
|
|
UpdateCullMode(regs); |
|
|
UpdateCullMode(regs); |
|
|
UpdateDepthCompareOp(regs); |
|
|
UpdateDepthCompareOp(regs); |
|
|
@ -1037,21 +1036,24 @@ void RasterizerVulkan::UpdateDynamicStates() { |
|
|
UpdateDepthWriteEnable(regs); |
|
|
UpdateDepthWriteEnable(regs); |
|
|
UpdateStencilTestEnable(regs); |
|
|
UpdateStencilTestEnable(regs); |
|
|
} |
|
|
} |
|
|
|
|
|
if (topology_changed) { |
|
|
|
|
|
scheduler.Record([topology_vk = MaxwellToVK::PrimitiveTopology(device, topology)]( |
|
|
|
|
|
vk::CommandBuffer cmdbuf) { |
|
|
|
|
|
cmdbuf.SetPrimitiveTopologyEXT(topology_vk); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// EDS2: PrimitiveRestart, RasterizerDiscard, DepthBias enable/disable
|
|
|
|
|
|
if (device.IsExtExtendedDynamicState2Supported()) { |
|
|
if (device.IsExtExtendedDynamicState2Supported()) { |
|
|
UpdatePrimitiveRestartEnable(regs); |
|
|
UpdatePrimitiveRestartEnable(regs); |
|
|
UpdateRasterizerDiscardEnable(regs); |
|
|
UpdateRasterizerDiscardEnable(regs); |
|
|
UpdateDepthBiasEnable(regs); |
|
|
UpdateDepthBiasEnable(regs); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// EDS2 Extras: LogicOp operation selection
|
|
|
|
|
|
if (device.IsExtExtendedDynamicState2ExtrasSupported()) { |
|
|
if (device.IsExtExtendedDynamicState2ExtrasSupported()) { |
|
|
UpdateLogicOp(regs); |
|
|
UpdateLogicOp(regs); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// EDS3 Enables: LogicOpEnable, DepthClamp, LineStipple, ConservativeRaster
|
|
|
|
|
|
if (device.IsExtExtendedDynamicState3EnablesSupported()) { |
|
|
if (device.IsExtExtendedDynamicState3EnablesSupported()) { |
|
|
using namespace Tegra::Engines; |
|
|
using namespace Tegra::Engines; |
|
|
// AMD Workaround: LogicOp incompatible with float render targets
|
|
|
// AMD Workaround: LogicOp incompatible with float render targets
|
|
|
@ -1076,12 +1078,10 @@ void RasterizerVulkan::UpdateDynamicStates() { |
|
|
UpdateAlphaToOneEnable(regs); |
|
|
UpdateAlphaToOneEnable(regs); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// EDS3 Blending: ColorBlendEnable, ColorBlendEquation, ColorWriteMask
|
|
|
|
|
|
if (device.IsExtExtendedDynamicState3BlendingSupported()) { |
|
|
if (device.IsExtExtendedDynamicState3BlendingSupported()) { |
|
|
UpdateBlending(regs); |
|
|
UpdateBlending(regs); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Vertex Input Dynamic State: Independent from EDS levels
|
|
|
|
|
|
if (device.IsExtVertexInputDynamicStateSupported()) { |
|
|
if (device.IsExtVertexInputDynamicStateSupported()) { |
|
|
if (auto* gp = pipeline_cache.CurrentGraphicsPipeline(); gp && gp->HasDynamicVertexInput()) { |
|
|
if (auto* gp = pipeline_cache.CurrentGraphicsPipeline(); gp && gp->HasDynamicVertexInput()) { |
|
|
UpdateVertexInput(regs); |
|
|
UpdateVertexInput(regs); |
|
|
|