mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 11:08:03 +02:00
radv/rt: Fix frontface culling with emulated RT
We need to preserve the divisor's sign for front/backface detection to
work correctly.
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28034>
(cherry picked from commit 7792ee1c15)
This commit is contained in:
parent
dfc52d165a
commit
eecce40e2a
2 changed files with 7 additions and 5 deletions
|
|
@ -4,7 +4,7 @@
|
|||
"description": "radv/rt: Fix frontface culling with emulated RT",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -269,11 +269,13 @@ intersect_ray_amd_software_tri(struct radv_device *device, nir_builder *b, nir_d
|
|||
|
||||
nir_push_if(b, det_cond_front);
|
||||
{
|
||||
t = nir_f2f32(b, nir_fdiv(b, t, det));
|
||||
v = nir_f2f32(b, nir_fdiv(b, v, det));
|
||||
w = nir_f2f32(b, nir_fdiv(b, w, det));
|
||||
nir_def *det_abs = nir_fabs(b, det);
|
||||
|
||||
nir_def *indices[4] = {t, nir_imm_float(b, 1.0), v, w};
|
||||
t = nir_f2f32(b, nir_fdiv(b, t, det_abs));
|
||||
v = nir_f2f32(b, nir_fdiv(b, v, det_abs));
|
||||
w = nir_f2f32(b, nir_fdiv(b, w, det_abs));
|
||||
|
||||
nir_def *indices[4] = {t, nir_f2f32(b, nir_fsign(b, det)), v, w};
|
||||
nir_store_var(b, result, nir_vec(b, indices, 4), 0xf);
|
||||
}
|
||||
nir_pop_if(b, NULL);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue