mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 07:18: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
|
|
@ -51,8 +51,6 @@ WebGLTexture::ImageInfo::Clear()
|
|||
WebGLTexture::ImageInfo&
|
||||
WebGLTexture::ImageInfo::operator =(const ImageInfo& a)
|
||||
{
|
||||
MOZ_ASSERT(a.IsDefined());
|
||||
|
||||
Mutable(mFormat) = a.mFormat;
|
||||
Mutable(mWidth) = a.mWidth;
|
||||
Mutable(mHeight) = a.mHeight;
|
||||
|
|
@ -1216,6 +1214,12 @@ WebGLTexture::TexParameter(TexTarget texTarget, GLenum pname, const FloatOrInt&
|
|||
mContext->gl->fTexParameterf(texTarget.get(), pname, clamped.f);
|
||||
}
|
||||
|
||||
void WebGLTexture::Truncate() {
|
||||
for (auto& cur : mImageInfoArr) {
|
||||
SetImageInfo(&cur, ImageInfo());
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(WebGLTexture)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue