mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1676242 - Enforce BPTC/RGTC level 0 => w/h multiple of 4. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D96457
This commit is contained in:
parent
ee30ccbff9
commit
439d12dc7e
@ -1171,7 +1171,8 @@ void WebGLTexture::CompressedTexImage(bool sub, GLenum imageTarget,
|
||||
break;
|
||||
|
||||
// Full-only: (The ES3 default)
|
||||
default: // PVRTC
|
||||
case webgl::CompressionFamily::ASTC:
|
||||
case webgl::CompressionFamily::PVRTC:
|
||||
if (offset.x || offset.y || size.x != imageInfo->mWidth ||
|
||||
size.y != imageInfo->mHeight) {
|
||||
mContext->ErrorInvalidOperation(
|
||||
@ -1183,6 +1184,22 @@ void WebGLTexture::CompressedTexImage(bool sub, GLenum imageTarget,
|
||||
}
|
||||
}
|
||||
|
||||
switch (usage->format->compression->family) {
|
||||
case webgl::CompressionFamily::BPTC:
|
||||
case webgl::CompressionFamily::RGTC:
|
||||
if (level == 0) {
|
||||
if (size.x % 4 != 0 || size.y % 4 != 0) {
|
||||
mContext->ErrorInvalidOperation(
|
||||
"For level == 0, width and height must be multiples of 4.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (!ValidateCompressedTexUnpack(mContext, size, usage->format, imageSize))
|
||||
return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user