Implement the basic WebGL2 buffer data operations

Adds support for `bufferData`, `bufferSubData`, `copyBufferSubData`
and `getBufferSubData`.

Reference: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.3
This commit is contained in:
Mátyás Mustoha 2019-10-17 11:34:06 +02:00
parent f626355b67
commit 4050b7f9ec
13 changed files with 510 additions and 197 deletions

View file

@ -1,5 +0,0 @@
[buffer-copying-contents.html]
expected: ERROR
[WebGL test #1: successfullyParsed should be true (of type boolean). Was undefined (of type undefined).]
expected: FAIL

View file

@ -1,2 +0,0 @@
[buffer-copying-restrictions.html]
expected: ERROR

View file

@ -1,14 +0,0 @@
[buffer-data-and-buffer-sub-data-sub-source.html]
expected: ERROR
[WebGL test #3: getError expected: INVALID_VALUE. Was NO_ERROR : calling bufferData when srcOffset + length is larger than source size]
expected: FAIL
[WebGL test #4: getError expected: INVALID_VALUE. Was NO_ERROR : calling bufferData when srcOffset + length is larger than source size]
expected: FAIL
[WebGL test #5: getError expected: INVALID_VALUE. Was NO_ERROR : calling bufferData when srcOffset + length is larger than source size]
expected: FAIL
[WebGL test #7: successfullyParsed should be true (of type boolean). Was undefined (of type undefined).]
expected: FAIL

View file

@ -1,35 +0,0 @@
[get-buffer-sub-data.html]
expected: ERROR
[WebGL test #2: gl.getBufferSubData(gl.ARRAY_BUFFER, 0, retArray) threw exception TypeError: gl.getBufferSubData is not a function]
expected: FAIL
[WebGL test #7: The returned array buffer fails to match original data]
expected: FAIL
[WebGL test #8: gl.getBufferSubData(gl.ARRAY_BUFFER, 0, retArray, 2) threw exception TypeError: gl.getBufferSubData is not a function]
expected: FAIL
[WebGL test #10: areArraysEqual(retArray.slice(2), floatArray.slice(0, floatArray.length - 2)) should be true. Was false.]
expected: FAIL
[WebGL test #11: gl.getBufferSubData(gl.ARRAY_BUFFER, 0, retArray, retArray.length) threw exception TypeError: gl.getBufferSubData is not a function]
expected: FAIL
[WebGL test #13: gl.getBufferSubData(gl.ARRAY_BUFFER, 0, retArray, retArray.length + 1) threw exception TypeError: gl.getBufferSubData is not a function]
expected: FAIL
[WebGL test #14: gl.getBufferSubData(gl.ARRAY_BUFFER, 0, retArray, 2, 2) threw exception TypeError: gl.getBufferSubData is not a function]
expected: FAIL
[WebGL test #16: areArraysEqual(retArray.slice(2, 4), floatArray.slice(0, 2)) should be true. Was false.]
expected: FAIL
[WebGL test #18: gl.getBufferSubData(gl.ARRAY_BUFFER, 0, retArray, retArray.length - 1, 1) threw exception TypeError: gl.getBufferSubData is not a function]
expected: FAIL
[WebGL test #20: areArraysEqual(retArray.slice(8), floatArray.slice(0, 1)) should be true. Was false.]
expected: FAIL
[WebGL test #21: gl.getBufferSubData(gl.ARRAY_BUFFER, 0, retArray, retArray.length - 1, 2) threw exception TypeError: gl.getBufferSubData is not a function]
expected: FAIL