From e62c669f1062340a921a14ed8d1763a03b9fa6df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 19 Apr 2020 18:43:20 +0200 Subject: [PATCH] GLES: Disable range culling on old Tegras, they seem to misbehave (see issue #12838). This is a blind fix - couldn't find my old Shield Portable :( --- ext/native/thin3d/thin3d_gl.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/native/thin3d/thin3d_gl.cpp b/ext/native/thin3d/thin3d_gl.cpp index 9b164ec2ab..ee06060b98 100644 --- a/ext/native/thin3d/thin3d_gl.cpp +++ b/ext/native/thin3d/thin3d_gl.cpp @@ -572,7 +572,11 @@ OpenGLContext::OpenGLContext() { } } - if (caps_.vendor == GPUVendor::VENDOR_VIVANTE || caps_.vendor == GPUVendor::VENDOR_BROADCOM) { + // Try to detect old Tegra chips by checking for sub 3.0 GL versions. Like Vivante and Broadcom, + // those can't handle NaN values in conditionals. + if (caps_.vendor == GPUVendor::VENDOR_VIVANTE || + caps_.vendor == GPUVendor::VENDOR_BROADCOM || + (caps_.vendor == GPUVendor::VENDOR_NVIDIA && !gl_extensions.VersionGEThan(3, 0, 0))) { bugs_.Infest(Bugs::BROKEN_NAN_IN_CONDITIONAL); }