From cee187309322fa3a5a9b450d0dfd91e6d736d045 Mon Sep 17 00:00:00 2001 From: Timur Gagiev Date: Wed, 25 Nov 2020 06:28:11 +0300 Subject: [PATCH] fix luminance format for textures --- src/gapi/gl.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gapi/gl.h b/src/gapi/gl.h index 4b79342..8baf60f 100644 --- a/src/gapi/gl.h +++ b/src/gapi/gl.h @@ -890,6 +890,11 @@ namespace GAPI { desc.fmt = GL_RGBA; } + if (fmt == FMT_LUMINANCE && Core::support.texRG) { + desc.ifmt = GL_R8; + desc.fmt = GL_RED; + } + #ifdef _OS_WEB // fucking firefox! if (WEBGL_VERSION == 1) { if (fmt == FMT_RG_FLOAT) { @@ -1293,7 +1298,7 @@ namespace GAPI { support.shadowSampler = _GL_EXT_shadow_samplers || _GL_ARB_shadow; support.discardFrame = extSupport("_discard_framebuffer"); support.texNPOT = GLES3 || extSupport("_texture_npot") || extSupport("_texture_non_power_of_two"); - support.texRG = GLES3 || extSupport("_texture_rg "); // hope that isn't last extension in string ;) + support.texRG = GLES3 || extSupport("_texture_rg"); support.texMaxLevel = GLES3 || extSupport("_texture_max_level"); #ifdef _GAPI_GLES2 // TODO