From 51fcae8cec1210cad2650283cd17cc4100d52252 Mon Sep 17 00:00:00 2001 From: SNMetamorph <25657591+SNMetamorph@users.noreply.github.com> Date: Thu, 3 Mar 2022 13:51:05 +0400 Subject: [PATCH] ref_gl: gl_image: added check for hardware support of BC6H/BC7 compression formats --- ref_gl/gl_image.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ref_gl/gl_image.c b/ref_gl/gl_image.c index ac5696dc..1b5ed033 100644 --- a/ref_gl/gl_image.c +++ b/ref_gl/gl_image.c @@ -1176,6 +1176,15 @@ static qboolean GL_UploadTexture( gl_texture_t *tex, rgbdata_t *pic ) return false; } + if( pic->type == PF_BC6H_SIGNED || pic->type == PF_BC6H_UNSIGNED || pic->type == PF_BC7 ) + { + if( !GL_Support( GL_ARB_TEXTURE_COMPRESSION_BPTC )) + { + gEngfuncs.Con_DPrintf( S_ERROR "GL_UploadTexture: BC6H/BC7 compression formats is not supported by your hardware\n" ); + return false; + } + } + GL_SetTextureDimensions( tex, pic->width, pic->height, pic->depth ); GL_SetTextureFormat( tex, pic->type, pic->flags );