fix update bug when compressed texture create with BGFX_TEXTURE_SRGB (#2437)

Co-authored-by: chenmou.cm <chenmou.cm@alibaba-inc.com>
This commit is contained in:
simon chen 2021-03-31 10:50:19 +08:00 committed by GitHub
parent 3c7e21f1a6
commit 0b8677ed06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5638,7 +5638,10 @@ namespace bgfx { namespace gl
bimg::imageCopy(temp, width, height, 1, bpp, srcpitch, data);
data = temp;
}
const GLenum internalFmt = (0 != (m_flags & BGFX_TEXTURE_SRGB))
? s_textureFormat[m_textureFormat].m_internalFmtSrgb
: s_textureFormat[m_textureFormat].m_internalFmt
;
GL_CHECK(compressedTexSubImage(target+_side
, _mip
, _rect.m_x
@ -5647,7 +5650,7 @@ namespace bgfx { namespace gl
, _rect.m_width
, _rect.m_height
, _depth
, m_fmt
, internalFmt
, _mem->size
, data
) );