Enabling Depth Bias Explicity (#2766)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / linux-qt-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions

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();
dynamic_state.SetDepthBiasEnabled(depth_bias_enabled);
if (depth_bias_enabled) {
const bool front = regs.polygon_control.enable_polygon_offset_front;
dynamic_state.SetDepthBias(
regs.polygon_control.enable_polygon_offset_front ? regs.poly_offset.front_offset
: regs.poly_offset.back_offset,
front ? regs.poly_offset.front_offset : regs.poly_offset.back_offset,
regs.poly_offset.depth_bias,
(regs.polygon_control.enable_polygon_offset_front ? regs.poly_offset.front_scale
: regs.poly_offset.back_scale) /
16.f);
(front ? regs.poly_offset.front_scale : regs.poly_offset.back_scale) / 16.f);
}
const auto stencil_test_enabled =