Commit 41abf0c4 authored by shrekshao's avatar shrekshao Committed by Commit Bot

Fix ValidateCompressedTexSubDimensions for bptc and rgtc

CompressedTexSubImage* will result in an
INVALID_OPERATION error only if one of the following conditions occurs:

* <width> is not a multiple of four, and <width> plus <xoffset> is not
          equal to TEXTURE_WIDTH;

* <height> is not a multiple of four, and <height> plus <yoffset> is
          not equal to TEXTURE_HEIGHT; or

* <xoffset> or <yoffset> is not a multiple of four.

Bug: 1013369
Change-Id: I2ca55cf10a7d0c96792f9677e016a6a137c597b7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2063583Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
Cr-Commit-Position: refs/heads/master@{#742445}
parent 7be73d5b
...@@ -756,7 +756,15 @@ bool ValidateCompressedTexSubDimensions(GLenum target, ...@@ -756,7 +756,15 @@ bool ValidateCompressedTexSubDimensions(GLenum target,
case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:
case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:
case GL_COMPRESSED_RGBA8_ETC2_EAC: case GL_COMPRESSED_RGBA8_ETC2_EAC:
case GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: { case GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:
case GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:
case GL_COMPRESSED_RGBA_BPTC_UNORM_EXT:
case GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT:
case GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT:
case GL_COMPRESSED_RED_RGTC1_EXT:
case GL_COMPRESSED_SIGNED_RED_RGTC1_EXT:
case GL_COMPRESSED_RED_GREEN_RGTC2_EXT:
case GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT: {
const int kBlockSize = 4; const int kBlockSize = 4;
GLsizei tex_width, tex_height; GLsizei tex_width, tex_height;
if (target == GL_TEXTURE_3D || if (target == GL_TEXTURE_3D ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment