Skip to content
Permalink
Browse files
[WebGL2] Don't apply buffer offset twice in getBufferSubData
https://bugs.webkit.org/show_bug.cgi?id=243566
rdar://98154048

Reviewed by Kimmo Kinnunen.

* Source/WebCore/html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::getBufferSubData):
baseAddress() already takes care of offset into ArrayBuffer.

Canonical link: https://commits.webkit.org/253175@main
  • Loading branch information
djg committed Aug 6, 2022
1 parent f9c142d commit 747aaf24c4e99c2fcb28a00c8620072a834874a0
Show file tree
Hide file tree
Showing 4 changed files with 467 additions and 1 deletion.
@@ -0,0 +1,385 @@
Make sure that reading from WebGL2 buffers into offset ArrayBufferView works as expected.

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".


PASS context.getError() is context.NO_ERROR
PASS context.getError() is context.NO_ERROR
PASS context.getError() is context.NO_ERROR
PASS context.getError() is context.NO_ERROR
PASS receiver[0] is fullArrayView[0]
PASS receiver[1] is fullArrayView[1]
PASS receiver[2] is fullArrayView[2]
PASS receiver[3] is fullArrayView[3]
PASS receiver[4] is fullArrayView[4]
PASS receiver[5] is fullArrayView[5]
PASS receiver[6] is fullArrayView[6]
PASS receiver[7] is fullArrayView[7]
PASS receiver[8] is fullArrayView[8]
PASS receiver[9] is fullArrayView[9]
PASS context.getError() is context.NO_ERROR
PASS receiver[0] is sentinel
PASS receiver[1] is fullArrayView[0]
PASS receiver[2] is fullArrayView[1]
PASS receiver[3] is fullArrayView[2]
PASS receiver[4] is fullArrayView[3]
PASS receiver[5] is fullArrayView[4]
PASS receiver[6] is fullArrayView[5]
PASS receiver[7] is fullArrayView[6]
PASS receiver[8] is fullArrayView[7]
PASS receiver[9] is fullArrayView[8]
PASS receiver[10] is fullArrayView[9]
PASS context.getError() is context.NO_ERROR
PASS receiver[0] is fullArrayView[1]
PASS receiver[1] is fullArrayView[2]
PASS receiver[2] is fullArrayView[3]
PASS receiver[3] is fullArrayView[4]
PASS receiver[4] is fullArrayView[5]
PASS receiver[5] is fullArrayView[6]
PASS receiver[6] is fullArrayView[7]
PASS receiver[7] is fullArrayView[8]
PASS receiver[8] is fullArrayView[9]
PASS context.getError() is context.NO_ERROR
PASS receiver[0] is sentinel
PASS receiver[1] is fullArrayView[2]
PASS receiver[2] is fullArrayView[3]
PASS receiver[3] is fullArrayView[4]
PASS receiver[4] is fullArrayView[5]
PASS receiver[5] is fullArrayView[6]
PASS receiver[6] is fullArrayView[7]
PASS receiver[7] is fullArrayView[8]
PASS receiver[8] is fullArrayView[9]
PASS context.getError() is context.NO_ERROR
PASS context.getError() is context.NO_ERROR
PASS context.getError() is context.NO_ERROR
PASS context.getError() is context.NO_ERROR
PASS context.getError() is context.NO_ERROR
PASS receiver[0] is fullArrayView[0]
PASS receiver[1] is fullArrayView[1]
PASS receiver[2] is fullArrayView[2]
PASS receiver[3] is fullArrayView[3]
PASS receiver[4] is fullArrayView[4]
PASS receiver[5] is fullArrayView[5]
PASS receiver[6] is fullArrayView[6]
PASS receiver[7] is fullArrayView[7]
PASS receiver[8] is fullArrayView[8]
PASS receiver[9] is fullArrayView[9]
PASS context.getError() is context.NO_ERROR
PASS receiver[0] is sentinel
PASS receiver[1] is fullArrayView[0]
PASS receiver[2] is fullArrayView[1]
PASS receiver[3] is fullArrayView[2]
PASS receiver[4] is fullArrayView[3]
PASS receiver[5] is fullArrayView[4]
PASS receiver[6] is fullArrayView[5]
PASS receiver[7] is fullArrayView[6]
PASS receiver[8] is fullArrayView[7]
PASS receiver[9] is fullArrayView[8]
PASS receiver[10] is fullArrayView[9]
PASS context.getError() is context.NO_ERROR
PASS receiver[0] is fullArrayView[1]
PASS receiver[1] is fullArrayView[2]
PASS receiver[2] is fullArrayView[3]
PASS receiver[3] is fullArrayView[4]
PASS receiver[4] is fullArrayView[5]
PASS receiver[5] is fullArrayView[6]
PASS receiver[6] is fullArrayView[7]
PASS receiver[7] is fullArrayView[8]
PASS receiver[8] is fullArrayView[9]
PASS context.getError() is context.NO_ERROR
PASS receiver[0] is sentinel
PASS receiver[1] is fullArrayView[2]
PASS receiver[2] is fullArrayView[3]
PASS receiver[3] is fullArrayView[4]
PASS receiver[4] is fullArrayView[5]
PASS receiver[5] is fullArrayView[6]
PASS receiver[6] is fullArrayView[7]
PASS receiver[7] is fullArrayView[8]
PASS receiver[8] is fullArrayView[9]
PASS context.getError() is context.NO_ERROR
PASS context.getError() is context.NO_ERROR
PASS context.getError() is context.NO_ERROR
PASS context.getError() is context.NO_ERROR
PASS context.getError() is context.NO_ERROR
PASS receiver[0] is fullArrayView[0]
PASS receiver[1] is fullArrayView[1]
PASS receiver[2] is fullArrayView[2]
PASS receiver[3] is fullArrayView[3]
PASS receiver[4] is fullArrayView[4]
PASS receiver[5] is fullArrayView[5]
PASS receiver[6] is fullArrayView[6]
PASS receiver[7] is fullArrayView[7]
PASS receiver[8] is fullArrayView[8]
PASS receiver[9] is fullArrayView[9]
PASS context.getError() is context.NO_ERROR
PASS receiver[0] is sentinel
PASS receiver[1] is fullArrayView[0]
PASS receiver[2] is fullArrayView[1]
PASS receiver[3] is fullArrayView[2]
PASS receiver[4] is fullArrayView[3]
PASS receiver[5] is fullArrayView[4]
PASS receiver[6] is fullArrayView[5]
PASS receiver[7] is fullArrayView[6]
PASS receiver[8] is fullArrayView[7]
PASS receiver[9] is fullArrayView[8]
PASS receiver[10] is fullArrayView[9]
PASS context.getError() is context.NO_ERROR
PASS receiver[0] is fullArrayView[1]
PASS receiver[1] is fullArrayView[2]
PASS receiver[2] is fullArrayView[3]
PASS receiver[3] is fullArrayView[4]
PASS receiver[4] is fullArrayView[5]
PASS receiver[5] is fullArrayView[6]
PASS receiver[6] is fullArrayView[7]
PASS receiver[7] is fullArrayView[8]
PASS receiver[8] is fullArrayView[9]
PASS context.getError() is context.NO_ERROR
PASS receiver[0] is sentinel
PASS receiver[1] is fullArrayView[2]
PASS receiver[2] is fullArrayView[3]
PASS receiver[3] is fullArrayView[4]
PASS receiver[4] is fullArrayView[5]
PASS receiver[5] is fullArrayView[6]
PASS receiver[6] is fullArrayView[7]
PASS receiver[7] is fullArrayView[8]
PASS receiver[8] is fullArrayView[9]
PASS context.getError() is context.NO_ERROR
PASS context.getError() is context.NO_ERROR
PASS context.getError() is context.NO_ERROR
PASS context.getError() is context.NO_ERROR
PASS context.getError() is context.NO_ERROR
PASS receiver[0] is fullArrayView[0]
PASS receiver[1] is fullArrayView[1]
PASS receiver[2] is fullArrayView[2]
PASS receiver[3] is fullArrayView[3]
PASS receiver[4] is fullArrayView[4]
PASS receiver[5] is fullArrayView[5]
PASS receiver[6] is fullArrayView[6]
PASS receiver[7] is fullArrayView[7]
PASS receiver[8] is fullArrayView[8]
PASS receiver[9] is fullArrayView[9]
PASS context.getError() is context.NO_ERROR
PASS receiver[0] is sentinel
PASS receiver[1] is fullArrayView[0]
PASS receiver[2] is fullArrayView[1]
PASS receiver[3] is fullArrayView[2]
PASS receiver[4] is fullArrayView[3]
PASS receiver[5] is fullArrayView[4]
PASS receiver[6] is fullArrayView[5]
PASS receiver[7] is fullArrayView[6]
PASS receiver[8] is fullArrayView[7]
PASS receiver[9] is fullArrayView[8]
PASS receiver[10] is fullArrayView[9]
PASS context.getError() is context.NO_ERROR
PASS receiver[0] is fullArrayView[1]
PASS receiver[1] is fullArrayView[2]
PASS receiver[2] is fullArrayView[3]
PASS receiver[3] is fullArrayView[4]
PASS receiver[4] is fullArrayView[5]
PASS receiver[5] is fullArrayView[6]
PASS receiver[6] is fullArrayView[7]
PASS receiver[7] is fullArrayView[8]
PASS receiver[8] is fullArrayView[9]
PASS context.getError() is context.NO_ERROR
PASS receiver[0] is sentinel
PASS receiver[1] is fullArrayView[2]
PASS receiver[2] is fullArrayView[3]
PASS receiver[3] is fullArrayView[4]
PASS receiver[4] is fullArrayView[5]
PASS receiver[5] is fullArrayView[6]
PASS receiver[6] is fullArrayView[7]
PASS receiver[7] is fullArrayView[8]
PASS receiver[8] is fullArrayView[9]
PASS context.getError() is context.NO_ERROR
PASS context.getError() is context.NO_ERROR
PASS context.getError() is context.NO_ERROR
PASS context.getError() is context.NO_ERROR
PASS context.getError() is context.NO_ERROR
PASS receiver[0] is fullArrayView[0]
PASS receiver[1] is fullArrayView[1]
PASS receiver[2] is fullArrayView[2]
PASS receiver[3] is fullArrayView[3]
PASS receiver[4] is fullArrayView[4]
PASS receiver[5] is fullArrayView[5]
PASS receiver[6] is fullArrayView[6]
PASS receiver[7] is fullArrayView[7]
PASS receiver[8] is fullArrayView[8]
PASS receiver[9] is fullArrayView[9]
PASS context.getError() is context.NO_ERROR
PASS receiver[0] is sentinel
PASS receiver[1] is fullArrayView[0]
PASS receiver[2] is fullArrayView[1]
PASS receiver[3] is fullArrayView[2]
PASS receiver[4] is fullArrayView[3]
PASS receiver[5] is fullArrayView[4]
PASS receiver[6] is fullArrayView[5]
PASS receiver[7] is fullArrayView[6]
PASS receiver[8] is fullArrayView[7]
PASS receiver[9] is fullArrayView[8]
PASS receiver[10] is fullArrayView[9]
PASS context.getError() is context.NO_ERROR
PASS receiver[0] is fullArrayView[1]
PASS receiver[1] is fullArrayView[2]
PASS receiver[2] is fullArrayView[3]
PASS receiver[3] is fullArrayView[4]
PASS receiver[4] is fullArrayView[5]
PASS receiver[5] is fullArrayView[6]
PASS receiver[6] is fullArrayView[7]
PASS receiver[7] is fullArrayView[8]
PASS receiver[8] is fullArrayView[9]
PASS context.getError() is context.NO_ERROR
PASS receiver[0] is sentinel
PASS receiver[1] is fullArrayView[2]
PASS receiver[2] is fullArrayView[3]
PASS receiver[3] is fullArrayView[4]
PASS receiver[4] is fullArrayView[5]
PASS receiver[5] is fullArrayView[6]
PASS receiver[6] is fullArrayView[7]
PASS receiver[7] is fullArrayView[8]
PASS receiver[8] is fullArrayView[9]
PASS context.getError() is context.NO_ERROR
PASS context.getError() is context.NO_ERROR
PASS context.getError() is context.NO_ERROR
PASS context.getError() is context.NO_ERROR
PASS context.getError() is context.NO_ERROR
PASS receiver[0] is fullArrayView[0]
PASS receiver[1] is fullArrayView[1]
PASS receiver[2] is fullArrayView[2]
PASS receiver[3] is fullArrayView[3]
PASS receiver[4] is fullArrayView[4]
PASS receiver[5] is fullArrayView[5]
PASS receiver[6] is fullArrayView[6]
PASS receiver[7] is fullArrayView[7]
PASS receiver[8] is fullArrayView[8]
PASS receiver[9] is fullArrayView[9]
PASS context.getError() is context.NO_ERROR
PASS receiver[0] is sentinel
PASS receiver[1] is fullArrayView[0]
PASS receiver[2] is fullArrayView[1]
PASS receiver[3] is fullArrayView[2]
PASS receiver[4] is fullArrayView[3]
PASS receiver[5] is fullArrayView[4]
PASS receiver[6] is fullArrayView[5]
PASS receiver[7] is fullArrayView[6]
PASS receiver[8] is fullArrayView[7]
PASS receiver[9] is fullArrayView[8]
PASS receiver[10] is fullArrayView[9]
PASS context.getError() is context.NO_ERROR
PASS receiver[0] is fullArrayView[1]
PASS receiver[1] is fullArrayView[2]
PASS receiver[2] is fullArrayView[3]
PASS receiver[3] is fullArrayView[4]
PASS receiver[4] is fullArrayView[5]
PASS receiver[5] is fullArrayView[6]
PASS receiver[6] is fullArrayView[7]
PASS receiver[7] is fullArrayView[8]
PASS receiver[8] is fullArrayView[9]
PASS context.getError() is context.NO_ERROR
PASS receiver[0] is sentinel
PASS receiver[1] is fullArrayView[2]
PASS receiver[2] is fullArrayView[3]
PASS receiver[3] is fullArrayView[4]
PASS receiver[4] is fullArrayView[5]
PASS receiver[5] is fullArrayView[6]
PASS receiver[6] is fullArrayView[7]
PASS receiver[7] is fullArrayView[8]
PASS receiver[8] is fullArrayView[9]
PASS context.getError() is context.NO_ERROR
PASS context.getError() is context.NO_ERROR
PASS context.getError() is context.NO_ERROR
PASS context.getError() is context.NO_ERROR
PASS context.getError() is context.NO_ERROR
PASS receiver[0] is fullArrayView[0]
PASS receiver[1] is fullArrayView[1]
PASS receiver[2] is fullArrayView[2]
PASS receiver[3] is fullArrayView[3]
PASS receiver[4] is fullArrayView[4]
PASS receiver[5] is fullArrayView[5]
PASS receiver[6] is fullArrayView[6]
PASS receiver[7] is fullArrayView[7]
PASS receiver[8] is fullArrayView[8]
PASS receiver[9] is fullArrayView[9]
PASS context.getError() is context.NO_ERROR
PASS receiver[0] is sentinel
PASS receiver[1] is fullArrayView[0]
PASS receiver[2] is fullArrayView[1]
PASS receiver[3] is fullArrayView[2]
PASS receiver[4] is fullArrayView[3]
PASS receiver[5] is fullArrayView[4]
PASS receiver[6] is fullArrayView[5]
PASS receiver[7] is fullArrayView[6]
PASS receiver[8] is fullArrayView[7]
PASS receiver[9] is fullArrayView[8]
PASS receiver[10] is fullArrayView[9]
PASS context.getError() is context.NO_ERROR
PASS receiver[0] is fullArrayView[1]
PASS receiver[1] is fullArrayView[2]
PASS receiver[2] is fullArrayView[3]
PASS receiver[3] is fullArrayView[4]
PASS receiver[4] is fullArrayView[5]
PASS receiver[5] is fullArrayView[6]
PASS receiver[6] is fullArrayView[7]
PASS receiver[7] is fullArrayView[8]
PASS receiver[8] is fullArrayView[9]
PASS context.getError() is context.NO_ERROR
PASS receiver[0] is sentinel
PASS receiver[1] is fullArrayView[2]
PASS receiver[2] is fullArrayView[3]
PASS receiver[3] is fullArrayView[4]
PASS receiver[4] is fullArrayView[5]
PASS receiver[5] is fullArrayView[6]
PASS receiver[6] is fullArrayView[7]
PASS receiver[7] is fullArrayView[8]
PASS receiver[8] is fullArrayView[9]
PASS context.getError() is context.NO_ERROR
PASS context.getError() is context.NO_ERROR
PASS context.getError() is context.NO_ERROR
PASS context.getError() is context.NO_ERROR
PASS context.getError() is context.NO_ERROR
PASS receiver[0] is fullArrayView[0]
PASS receiver[1] is fullArrayView[1]
PASS receiver[2] is fullArrayView[2]
PASS receiver[3] is fullArrayView[3]
PASS receiver[4] is fullArrayView[4]
PASS receiver[5] is fullArrayView[5]
PASS receiver[6] is fullArrayView[6]
PASS receiver[7] is fullArrayView[7]
PASS receiver[8] is fullArrayView[8]
PASS receiver[9] is fullArrayView[9]
PASS context.getError() is context.NO_ERROR
PASS receiver[0] is sentinel
PASS receiver[1] is fullArrayView[0]
PASS receiver[2] is fullArrayView[1]
PASS receiver[3] is fullArrayView[2]
PASS receiver[4] is fullArrayView[3]
PASS receiver[5] is fullArrayView[4]
PASS receiver[6] is fullArrayView[5]
PASS receiver[7] is fullArrayView[6]
PASS receiver[8] is fullArrayView[7]
PASS receiver[9] is fullArrayView[8]
PASS receiver[10] is fullArrayView[9]
PASS context.getError() is context.NO_ERROR
PASS receiver[0] is fullArrayView[1]
PASS receiver[1] is fullArrayView[2]
PASS receiver[2] is fullArrayView[3]
PASS receiver[3] is fullArrayView[4]
PASS receiver[4] is fullArrayView[5]
PASS receiver[5] is fullArrayView[6]
PASS receiver[6] is fullArrayView[7]
PASS receiver[7] is fullArrayView[8]
PASS receiver[8] is fullArrayView[9]
PASS context.getError() is context.NO_ERROR
PASS receiver[0] is sentinel
PASS receiver[1] is fullArrayView[2]
PASS receiver[2] is fullArrayView[3]
PASS receiver[3] is fullArrayView[4]
PASS receiver[4] is fullArrayView[5]
PASS receiver[5] is fullArrayView[6]
PASS receiver[6] is fullArrayView[7]
PASS receiver[7] is fullArrayView[8]
PASS receiver[8] is fullArrayView[9]
PASS context.getError() is context.NO_ERROR
PASS successfullyParsed is true

TEST COMPLETE

0 comments on commit 747aaf2

Please sign in to comment.