Enabling Depth Bias Explicity (#2766)

This commit is contained in:
Dmugetsu 2025-04-09 18:06:54 -06:00 committed by GitHub
parent e3b1c041d0
commit 5abec2a291
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1096,14 +1096,13 @@ void Rasterizer::UpdateDepthStencilState() const {
} }
const auto depth_bias_enabled = regs.polygon_control.NeedsBias(); const auto depth_bias_enabled = regs.polygon_control.NeedsBias();
dynamic_state.SetDepthBiasEnabled(depth_bias_enabled);
if (depth_bias_enabled) { if (depth_bias_enabled) {
const bool front = regs.polygon_control.enable_polygon_offset_front;
dynamic_state.SetDepthBias( dynamic_state.SetDepthBias(
regs.polygon_control.enable_polygon_offset_front ? regs.poly_offset.front_offset front ? regs.poly_offset.front_offset : regs.poly_offset.back_offset,
: regs.poly_offset.back_offset,
regs.poly_offset.depth_bias, regs.poly_offset.depth_bias,
(regs.polygon_control.enable_polygon_offset_front ? regs.poly_offset.front_scale (front ? regs.poly_offset.front_scale : regs.poly_offset.back_scale) / 16.f);
: regs.poly_offset.back_scale) /
16.f);
} }
const auto stencil_test_enabled = const auto stencil_test_enabled =