From 8c90910dcc3ac56ecaa3f0d0ed1a43a423ff687f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 19 Jul 2020 21:27:13 +1000 Subject: Fix T66937: Blank view on navigation with auto-deph & large clip-end --- source/blender/gpu/GPU_matrix.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'source/blender/gpu/GPU_matrix.h') diff --git a/source/blender/gpu/GPU_matrix.h b/source/blender/gpu/GPU_matrix.h index 56d640ea0e4..eabfb5d2dc3 100644 --- a/source/blender/gpu/GPU_matrix.h +++ b/source/blender/gpu/GPU_matrix.h @@ -102,11 +102,15 @@ struct GPUMatrixUnproject_Precalc { float model_inverted[4][4]; float view[4]; bool is_persp; - /** Result of 'projmat_dimensions'. */ + /** + * Result of #projmat_dimensions_db. + * Using double precision here is important as far clipping ranges + * can cause divide-by-zero when using float, see: T66937. + */ struct { - float xmin, xmax; - float ymin, ymax; - float zmin, zmax; + double xmin, xmax; + double ymin, ymax; + double zmin, zmax; } dims; }; -- cgit v1.2.3