mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-03 14:28:39 +09:00
Truncate Buffer/Texture on GL_OOM.
This commit is contained in:
parent
31b1431ea1
commit
537197dfdc
5 changed files with 25 additions and 3 deletions
|
|
@ -215,6 +215,16 @@ WebGLRenderbuffer::RenderbufferStorage(const char* funcName, uint32_t samples,
|
|||
if (error) {
|
||||
const char* errorName = mContext->ErrorName(error);
|
||||
mContext->GenerateWarning("%s generated error %s", funcName, errorName);
|
||||
if (error == LOCAL_GL_OUT_OF_MEMORY) {
|
||||
// Truncate.
|
||||
mSamples = 0;
|
||||
mFormat = nullptr;
|
||||
mWidth = 0;
|
||||
mHeight = 0;
|
||||
mImageDataStatus = WebGLImageDataStatus::NoImageData;
|
||||
|
||||
InvalidateStatusOfAttachedFBs();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue