Merge remote-tracking branch 'origin/master' into custom

This commit is contained in:
roytam1 2021-03-25 09:26:26 +08:00
commit f9ded55f98
89 changed files with 168 additions and 3086 deletions

View file

@ -390,6 +390,16 @@ WebGLContext::TexImage(const char* funcName, uint8_t funcDims, GLenum rawTarget,
if (!ValidateTexImageTarget(this, funcName, funcDims, rawTarget, &target, &tex))
return;
const bool isUploadFromPbo = bool(src.mPboOffset);
const bool isPboBound = bool(mBoundPixelUnpackBuffer);
if (isUploadFromPbo != isPboBound) {
SynthesizeGLError(LOCAL_GL_INVALID_OPERATION,
"Tex upload from %s but PIXEL_UNPACK_BUFFER %s bound.",
isUploadFromPbo ? "PBO" : "non-PBO",
isPboBound ? "was" : "was not");
return;
}
const webgl::PackingInfo pi = {unpackFormat, unpackType};
tex->TexImage(funcName, target, level, internalFormat, width, height, depth, border,
pi, src);
@ -407,6 +417,16 @@ WebGLContext::TexSubImage(const char* funcName, uint8_t funcDims, GLenum rawTarg
if (!ValidateTexImageTarget(this, funcName, funcDims, rawTarget, &target, &tex))
return;
const bool isUploadFromPbo = bool(src.mPboOffset);
const bool isPboBound = bool(mBoundPixelUnpackBuffer);
if (isUploadFromPbo != isPboBound) {
SynthesizeGLError(LOCAL_GL_INVALID_OPERATION,
"Tex upload from %s but PIXEL_UNPACK_BUFFER %s bound.",
isUploadFromPbo ? "PBO" : "non-PBO",
isPboBound ? "was" : "was not");
return;
}
const webgl::PackingInfo pi = {unpackFormat, unpackType};
tex->TexSubImage(funcName, target, level, xOffset, yOffset, zOffset, width, height,
depth, pi, src);