Commit a4a731e2 authored by Shrek Shao's avatar Shrek Shao Committed by Chromium LUCI CQ

Reland "Fix readPixels incorrectly allowing RGBA / UNSIGNED_SHORT without...

Reland "Fix readPixels incorrectly allowing RGBA / UNSIGNED_SHORT without EXT_texture_norm16 support"

This is a reland of 80b096ab

The culprit was identified in Issue 1154356.

Original change's description:
> Fix readPixels incorrectly allowing RGBA / UNSIGNED_SHORT without EXT_texture_norm16 support
>
> Add readPixels validation for RGBA / UNSIGNED_SHORT combination. This is
> only valid with EXT_texture_norm16 extension enabled.
>
> Bug: 1152259
> Change-Id: I0e10b7d29f3b362c4054500270bbad87dcde599f
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2559797
> Commit-Queue: Shrek Shao <shrekshao@google.com>
> Reviewed-by: Kenneth Russell <kbr@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#832141}

Bug: 1152259, 1154356
Change-Id: Ie9ceed14e705380e9d1d07f008f4ec86ea7b7421
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2575048Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Reviewed-by: default avatarJamie Madill <jmadill@chromium.org>
Reviewed-by: default avatarJames Darpinian <jdarpinian@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Cr-Commit-Position: refs/heads/master@{#834348}
parent befd55fe
...@@ -122,9 +122,6 @@ crbug.com/angleproject/5038 conformance/extensions/ext-color-buffer-half-float.h ...@@ -122,9 +122,6 @@ crbug.com/angleproject/5038 conformance/extensions/ext-color-buffer-half-float.h
# under crbug.com/963205 once these two failures are fixed. # under crbug.com/963205 once these two failures are fixed.
crbug.com/1136231 [ win ] conformance/extensions/s3tc-and-rgtc.html [ Failure ] crbug.com/1136231 [ win ] conformance/extensions/s3tc-and-rgtc.html [ Failure ]
crbug.com/1136231 [ linux ] conformance/extensions/s3tc-and-rgtc.html [ Failure ] crbug.com/1136231 [ linux ] conformance/extensions/s3tc-and-rgtc.html [ Failure ]
crbug.com/1152259 [ win ] conformance/reading/read-pixels-test.html [ Failure ]
crbug.com/1152259 [ linux ] conformance/reading/read-pixels-test.html [ Failure ]
crbug.com/1152259 [ mac passthrough ] conformance/reading/read-pixels-test.html [ Failure ]
crbug.com/953120 conformance/programs/program-handling.html [ Failure ] crbug.com/953120 conformance/programs/program-handling.html [ Failure ]
......
...@@ -205,8 +205,6 @@ crbug.com/1110111 [ win nvidia ] conformance/rendering/point-no-attributes.html ...@@ -205,8 +205,6 @@ crbug.com/1110111 [ win nvidia ] conformance/rendering/point-no-attributes.html
# under crbug.com/963205 and crbug.com/964321 once these two failures are fixed. # under crbug.com/963205 and crbug.com/964321 once these two failures are fixed.
crbug.com/1136231 [ win ] conformance/extensions/s3tc-and-rgtc.html [ Failure ] crbug.com/1136231 [ win ] conformance/extensions/s3tc-and-rgtc.html [ Failure ]
crbug.com/1136231 [ linux ] conformance/extensions/s3tc-and-rgtc.html [ Failure ] crbug.com/1136231 [ linux ] conformance/extensions/s3tc-and-rgtc.html [ Failure ]
crbug.com/1152259 [ win ] conformance/reading/read-pixels-test.html [ Failure ]
crbug.com/1152259 [ linux ] conformance/reading/read-pixels-test.html [ Failure ]
# Skipping new tests # Skipping new tests
crbug.com/angleproject/5038 conformance/extensions/ext-color-buffer-half-float.html [ Skip ] crbug.com/angleproject/5038 conformance/extensions/ext-color-buffer-half-float.html [ Skip ]
......
...@@ -1092,7 +1092,6 @@ uint32_t GLES2Util::GetGLReadPixelsImplementationType(uint32_t internal_format, ...@@ -1092,7 +1092,6 @@ uint32_t GLES2Util::GetGLReadPixelsImplementationType(uint32_t internal_format,
case GL_R16UI: case GL_R16UI:
case GL_RG16UI: case GL_RG16UI:
case GL_RGBA16UI: case GL_RGBA16UI:
case GL_RGB10_A2:
case GL_RGB10_A2UI: case GL_RGB10_A2UI:
case GL_R16_EXT: case GL_R16_EXT:
case GL_RG16_EXT: case GL_RG16_EXT:
......
...@@ -5527,7 +5527,6 @@ bool WebGL2RenderingContextBase::ValidateReadPixelsFormatAndType( ...@@ -5527,7 +5527,6 @@ bool WebGL2RenderingContextBase::ValidateReadPixelsFormatAndType(
return false; return false;
} }
return true; return true;
case GL_UNSIGNED_SHORT:
case GL_UNSIGNED_SHORT_5_6_5: case GL_UNSIGNED_SHORT_5_6_5:
case GL_UNSIGNED_SHORT_4_4_4_4: case GL_UNSIGNED_SHORT_4_4_4_4:
case GL_UNSIGNED_SHORT_5_5_5_1: case GL_UNSIGNED_SHORT_5_5_5_1:
...@@ -5538,6 +5537,23 @@ bool WebGL2RenderingContextBase::ValidateReadPixelsFormatAndType( ...@@ -5538,6 +5537,23 @@ bool WebGL2RenderingContextBase::ValidateReadPixelsFormatAndType(
return false; return false;
} }
return true; return true;
case GL_UNSIGNED_SHORT:
if (buffer && buffer->GetType() != DOMArrayBufferView::kTypeUint16) {
SynthesizeGLError(
GL_INVALID_OPERATION, "readPixels",
"type GL_UNSIGNED_SHORT but ArrayBufferView not Uint16Array");
return false;
}
if (format == GL_RGBA) {
if (!ExtensionEnabled(kEXTTextureNorm16Name)) {
SynthesizeGLError(
GL_INVALID_ENUM, "readPixels",
"invalid format/type combination RGBA/UNSIGNED_SHORT without "
"EXT_texture_norm16 support");
return false;
}
}
return true;
case GL_SHORT: case GL_SHORT:
if (buffer && buffer->GetType() != DOMArrayBufferView::kTypeInt16) { if (buffer && buffer->GetType() != DOMArrayBufferView::kTypeInt16) {
SynthesizeGLError(GL_INVALID_OPERATION, "readPixels", SynthesizeGLError(GL_INVALID_OPERATION, "readPixels",
......
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