mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-08 04:08:32 +09:00
[Misc] (MG_Backend/DirectGLES): Handle GL_BGRA as GL_RGBA in ReadPixels and GetTexImage.
This commit is contained in:
@@ -1244,6 +1244,8 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
||||
MGLOG_D("ReadPixels: x=%d y=%d w=%d h=%d format=%s type=%s pixels=%p", x, y, width, height,
|
||||
MG_Util::ConvertGLEnumToString(format).c_str(), MG_Util::ConvertGLEnumToString(type).c_str(), pixels);
|
||||
|
||||
if (format == GL_BGRA) format = GL_RGBA; // FIXME: convert RGBA to BGRA
|
||||
|
||||
MOBILEGL_ASSERT(format == GL_RGBA || format == GL_RGBA_INTEGER,
|
||||
"Only GL_RGBA and GL_RGBA_INTEGER are supported currently, while requested %s.",
|
||||
MG_Util::ConvertGLEnumToString(format).c_str());
|
||||
@@ -1326,6 +1328,8 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
||||
MG_Util::ConvertGLEnumToString(target).c_str(), level, MG_Util::ConvertGLEnumToString(format).c_str(),
|
||||
MG_Util::ConvertGLEnumToString(type).c_str(), pixels);
|
||||
|
||||
if (format == GL_BGRA) format = GL_RGBA; // FIXME: convert RGBA to BGRA
|
||||
|
||||
MOBILEGL_ASSERT(format == GL_RGBA || format == GL_RGBA_INTEGER,
|
||||
"Only GL_RGBA and GL_RGBA_INTEGER are supported currently, while requested %s.",
|
||||
MG_Util::ConvertGLEnumToString(format).c_str());
|
||||
|
||||
Reference in New Issue
Block a user