mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-29 16:40:13 +01:00
llvmpipe: Improve depth bias rounding workaround
Multiplying by 2 is too conservative to pass depth bias control CTS. Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26282>
This commit is contained in:
parent
84f581c659
commit
b30bebf38e
1 changed files with 10 additions and 4 deletions
|
|
@ -797,11 +797,17 @@ lp_make_setup_variant_key(const struct llvmpipe_context *lp,
|
|||
*/
|
||||
key->floating_point_depth = lp->floating_point_depth && !lp->rasterizer->offset_units_unscaled;
|
||||
|
||||
if (lp->floating_point_depth || lp->rasterizer->offset_units_unscaled) {
|
||||
key->pgon_offset_units = (float) lp->rasterizer->offset_units;
|
||||
} else {
|
||||
key->pgon_offset_units = (float) lp->rasterizer->offset_units;
|
||||
if (lp->rasterizer->offset_units != 0 && !lp->floating_point_depth &&
|
||||
!lp->rasterizer->offset_units_unscaled) {
|
||||
/* Ensure correct rounding if a unorm format is used. */
|
||||
float adjustment =
|
||||
lp->floating_point_depth
|
||||
? 0
|
||||
: (lp->rasterizer->offset_units > 0 ? 0.5 : -0.5);
|
||||
|
||||
key->pgon_offset_units =
|
||||
(float) (lp->rasterizer->offset_units * lp->mrd * 2);
|
||||
(float) ((lp->rasterizer->offset_units + adjustment) * lp->mrd);
|
||||
}
|
||||
|
||||
key->pgon_offset_scale = lp->rasterizer->offset_scale;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue