Changeset 265114 in webkit


Ignore:
Timestamp:
Jul 30, 2020 3:27:30 PM (4 years ago)
Author:
commit-queue@webkit.org
Message:

[WebGL2] Buffer updates
https://bugs.webkit.org/show_bug.cgi?id=209511

Patch by James Darpinian <James Darpinian> on 2020-07-30
Reviewed by Dean Jackson.

Various fixes in bufferData, bufferSubData, and getBufferSubData. Passes all WebGL conformance tests in conformance/buffers/* and conformance2/buffers/*.

  • html/canvas/WebGL2RenderingContext.cpp:

(WebCore::WebGL2RenderingContext::sliceArrayBufferView):
(WebCore::WebGL2RenderingContext::getBufferSubData):

  • html/canvas/WebGLRenderingContextBase.cpp:

(WebCore::WebGLRenderingContextBase::bufferData):
(WebCore::WebGLRenderingContextBase::bufferSubData):

  • html/canvas/WebGLRenderingContextBase.h:
  • html/canvas/WebGLRenderingContextBase.idl:
Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/fast/canvas/webgl/buffer-data-array-buffer-expected.txt

    r77421 r265114  
    1414PASS getError was expected value: INVALID_VALUE :
    1515PASS getError was expected value: NO_ERROR :
     16PASS gl.bufferSubData(gl.ARRAY_BUFFER, 10, null) threw exception TypeError: Type error.
    1617PASS getError was expected value: NO_ERROR :
    1718PASS successfullyParsed is true
  • trunk/LayoutTests/fast/canvas/webgl/buffer-data-array-buffer.html

    r177772 r265114  
    5252glErrorShouldBe(gl, gl.NO_ERROR);
    5353
    54 gl.bufferSubData(gl.ARRAY_BUFFER, 10, null);
     54shouldThrow("gl.bufferSubData(gl.ARRAY_BUFFER, 10, null)");
    5555glErrorShouldBe(gl, gl.NO_ERROR);
    5656</script>
  • trunk/LayoutTests/webgl/2.0.0/conformance/buffers/buffer-data-and-buffer-sub-data-expected.txt

    r236236 r265114  
    22
    33Test: ../../resources/webgl_test_files/conformance/buffers/buffer-data-and-buffer-sub-data.html
    4 [ 1: PASS ] WebGL context exists
    5 [ 2: PASS ] [object WebGLBuffer] is non-null.
    6 [ 3: PASS ] getError was expected value: INVALID_OPERATION : no buffer bound
    7 [ 4: PASS ] getError was expected value: NO_ERROR :
    8 [ 5: PASS ] getError was expected value: INVALID_VALUE : calling bufferData when buffer size is negative should generate INVALID_VALUE
    9 [ 6: PASS ] getError was expected value: INVALID_VALUE : calling bufferData when BufferDataSource is null should generate INVALID_VALUE
    10 [ 7: PASS ] getError was expected value: INVALID_VALUE : calling bufferData when BufferDataSource is undefined should generate INVALID_VALUE
    11 [ 8: FAIL ] getError expected: NO_ERROR. Was INVALID_VALUE : Passing 0 to bufferData
    12 [ 9: PASS ] gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE) is 0
    13 [ 10: PASS ] getError was expected value: NO_ERROR : Passing 4 to bufferData
    14 [ 11: PASS ] gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE) is 4
    15 [ 12: PASS ] getError was expected value: NO_ERROR : Passing 5.1 to bufferData
    16 [ 13: PASS ] gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE) is 5
    17 [ 14: PASS ] getError was expected value: NO_ERROR : Passing 5.8 to bufferData
    18 [ 15: PASS ] gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE) is 5
    19 [ 16: PASS ] getError was expected value: NO_ERROR : Passing 5.5 to bufferData
    20 [ 17: PASS ] gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE) is 5
    21 [ 18: PASS ] getError was expected value: NO_ERROR : Passing 4 to bufferData
    22 [ 19: PASS ] gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE) is 4
    23 [ 20: PASS ] getError was expected value: NO_ERROR : Passing 5.1 to bufferData
    24 [ 21: PASS ] gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE) is 5
    25 [ 22: PASS ] getError was expected value: NO_ERROR : Passing 5.8 to bufferData
    26 [ 23: PASS ] gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE) is 5
    27 [ 24: PASS ] getError was expected value: NO_ERROR : Passing 5.5 to bufferData
    28 [ 25: PASS ] gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE) is 5
    29 [ 26: FAIL ] getError expected: NO_ERROR. Was INVALID_VALUE : Passing 0 to bufferData
    30 [ 27: PASS ] gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE) is 0
    31 [ 28: FAIL ] getError expected: NO_ERROR. Was INVALID_VALUE : Passing 42,64 to bufferData
    32 [ 29: PASS ] gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE) is 0
    33 [ 30: PASS ] getError was expected value: NO_ERROR : Passing 42 to bufferData
    34 [ 31: PASS ] gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE) is 42
    35 [ 32: PASS ] getError was expected value: NO_ERROR : Passing 42 to bufferData
    36 [ 33: PASS ] gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE) is 42
    37 [ 34: FAIL ] getError expected: NO_ERROR. Was INVALID_VALUE : Passing 42,64 to bufferData
    38 [ 35: PASS ] gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE) is 0
    39 [ 36: PASS ] getError was expected value: NO_ERROR : Passing [object ArrayBuffer] to bufferData
    40 [ 37: PASS ] gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE) is 0
    41 [ 38: PASS ] getError was expected value: NO_ERROR : Passing [object ArrayBuffer] to bufferData
    42 [ 39: PASS ] gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE) is 4
    43 [ 40: FAIL ] getError expected: NO_ERROR. Was INVALID_VALUE : Passing WebGL Rocks! to bufferData
    44 [ 41: PASS ] gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE) is 0
    45 [ 42: FAIL ] getError expected: NO_ERROR. Was INVALID_VALUE : Passing [object Object] to bufferData
    46 [ 43: PASS ] gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE) is 0
    47 [ 44: PASS ] getError was expected value: INVALID_VALUE : Calling bufferSubData before bufferData should fail
    48 [ 45: PASS ] getError was expected value: NO_ERROR :
    49 [ 46: PASS ] getError was expected value: INVALID_VALUE : calling bufferSubData with ArrayBuffer when offset is negative should INVALID_VALUE
    50 [ 47: PASS ] getError was expected value: INVALID_VALUE : buffer overflow
    51 [ 48: PASS ] getError was expected value: INVALID_VALUE : calling bufferSubData with ArrayBufferView when offset is negative should generate INVALID_VALUE
    52 [ 49: PASS ] getError was expected value: NO_ERROR : calling bufferSubData with ArrayBuffer should succeed
    53 [ 50: PASS ] getError was expected value: NO_ERROR : calling bufferSubData with zero-sized ArrayBufferView should succeed
    54 [ 51: PASS ] gl.bufferSubData(gl.ARRAY_BUFFER, 0, 42); threw exception TypeError: Type error.
    55 [ 52: PASS ] gl.bufferSubData(gl.ARRAY_BUFFER, 0, 5.5); threw exception TypeError: Type error.
    56 [ 53: PASS ] gl.bufferSubData(gl.ARRAY_BUFFER, 0, "5.5"); threw exception TypeError: Type error.
    57 [ 54: PASS ] gl.bufferSubData(gl.ARRAY_BUFFER, 0, [4]); threw exception TypeError: Type error.
    58 [ 55: PASS ] gl.bufferSubData(gl.ARRAY_BUFFER, 0, { mynumber: 42}); threw exception TypeError: Type error.
    59 [ 56: FAIL ] gl.bufferSubData(gl.ARRAY_BUFFER, 10, null) should throw an exception. Was undefined.
    60 [ 57: FAIL ] gl.bufferSubData(gl.ARRAY_BUFFER, 10, undefined) should throw an exception. Was undefined.
    61 [ 58: PASS ] getError was expected value: NO_ERROR : should generate no GL error
    62 [ 59: PASS ] successfullyParsed is true
    63 [ FAIL ] 8 failures reported
     4[ PASS ] All tests passed
    645
  • trunk/LayoutTests/webgl/2.0.0/conformance2/buffers/get-buffer-sub-data-expected.txt

    r256836 r265114  
    22
    33Test: ../../resources/webgl_test_files/conformance2/buffers/get-buffer-sub-data.html
    4 [ 1: PASS ] getError was expected value: NO_ERROR : Should be no errors from setup.
    5 [ 2: PASS ] getError was expected value: NO_ERROR : Should be no errors from buffer setup.
    6 [ 3: PASS ] getError was expected value: NO_ERROR : after evaluating: gl.getBufferSubData(gl.ARRAY_BUFFER, 0, retArray)
    7 [ 4: PASS ] gl.getBufferSubData(gl.ARRAY_BUFFER, 0, new ArrayBuffer(4)) threw exception TypeError: Argument 3 ('dstData') to WebGL2RenderingContext.getBufferSubData must be an instance of ArrayBufferView.
    8 [ 5: PASS ] getError was expected value: NO_ERROR : Should not generate GL error
    9 [ 6: PASS ] gl.getBufferSubData(gl.ARRAY_BUFFER, 0, null) threw exception TypeError: Argument 3 ('dstData') to WebGL2RenderingContext.getBufferSubData must be an instance of ArrayBufferView.
    10 [ 7: PASS ] getError was expected value: NO_ERROR : Should not generate GL error
    11 [ 8: PASS ] The returned array buffer matches original data
    12 [ 9: PASS ] getError was expected value: NO_ERROR : after evaluating: gl.getBufferSubData(gl.ARRAY_BUFFER, 0, retArray, 2)
    13 [ 10: PASS ] areArraysEqual(retArray.slice(0, 2), [0, 0]) is true
    14 [ 11: PASS ] areArraysEqual(retArray.slice(2), floatArray.slice(0, floatArray.length - 2)) is true
    15 [ 12: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : after evaluating: gl.getBufferSubData(gl.ARRAY_BUFFER, 0, retArray, retArray.length)
    16 [ 13: PASS ] areArraysEqual(retArray, [0, 0, 0, 0, 0, 0, 0, 0, 0]) is true
    17 [ 14: FAIL ] getError expected: INVALID_VALUE. Was INVALID_OPERATION : after evaluating: gl.getBufferSubData(gl.ARRAY_BUFFER, 0, retArray, retArray.length + 1)
    18 [ 15: PASS ] getError was expected value: NO_ERROR : after evaluating: gl.getBufferSubData(gl.ARRAY_BUFFER, 0, retArray, 2, 2)
    19 [ 16: PASS ] areArraysEqual(retArray.slice(0, 2), [0, 0]) is true
    20 [ 17: PASS ] areArraysEqual(retArray.slice(2, 4), floatArray.slice(0, 2)) is true
    21 [ 18: PASS ] areArraysEqual(retArray.slice(4), [0, 0, 0, 0, 0]) is true
    22 [ 19: PASS ] getError was expected value: NO_ERROR : after evaluating: gl.getBufferSubData(gl.ARRAY_BUFFER, 0, retArray, retArray.length - 1, 1)
    23 [ 20: PASS ] areArraysEqual(retArray.slice(0, 8), [0, 0, 0, 0, 0, 0, 0, 0]) is true
    24 [ 21: PASS ] areArraysEqual(retArray.slice(8), floatArray.slice(0, 1)) is true
    25 [ 22: FAIL ] getError expected: INVALID_VALUE. Was INVALID_OPERATION : after evaluating: gl.getBufferSubData(gl.ARRAY_BUFFER, 0, retArray, retArray.length - 1, 2)
    26 [ 23: FAIL ] getError expected: INVALID_VALUE. Was INVALID_OPERATION : Extra length should generate INVALID_VALUE.
    27 [ 24: FAIL ] getError expected: INVALID_VALUE. Was INVALID_OPERATION : after evaluating: gl.getBufferSubData(gl.ARRAY_BUFFER, retArray.byteLength + 1, retArray)
    28 [ 25: FAIL ] getError expected: INVALID_VALUE. Was INVALID_OPERATION : after evaluating: gl.getBufferSubData(gl.ARRAY_BUFFER, 1, retArray)
    29 [ 26: PASS ] getError was expected value: INVALID_OPERATION : after evaluating: gl.getBufferSubData(gl.ELEMENT_ARRAY_BUFFER, 0, retArray)
    30 [ 27: FAIL ] getError expected: INVALID_VALUE. Was INVALID_OPERATION : after evaluating: gl.getBufferSubData(gl.ARRAY_BUFFER, -1, retArray)
    31 [ 28: PASS ] getError was expected value: NO_ERROR : after evaluating: gl.getBufferSubData(gl.ARRAY_BUFFER, 0, retArray)
    32 [ 29: PASS ] areArraysEqual(retArray, [0, 0, 0, 0, 0, 0, 0, 0, 0]) is true
    33 [ 30: PASS ] getError was expected value: NO_ERROR : after evaluating: gl.getBufferSubData(gl.ARRAY_BUFFER, 0, retArray)
    34 [ 31: PASS ] areArraysEqual(retArray, floatArray) is true
    35 [ 32: PASS ] getError was expected value: NO_ERROR : after evaluating: gl.getBufferSubData(gl.ARRAY_BUFFER, 0, retArray)
    36 [ 33: PASS ] areArraysEqual(retArray, floatArray) is true
    37 [ 34: PASS ] successfullyParsed is true
    38 [ FAIL ] 7 failures reported
     4[ PASS ] All tests passed
    395
  • trunk/LayoutTests/webgl/2.0.0/conformance2/misc/views-with-offsets-expected.txt

    r264845 r265114  
    22
    33Test: ../../resources/webgl_test_files/conformance2/misc/views-with-offsets.html
    4 [ 1: PASS ] getError was expected value: NO_ERROR :
    5 [ 2: PASS ] getError was expected value: NO_ERROR :
    6 [ 3: PASS ] Should be [0, 1, 1, 2], was [0, 1, 1, 2].
    7 [ 4: PASS ] getError was expected value: NO_ERROR :
    8 [ 5: PASS ] getError was expected value: NO_ERROR :
    9 [ 6: PASS ] Should be [1, 1, 2, 3], was [1, 1, 2, 3].
    10 [ 7: PASS ] getError was expected value: NO_ERROR :
    11 [ 8: PASS ] getError was expected value: NO_ERROR :
    12 [ 9: PASS ] Should be [1, 2, 3, 5], was [1, 2, 3, 5].
    13 [ 10: PASS ] getError was expected value: NO_ERROR :
    14 [ 11: PASS ] getError was expected value: NO_ERROR :
    15 [ 12: PASS ] Should be [2, 3, 5, 8], was [2, 3, 5, 8].
    16 [ 13: PASS ] getError was expected value: NO_ERROR :
    17 [ 14: PASS ] getError was expected value: NO_ERROR :
    18 [ 15: PASS ] Should be [3, 5, 8, 13], was [3, 5, 8, 13].
    19 [ 16: PASS ] getError was expected value: NO_ERROR :
    20 [ 17: PASS ] getError was expected value: NO_ERROR :
    21 [ 18: PASS ] Should be [5, 8, 13, 21], was [5, 8, 13, 21].
    22 [ 19: PASS ] getError was expected value: NO_ERROR :
    23 [ 20: PASS ] getError was expected value: NO_ERROR :
    24 [ 21: PASS ] Should be [8, 13, 21, 34], was [8, 13, 21, 34].
    25 [ 22: PASS ] getError was expected value: NO_ERROR :
    26 [ 23: PASS ] getError was expected value: NO_ERROR :
    27 [ 24: PASS ] Should be [13, 21, 34, 55], was [13, 21, 34, 55].
    28 [ 25: PASS ] getError was expected value: NO_ERROR :
    29 [ 26: PASS ] getError was expected value: NO_ERROR :
    30 [ 27: PASS ] Should be [21, 34, 55, 89], was [21, 34, 55, 89].
    31 [ 28: PASS ] getError was expected value: NO_ERROR :
    32 [ 29: PASS ] getError was expected value: NO_ERROR :
    33 [ 30: PASS ] Should be [34, 55, 89, 144], was [34, 55, 89, 144].
    34 [ 31: PASS ] getError was expected value: NO_ERROR :
    35 [ 32: PASS ] getError was expected value: NO_ERROR :
    36 [ 33: PASS ] Should be [55, 89, 144, 233], was [55, 89, 144, 233].
    37 [ 34: PASS ] getError was expected value: INVALID_OPERATION :
    38 [ 35: PASS ] getError was expected value: INVALID_OPERATION :
    39 [ 36: PASS ] getError was expected value: INVALID_OPERATION :
    40 [ 37: PASS ] getError was expected value: INVALID_OPERATION :
    41 [ 38: PASS ] getError was expected value: INVALID_OPERATION :
    42 [ 39: PASS ] getError was expected value: NO_ERROR :
    43 [ 40: PASS ] getError was expected value: NO_ERROR :
    44 [ 41: PASS ] Should be 65504, was 65504.
    45 [ 42: PASS ] getError was expected value: NO_ERROR :
    46 [ 43: PASS ] getError was expected value: NO_ERROR :
    47 [ 44: PASS ] Should be 2047, was 2047.
    48 [ 45: PASS ] getError was expected value: INVALID_OPERATION :
    49 [ 46: PASS ] getError was expected value: INVALID_OPERATION :
    50 [ 47: PASS ] getError was expected value: NO_ERROR :
    51 [ 48: PASS ] getError was expected value: NO_ERROR :
    52 [ 49: PASS ] Should be [0, 1, 1, 2], was [0, 1, 1, 2].
    53 [ 50: PASS ] getError was expected value: NO_ERROR :
    54 [ 51: PASS ] getError was expected value: NO_ERROR :
    55 [ 52: PASS ] Should be [1, 1, 2, 3], was [1, 1, 2, 3].
    56 [ 53: PASS ] getError was expected value: NO_ERROR :
    57 [ 54: PASS ] getError was expected value: NO_ERROR :
    58 [ 55: PASS ] Should be [1, 2, 3, 5], was [1, 2, 3, 5].
    59 [ 56: PASS ] getError was expected value: NO_ERROR :
    60 [ 57: PASS ] getError was expected value: NO_ERROR :
    61 [ 58: PASS ] Should be [2, 3, 5, 8], was [2, 3, 5, 8].
    62 [ 59: PASS ] getError was expected value: NO_ERROR :
    63 [ 60: PASS ] getError was expected value: NO_ERROR :
    64 [ 61: PASS ] Should be [3, 5, 8, 13], was [3, 5, 8, 13].
    65 [ 62: PASS ] getError was expected value: NO_ERROR :
    66 [ 63: PASS ] getError was expected value: NO_ERROR :
    67 [ 64: PASS ] Should be [5, 8, 13, 21], was [5, 8, 13, 21].
    68 [ 65: PASS ] getError was expected value: NO_ERROR :
    69 [ 66: PASS ] getError was expected value: NO_ERROR :
    70 [ 67: PASS ] Should be [8, 13, 21, 34], was [8, 13, 21, 34].
    71 [ 68: PASS ] getError was expected value: NO_ERROR :
    72 [ 69: PASS ] getError was expected value: NO_ERROR :
    73 [ 70: PASS ] Should be [13, 21, 34, 55], was [13, 21, 34, 55].
    74 [ 71: PASS ] getError was expected value: NO_ERROR :
    75 [ 72: PASS ] getError was expected value: NO_ERROR :
    76 [ 73: PASS ] Should be [21, 34, 55, 89], was [21, 34, 55, 89].
    77 [ 74: PASS ] getError was expected value: NO_ERROR :
    78 [ 75: PASS ] getError was expected value: NO_ERROR :
    79 [ 76: PASS ] Should be [34, 55, 89, 144], was [34, 55, 89, 144].
    80 [ 77: PASS ] getError was expected value: NO_ERROR :
    81 [ 78: PASS ] getError was expected value: NO_ERROR :
    82 [ 79: PASS ] Should be [55, 89, 144, 233], was [55, 89, 144, 233].
    83 [ 80: PASS ] getError was expected value: INVALID_OPERATION :
    84 [ 81: PASS ] getError was expected value: INVALID_OPERATION :
    85 [ 82: PASS ] getError was expected value: INVALID_OPERATION :
    86 [ 83: PASS ] getError was expected value: INVALID_OPERATION :
    87 [ 84: PASS ] getError was expected value: INVALID_OPERATION :
    88 [ 85: PASS ] getError was expected value: NO_ERROR :
    89 [ 86: PASS ] getError was expected value: NO_ERROR :
    90 [ 87: PASS ] Should be 65504, was 65504.
    91 [ 88: PASS ] getError was expected value: NO_ERROR :
    92 [ 89: PASS ] getError was expected value: NO_ERROR :
    93 [ 90: PASS ] Should be 2047, was 2047.
    94 [ 91: PASS ] getError was expected value: INVALID_OPERATION :
    95 [ 92: PASS ] getError was expected value: INVALID_OPERATION :
    96 [ 93: PASS ] getError was expected value: NO_ERROR :
    97 [ 94: PASS ] getError was expected value: NO_ERROR :
    98 [ 95: PASS ] Should be [0, 1, 1, 2], was [0, 1, 1, 2].
    99 [ 96: PASS ] getError was expected value: NO_ERROR :
    100 [ 97: PASS ] getError was expected value: NO_ERROR :
    101 [ 98: PASS ] Should be [1, 1, 2, 3], was [1, 1, 2, 3].
    102 [ 99: PASS ] getError was expected value: NO_ERROR :
    103 [ 100: PASS ] getError was expected value: NO_ERROR :
    104 [ 101: PASS ] Should be [1, 2, 3, 5], was [1, 2, 3, 5].
    105 [ 102: PASS ] getError was expected value: NO_ERROR :
    106 [ 103: PASS ] getError was expected value: NO_ERROR :
    107 [ 104: PASS ] Should be [2, 3, 5, 8], was [2, 3, 5, 8].
    108 [ 105: PASS ] getError was expected value: NO_ERROR :
    109 [ 106: PASS ] getError was expected value: NO_ERROR :
    110 [ 107: PASS ] Should be [3, 5, 8, 13], was [3, 5, 8, 13].
    111 [ 108: PASS ] getError was expected value: NO_ERROR :
    112 [ 109: PASS ] getError was expected value: NO_ERROR :
    113 [ 110: PASS ] Should be [5, 8, 13, 21], was [5, 8, 13, 21].
    114 [ 111: PASS ] getError was expected value: NO_ERROR :
    115 [ 112: PASS ] getError was expected value: NO_ERROR :
    116 [ 113: PASS ] Should be [8, 13, 21, 34], was [8, 13, 21, 34].
    117 [ 114: PASS ] getError was expected value: NO_ERROR :
    118 [ 115: PASS ] getError was expected value: NO_ERROR :
    119 [ 116: PASS ] Should be [13, 21, 34, 55], was [13, 21, 34, 55].
    120 [ 117: PASS ] getError was expected value: NO_ERROR :
    121 [ 118: PASS ] getError was expected value: NO_ERROR :
    122 [ 119: PASS ] Should be [21, 34, 55, 89], was [21, 34, 55, 89].
    123 [ 120: PASS ] getError was expected value: NO_ERROR :
    124 [ 121: PASS ] getError was expected value: NO_ERROR :
    125 [ 122: PASS ] Should be [34, 55, 89, 144], was [34, 55, 89, 144].
    126 [ 123: PASS ] getError was expected value: NO_ERROR :
    127 [ 124: PASS ] getError was expected value: NO_ERROR :
    128 [ 125: PASS ] Should be [55, 89, 144, 233], was [55, 89, 144, 233].
    129 [ 126: PASS ] getError was expected value: INVALID_OPERATION :
    130 [ 127: PASS ] getError was expected value: INVALID_OPERATION :
    131 [ 128: PASS ] getError was expected value: INVALID_OPERATION :
    132 [ 129: PASS ] getError was expected value: INVALID_OPERATION :
    133 [ 130: PASS ] getError was expected value: INVALID_OPERATION :
    134 [ 131: PASS ] getError was expected value: NO_ERROR :
    135 [ 132: PASS ] getError was expected value: NO_ERROR :
    136 [ 133: PASS ] Should be 65504, was 65504.
    137 [ 134: PASS ] getError was expected value: NO_ERROR :
    138 [ 135: PASS ] getError was expected value: NO_ERROR :
    139 [ 136: PASS ] Should be 2047, was 2047.
    140 [ 137: PASS ] getError was expected value: INVALID_OPERATION :
    141 [ 138: PASS ] getError was expected value: INVALID_OPERATION :
    142 [ 139: PASS ] getError was expected value: NO_ERROR :
    143 [ 140: PASS ] getError was expected value: NO_ERROR :
    144 [ 141: PASS ] Should be [0, 1, 1, 2], was [0, 1, 1, 2].
    145 [ 142: PASS ] getError was expected value: NO_ERROR :
    146 [ 143: PASS ] getError was expected value: NO_ERROR :
    147 [ 144: PASS ] Should be [1, 1, 2, 3], was [1, 1, 2, 3].
    148 [ 145: PASS ] getError was expected value: NO_ERROR :
    149 [ 146: PASS ] getError was expected value: NO_ERROR :
    150 [ 147: PASS ] Should be [1, 2, 3, 5], was [1, 2, 3, 5].
    151 [ 148: PASS ] getError was expected value: NO_ERROR :
    152 [ 149: PASS ] getError was expected value: NO_ERROR :
    153 [ 150: PASS ] Should be [2, 3, 5, 8], was [2, 3, 5, 8].
    154 [ 151: PASS ] getError was expected value: NO_ERROR :
    155 [ 152: PASS ] getError was expected value: NO_ERROR :
    156 [ 153: PASS ] Should be [3, 5, 8, 13], was [3, 5, 8, 13].
    157 [ 154: PASS ] getError was expected value: NO_ERROR :
    158 [ 155: PASS ] getError was expected value: NO_ERROR :
    159 [ 156: PASS ] Should be [5, 8, 13, 21], was [5, 8, 13, 21].
    160 [ 157: PASS ] getError was expected value: NO_ERROR :
    161 [ 158: PASS ] getError was expected value: NO_ERROR :
    162 [ 159: PASS ] Should be [8, 13, 21, 34], was [8, 13, 21, 34].
    163 [ 160: PASS ] getError was expected value: NO_ERROR :
    164 [ 161: PASS ] getError was expected value: NO_ERROR :
    165 [ 162: PASS ] Should be [13, 21, 34, 55], was [13, 21, 34, 55].
    166 [ 163: PASS ] getError was expected value: NO_ERROR :
    167 [ 164: PASS ] getError was expected value: NO_ERROR :
    168 [ 165: PASS ] Should be [21, 34, 55, 89], was [21, 34, 55, 89].
    169 [ 166: PASS ] getError was expected value: NO_ERROR :
    170 [ 167: PASS ] getError was expected value: NO_ERROR :
    171 [ 168: PASS ] Should be [34, 55, 89, 144], was [34, 55, 89, 144].
    172 [ 169: PASS ] getError was expected value: NO_ERROR :
    173 [ 170: PASS ] getError was expected value: NO_ERROR :
    174 [ 171: PASS ] Should be [55, 89, 144, 233], was [55, 89, 144, 233].
    175 [ 172: PASS ] getError was expected value: INVALID_OPERATION :
    176 [ 173: PASS ] getError was expected value: INVALID_OPERATION :
    177 [ 174: PASS ] getError was expected value: INVALID_OPERATION :
    178 [ 175: PASS ] getError was expected value: INVALID_OPERATION :
    179 [ 176: PASS ] getError was expected value: INVALID_OPERATION :
    180 [ 177: PASS ] getError was expected value: NO_ERROR :
    181 [ 178: PASS ] getError was expected value: NO_ERROR :
    182 [ 179: PASS ] Should be 65504, was 65504.
    183 [ 180: PASS ] getError was expected value: NO_ERROR :
    184 [ 181: PASS ] getError was expected value: NO_ERROR :
    185 [ 182: PASS ] Should be 2047, was 2047.
    186 [ 183: PASS ] getError was expected value: INVALID_OPERATION :
    187 [ 184: PASS ] getError was expected value: INVALID_OPERATION :
    188 [ 185: PASS ] getError was expected value: NO_ERROR :
    189 [ 186: PASS ] getError was expected value: NO_ERROR :
    190 [ 187: PASS ] getError was expected value: INVALID_VALUE :
    191 [ 188: PASS ] getError was expected value: INVALID_VALUE :
    192 [ 189: PASS ] getError was expected value: INVALID_VALUE :
    193 [ 190: PASS ] getError was expected value: INVALID_VALUE :
    194 [ 191: PASS ] getError was expected value: INVALID_VALUE :
    195 [ 192: PASS ] getError was expected value: INVALID_VALUE :
    196 [ 193: PASS ] getError was expected value: INVALID_VALUE :
    197 [ 194: PASS ] getError was expected value: INVALID_VALUE :
    198 [ 195: PASS ] getError was expected value: INVALID_VALUE :
    199 [ 196: PASS ] getError was expected value: NO_ERROR :
    200 [ 197: PASS ] getError was expected value: NO_ERROR :
    201 [ 198: PASS ] getError was expected value: INVALID_VALUE :
    202 [ 199: PASS ] getError was expected value: INVALID_VALUE :
    203 [ 200: PASS ] getError was expected value: INVALID_VALUE :
    204 [ 201: PASS ] getError was expected value: INVALID_VALUE :
    205 [ 202: PASS ] getError was expected value: INVALID_VALUE :
    206 [ 203: PASS ] getError was expected value: INVALID_VALUE :
    207 [ 204: PASS ] getError was expected value: INVALID_VALUE :
    208 [ 205: PASS ] getError was expected value: INVALID_VALUE :
    209 [ 206: PASS ] getError was expected value: INVALID_VALUE :
    210 [ 207: PASS ] getError was expected value: NO_ERROR :
    211 [ 208: PASS ] getError was expected value: NO_ERROR :
    212 [ 209: PASS ] getError was expected value: INVALID_VALUE :
    213 [ 210: PASS ] getError was expected value: INVALID_VALUE :
    214 [ 211: PASS ] getError was expected value: INVALID_VALUE :
    215 [ 212: PASS ] getError was expected value: INVALID_VALUE :
    216 [ 213: PASS ] getError was expected value: INVALID_VALUE :
    217 [ 214: PASS ] getError was expected value: INVALID_VALUE :
    218 [ 215: PASS ] getError was expected value: INVALID_VALUE :
    219 [ 216: PASS ] getError was expected value: INVALID_VALUE :
    220 [ 217: PASS ] getError was expected value: INVALID_VALUE :
    221 [ 218: PASS ] getError was expected value: NO_ERROR :
    222 [ 219: PASS ] getError was expected value: NO_ERROR :
    223 [ 220: PASS ] getError was expected value: INVALID_VALUE :
    224 [ 221: PASS ] getError was expected value: INVALID_VALUE :
    225 [ 222: PASS ] getError was expected value: INVALID_VALUE :
    226 [ 223: PASS ] getError was expected value: INVALID_VALUE :
    227 [ 224: PASS ] getError was expected value: INVALID_VALUE :
    228 [ 225: PASS ] getError was expected value: INVALID_VALUE :
    229 [ 226: PASS ] getError was expected value: INVALID_VALUE :
    230 [ 227: PASS ] getError was expected value: INVALID_VALUE :
    231 [ 228: PASS ] getError was expected value: INVALID_VALUE :
    232 [ 229: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION :
    233 [ 230: FAIL ] Should be [10, 20, 30, 40], was [0, 0, 0, 0].
    234 [ 231: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION :
    235 [ 232: FAIL ] Should be [10, 20, 30, 40], was [0, 0, 0, 0].
    236 [ 233: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION :
    237 [ 234: FAIL ] Should be [10, 20, 30, 40], was [0, 0, 0, 0].
    238 [ 235: PASS ] getError was expected value: INVALID_OPERATION :
    239 [ 236: PASS ] getError was expected value: INVALID_OPERATION :
    240 [ 237: PASS ] getError was expected value: INVALID_OPERATION :
    241 [ 238: PASS ] getError was expected value: INVALID_OPERATION :
    242 [ 239: PASS ] getError was expected value: INVALID_VALUE :
    243 [ 240: PASS ] successfullyParsed is true
    244 [ FAIL ] 6 failures reported
     4[ PASS ] All tests passed
    2455
  • trunk/Source/WebCore/ChangeLog

    r265095 r265114  
     12020-07-30  James Darpinian  <jdarpinian@chromium.org>
     2
     3        [WebGL2] Buffer updates
     4        https://bugs.webkit.org/show_bug.cgi?id=209511
     5
     6        Reviewed by Dean Jackson.
     7
     8        Various fixes in bufferData, bufferSubData, and getBufferSubData. Passes all WebGL conformance tests in conformance/buffers/* and conformance2/buffers/*.
     9
     10        * html/canvas/WebGL2RenderingContext.cpp:
     11        (WebCore::WebGL2RenderingContext::sliceArrayBufferView):
     12        (WebCore::WebGL2RenderingContext::getBufferSubData):
     13        * html/canvas/WebGLRenderingContextBase.cpp:
     14        (WebCore::WebGLRenderingContextBase::bufferData):
     15        (WebCore::WebGLRenderingContextBase::bufferSubData):
     16        * html/canvas/WebGLRenderingContextBase.h:
     17        * html/canvas/WebGLRenderingContextBase.idl:
     18
    1192020-07-30  Jer Noble  <jer.noble@apple.com>
    220
  • trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp

    r264889 r265114  
    508508    Checked<GCGLuint, RecordOverflow> checkedByteLength = checkedLength * checkedElementSize;
    509509
    510     if (checkedByteSrcOffset.hasOverflowed()
     510    if (checkedLength.hasOverflowed() || checkedByteSrcOffset.hasOverflowed()
    511511        || checkedByteLength.hasOverflowed()
    512512        || checkedByteSrcOffset.unsafeGet() > data.byteLength()
     
    516516    }
    517517
    518     return arrayBufferViewSliceFactory(functionName, data, data.byteOffset() + checkedByteSrcOffset.unsafeGet(), length);
     518    return arrayBufferViewSliceFactory(functionName, data, data.byteOffset() + checkedByteSrcOffset.unsafeGet(), checkedLength.unsafeGet());
    519519}
    520520
     
    621621    if (isContextLostOrPending())
    622622        return;
    623     RefPtr<WebGLBuffer> buffer = validateBufferDataParameters("bufferSubData", target, GraphicsContextGL::STATIC_DRAW);
     623    RefPtr<WebGLBuffer> buffer = validateBufferDataParameters("getBufferSubData", target, GraphicsContextGL::STATIC_DRAW);
    624624    if (!buffer) {
    625625        synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "getBufferSubData", "No WebGLBuffer is bound to target");
     
    643643
    644644    if (dstOffset > dstDataLength) {
    645         synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "getBufferSubData", "dstOffset is larger than the length of the destination buffer.");
     645        synthesizeGLError(GraphicsContextGL::INVALID_VALUE, "getBufferSubData", "dstOffset is larger than the length of the destination buffer.");
    646646        return;
    647647    }
     
    653653    auto checkedDestinationEnd = checkedDstOffset + checkedCopyLength;
    654654    if (checkedDestinationEnd.hasOverflowed()) {
    655         synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "getBufferSubData", "dstOffset + copyLength is too high");
     655        synthesizeGLError(GraphicsContextGL::INVALID_VALUE, "getBufferSubData", "dstOffset + copyLength is too high");
    656656        return;
    657657    }
    658658
    659659    if (checkedDestinationEnd.unsafeGet() > dstDataLength) {
    660         synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "getBufferSubData", "end of written destination is past the end of the buffer");
     660        synthesizeGLError(GraphicsContextGL::INVALID_VALUE, "getBufferSubData", "end of written destination is past the end of the buffer");
    661661        return;
    662662    }
    663663
    664664    if (srcByteOffset < 0) {
    665         synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "getBufferSubData", "srcByteOffset is less than 0");
     665        synthesizeGLError(GraphicsContextGL::INVALID_VALUE, "getBufferSubData", "srcByteOffset is less than 0");
    666666        return;
    667667    }
     
    672672    auto checkedSourceEnd = checkedSrcByteOffset + checkedCopyLengthPtr * checkedElementSize;
    673673    if (checkedSourceEnd.hasOverflowed() || checkedSourceEnd.unsafeGet() > buffer->byteLength()) {
    674         synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "getBufferSubData", "Parameters would read outside the bounds of the source buffer");
    675         return;
    676     }
     674        synthesizeGLError(GraphicsContextGL::INVALID_VALUE, "getBufferSubData", "Parameters would read outside the bounds of the source buffer");
     675        return;
     676    }
     677   
     678    if (!copyLength)
     679        return;
    677680
    678681    m_context->moveErrorsToSyntheticErrorList();
  • trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp

    r264931 r265114  
    15541554        return;
    15551555    }
    1556     if (!size) {
    1557         synthesizeGLError(GraphicsContextGL::INVALID_VALUE, "bufferData", "size == 0");
    1558         return;
    1559     }
    15601556    if (!buffer->associateBufferData(static_cast<GCGLsizeiptr>(size))) {
    15611557        synthesizeGLError(GraphicsContextGL::INVALID_VALUE, "bufferData", "invalid buffer");
     
    15981594}
    15991595
    1600 void WebGLRenderingContextBase::bufferSubData(GCGLenum target, long long offset, Optional<BufferDataSource>&& data)
     1596void WebGLRenderingContextBase::bufferSubData(GCGLenum target, long long offset, BufferDataSource&& data)
    16011597{
    16021598    if (isContextLostOrPending())
     
    16091605        return;
    16101606    }
    1611     if (!data)
    1612         return;
    16131607
    16141608    WTF::visit([&](auto& data) {
     
    16241618            buffer->disassociateBufferData();
    16251619        }
    1626     }, data.value());
     1620    }, data);
    16271621}
    16281622
  • trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h

    r264889 r265114  
    139139    void bufferData(GCGLenum target, long long size, GCGLenum usage);
    140140    void bufferData(GCGLenum target, Optional<BufferDataSource>&&, GCGLenum usage);
    141     void bufferSubData(GCGLenum target, long long offset, Optional<BufferDataSource>&&);
     141    void bufferSubData(GCGLenum target, long long offset, BufferDataSource&&);
    142142
    143143    GCGLenum checkFramebufferStatus(GCGLenum target);
  • trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.idl

    r261679 r265114  
    496496    void bufferData(GLenum target, BufferDataSource? data, GLenum usage);
    497497    void bufferData(GLenum target, GLsizeiptr size, GLenum usage);
    498     void bufferSubData(GLenum target, GLintptr offset, BufferDataSource? data);
     498    void bufferSubData(GLenum target, GLintptr offset, BufferDataSource data);
    499499
    500500    GLenum checkFramebufferStatus(GLenum target);
Note: See TracChangeset for help on using the changeset viewer.