Bug 667222 - In texSubImage2D, check that the update format matches the existing texture - r=jrmuizel

This commit is contained in:
Benoit Jacob 2011-07-27 14:46:14 -04:00
parent 06db157d33
commit 39b62fae2a
4 changed files with 4 additions and 9 deletions

View File

@ -4548,6 +4548,10 @@ WebGLContext::TexSubImage2D_base(WebGLenum target, WebGLint level,
const WebGLTexture::ImageInfo &imageInfo = tex->ImageInfoAt(level, face);
if (!CanvasUtils::CheckSaneSubrectSize(xoffset, yoffset, width, height, imageInfo.mWidth, imageInfo.mHeight))
return ErrorInvalidValue("texSubImage2D: subtexture rectangle out of bounds");
// Require the format and type in texSubImage2D to match that of the existing texture as created by texImage2D
if (imageInfo.mFormat != format || imageInfo.mType != type)
return ErrorInvalidOperation("texSubImage2D: format or type doesn't match the existing texture");
MakeContextCurrent();

View File

@ -9,10 +9,7 @@ conformance/more/functions/copyTexImage2D.html
conformance/more/functions/copyTexSubImage2D.html
conformance/more/functions/deleteBufferBadArgs.html
conformance/more/functions/texImage2DBadArgs.html
conformance/more/functions/texSubImage2DBadArgs.html
conformance/more/functions/texSubImage2DHTMLBadArgs.html
conformance/more/functions/uniformfArrayLen1.html
conformance/object-deletion-behaviour.html
conformance/read-pixels-test.html
conformance/tex-sub-image-2d-bad-args.html
conformance/uninitialized-test.html

View File

@ -6,12 +6,9 @@ conformance/invalid-passed-params.html
conformance/object-deletion-behaviour.html
conformance/read-pixels-test.html
conformance/tex-input-validation.html
conformance/tex-sub-image-2d-bad-args.html
conformance/more/functions/copyTexImage2D.html
conformance/more/functions/copyTexSubImage2D.html
conformance/more/functions/deleteBufferBadArgs.html
conformance/more/functions/texImage2DBadArgs.html
conformance/more/functions/texSubImage2DBadArgs.html
conformance/more/functions/texSubImage2DHTMLBadArgs.html
conformance/more/functions/uniformfBadArgs.html
conformance/more/functions/uniformiBadArgs.html

View File

@ -3,12 +3,9 @@ conformance/glsl-conformance.html
conformance/invalid-passed-params.html
conformance/object-deletion-behaviour.html
conformance/read-pixels-test.html
conformance/tex-sub-image-2d-bad-args.html
conformance/more/conformance/quickCheckAPI.html
conformance/more/functions/copyTexImage2D.html
conformance/more/functions/copyTexSubImage2D.html
conformance/more/functions/deleteBufferBadArgs.html
conformance/more/functions/texImage2DBadArgs.html
conformance/more/functions/texSubImage2DBadArgs.html
conformance/more/functions/texSubImage2DHTMLBadArgs.html
conformance/more/functions/uniformfArrayLen1.html