[Vulkan] Alpha test

This commit is contained in:
Triang3l
2022-06-30 22:20:51 +03:00
parent 6772c88141
commit f8b351138e
5 changed files with 182 additions and 1 deletions

View File

@@ -155,6 +155,17 @@ VulkanPipelineCache::GetCurrentPixelShaderModification(
}
}
using DepthStencilMode =
SpirvShaderTranslator::Modification::DepthStencilMode;
if (shader.implicit_early_z_write_allowed() &&
(!shader.writes_color_target(0) ||
!draw_util::DoesCoverageDependOnAlpha(
regs.Get<reg::RB_COLORCONTROL>()))) {
modification.pixel.depth_stencil_mode = DepthStencilMode::kEarlyHint;
} else {
modification.pixel.depth_stencil_mode = DepthStencilMode::kNoModifiers;
}
return modification;
}