Fix depth bias (#1538)
Some checks failed
Build and Release / reuse (push) Has been cancelled
Build and Release / clang-format (push) Has been cancelled
Build and Release / get-info (push) Has been cancelled
Build and Release / windows-sdl (push) Has been cancelled
Build and Release / windows-qt (push) Has been cancelled
Build and Release / macos-sdl (push) Has been cancelled
Build and Release / macos-qt (push) Has been cancelled
Build and Release / linux-sdl (push) Has been cancelled
Build and Release / linux-qt (push) Has been cancelled
Build and Release / pre-release (push) Has been cancelled

This commit is contained in:
Vladislav Mikhalin 2024-11-16 20:17:43 +03:00 committed by GitHub
parent ce158290fb
commit e1fecda74f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -393,14 +393,12 @@ void Rasterizer::UpdateDynamicState(const GraphicsPipeline& pipeline) {
if (regs.depth_control.depth_bounds_enable) { if (regs.depth_control.depth_bounds_enable) {
cmdbuf.setDepthBounds(regs.depth_bounds_min, regs.depth_bounds_max); cmdbuf.setDepthBounds(regs.depth_bounds_min, regs.depth_bounds_max);
} }
if (regs.polygon_control.NeedsBias()) {
if (regs.polygon_control.enable_polygon_offset_front) { if (regs.polygon_control.enable_polygon_offset_front) {
cmdbuf.setDepthBias(regs.poly_offset.front_offset, regs.poly_offset.depth_bias, cmdbuf.setDepthBias(regs.poly_offset.front_offset, regs.poly_offset.depth_bias,
regs.poly_offset.front_scale); regs.poly_offset.front_scale / 16.f);
} else { } else if (regs.polygon_control.enable_polygon_offset_back) {
cmdbuf.setDepthBias(regs.poly_offset.back_offset, regs.poly_offset.depth_bias, cmdbuf.setDepthBias(regs.poly_offset.back_offset, regs.poly_offset.depth_bias,
regs.poly_offset.back_scale); regs.poly_offset.back_scale / 16.f);
}
} }
if (regs.depth_control.stencil_enable) { if (regs.depth_control.stencil_enable) {
const auto front = regs.stencil_ref_front; const auto front = regs.stencil_ref_front;