From 6c109abd9e77c85b0ba7c241ece8dacd8e228aa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 28 Jan 2018 18:00:48 +0100 Subject: [PATCH] Don't crash on missing readback formats. --- ext/native/thin3d/DataFormatGL.cpp | 1 - ext/native/thin3d/GLQueueRunner.cpp | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/native/thin3d/DataFormatGL.cpp b/ext/native/thin3d/DataFormatGL.cpp index e2aa7a7a1b..5d48f15868 100644 --- a/ext/native/thin3d/DataFormatGL.cpp +++ b/ext/native/thin3d/DataFormatGL.cpp @@ -81,7 +81,6 @@ bool Thin3DFormatToFormatAndType(DataFormat fmt, GLuint &internalFormat, GLuint #endif default: - _assert_msg_(G3D, false, "Thin3d GL: Unsupported texture format %d", (int)fmt); return false; } return true; diff --git a/ext/native/thin3d/GLQueueRunner.cpp b/ext/native/thin3d/GLQueueRunner.cpp index a895ed4649..3ea3636968 100644 --- a/ext/native/thin3d/GLQueueRunner.cpp +++ b/ext/native/thin3d/GLQueueRunner.cpp @@ -984,7 +984,8 @@ void GLQueueRunner::PerformReadback(const GLRStep &pass) { GLuint type; int alignment; if (!Draw::Thin3DFormatToFormatAndType(pass.readback.dstFormat, internalFormat, format, type, alignment)) { - assert(false); + ELOG("Readback failed - format %d not available", (int)pass.readback.dstFormat); + return; } int pixelStride = pass.readback.srcRect.w; // Apply the correct alignment.