v3dv: work around viewport Z scale hardware bug
It looks like when the Z scale is small enough the hardware clipper won't work properly. Fixes: dEQP-VK.draw.inverted_depth_ranges.nodepthclamp_deltazero Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
This commit is contained in:
committed by
Marge Bot
parent
db629c0f4b
commit
a1337c027c
@@ -1734,6 +1734,17 @@ v3dv_viewport_compute_xform(const VkViewport *viewport,
|
||||
|
||||
scale[2] = (f - n);
|
||||
translate[2] = n;
|
||||
|
||||
/* It seems that if the scale is small enough the hardware won't clip
|
||||
* correctly so we work around this my choosing the smallest scale that
|
||||
* seems to work.
|
||||
*
|
||||
* This case is exercised by CTS:
|
||||
* dEQP-VK.draw.inverted_depth_ranges.nodepthclamp_deltazero
|
||||
*/
|
||||
const float min_abs_scale = 0.000009f;
|
||||
if (fabs(scale[2]) < min_abs_scale)
|
||||
scale[2] = min_abs_scale * (scale[2] < 0 ? -1.0f : 1.0f);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user