From ba5a4250adab33cb33ab17b6dab49b21e9ba2a9d Mon Sep 17 00:00:00 2001 From: Wasim Abbas Date: Sat, 7 Sep 2024 16:31:54 +0100 Subject: [PATCH] Fix SRGB asserts --- lib/astc_encode.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/astc_encode.cpp b/lib/astc_encode.cpp index 2dc8dfd3b4..9aefa2695e 100644 --- a/lib/astc_encode.cpp +++ b/lib/astc_encode.cpp @@ -797,8 +797,10 @@ ktxTexture2_CompressAstcEx(ktxTexture2* This, ktxAstcParams* params) { assert(KHR_DFDVAL(prototype->pDfd+1, MODEL) == KHR_DF_MODEL_ASTC && "Invalid dfd generated for ASTC image\n"); assert((transfer == KHR_DF_TRANSFER_SRGB - ? KHR_DFDVAL(prototype->pDfd+1, PRIMARIES) == KHR_DF_PRIMARIES_SRGB - : true) && "Not a valid sRGB image\n"); + ? KHR_DFDVAL(prototype->pDfd+1, TRANSFER) == KHR_DF_TRANSFER_SRGB && + KHR_DFDVAL(prototype->pDfd+1, PRIMARIES) == KHR_DF_PRIMARIES_SRGB + : true) && "Not a valid sRGB image\n"); + // Fix up the current (This) texture #undef DECLARE_PRIVATE