experiment with depth ranges

This commit is contained in:
CamilleLaVey
2026-09-26 14:59:01 -04:00
parent 1a65725a35
commit d6f69e14dc
2 changed files with 10 additions and 1 deletions
@@ -1299,10 +1299,18 @@ void RasterizerVulkan::UpdateScissorsState(Tegra::Engines::Maxwell3D::Regs& regs
}
void RasterizerVulkan::UpdateDepthBias(Tegra::Engines::Maxwell3D::Regs& regs) {
if (!state_tracker.TouchDepthBias()) {
const bool zeta_changed =
std::exchange(depth_bias_zeta_format, regs.zeta.format) != regs.zeta.format;
const bool bias_changed = state_tracker.TouchDepthBias();
if (!bias_changed && !zeta_changed) {
return;
}
float units = regs.depth_bias / 2.0f;
const bool is_float = regs.zeta.format == Tegra::DepthFormat::Z32_FLOAT ||
regs.zeta.format == Tegra::DepthFormat::Z32_FLOAT_X24S8_UINT;
if (is_float && !device.IsExtDepthBiasControlSupported()) {
units *= 256.0f;
}
const bool is_d24 = regs.zeta.format == Tegra::DepthFormat::Z24_UNORM_S8_UINT ||
regs.zeta.format == Tegra::DepthFormat::X8Z24_UNORM ||
regs.zeta.format == Tegra::DepthFormat::S8Z24_UNORM ||
@@ -225,6 +225,7 @@ private:
boost::container::static_vector<VkSampler, MAX_TEXTURES> sampler_handles;
u32 draw_counter = 0;
Tegra::DepthFormat depth_bias_zeta_format{};
};
} // namespace Vulkan