From 2eddfa85e00d9efa7571721e605a331ca4cd5bc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Sun, 16 Aug 2020 02:03:02 +0200 Subject: [PATCH] Cleanup: GPU: Remove uneeded depth precision getter. We always use 24bit framebuffers nowadays. --- source/blender/gpu/intern/gpu_matrix.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/gpu/intern/gpu_matrix.cc b/source/blender/gpu/intern/gpu_matrix.cc index c9bb7e9dad9..951652b9393 100644 --- a/source/blender/gpu/intern/gpu_matrix.cc +++ b/source/blender/gpu/intern/gpu_matrix.cc @@ -732,8 +732,8 @@ float GPU_polygon_offset_calc(const float (*winmat)[4], float viewdist, float di #else static float depth_fac = 0.0f; if (depth_fac == 0.0f) { - int depthbits; - glGetIntegerv(GL_DEPTH_BITS, &depthbits); + /* Hardcode for 24 bit precision. */ + int depthbits = 24; depth_fac = 1.0f / (float)((1 << depthbits) - 1); } offs = (-1.0 / winmat[2][2]) * dist * depth_fac;