mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 14:18:31 +09:00
[Fix] (MG_Impl/GL_Texture): don't actually allocate large proxy texture to avoid large allocation makes some devices to crash
This commit is contained in:
@@ -685,8 +685,13 @@ namespace MobileGL::MG_Impl::GLImpl {
|
|||||||
auto textureMipmapObject = static_cast<MG_State::GLState::TextureObjectMipmap*>(textureObject.get());
|
auto textureMipmapObject = static_cast<MG_State::GLState::TextureObjectMipmap*>(textureObject.get());
|
||||||
|
|
||||||
// Allocate in TextureObject
|
// Allocate in TextureObject
|
||||||
|
if (isProxy) {
|
||||||
|
MGLOG_D("%s: isProxy = true, not allocating", __func__);
|
||||||
|
} else {
|
||||||
MGLOG_D("%s: Allocating %d bytes at mip %d", __func__, internalBytes, level);
|
MGLOG_D("%s: Allocating %d bytes at mip %d", __func__, internalBytes, level);
|
||||||
textureMipmapObject->AllocateStorage(textureUploadTarget, level, {{width, height, 1}, internalBytes});
|
textureMipmapObject->AllocateStorage(textureUploadTarget, level,
|
||||||
|
{{width, height, 1}, internalBytes});
|
||||||
|
}
|
||||||
|
|
||||||
if (!originalPixels) {
|
if (!originalPixels) {
|
||||||
MGLOG_D("%s: No input pixel and no PBO bound, no pixel transfer", __func__);
|
MGLOG_D("%s: No input pixel and no PBO bound, no pixel transfer", __func__);
|
||||||
|
|||||||
Reference in New Issue
Block a user