Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #8831 - simartin:ticket_6791, r=eefriedman
Issue #6791: Allow more array types in bufferData and bufferSubData. Fix #6791 <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8831) <!-- Reviewable:end -->
- Loading branch information
Showing
4 changed files
with
55 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<title>bufferData and bufferSubData input array type check (issue #6791)</title> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
test(function() { | ||
var gl = document.createElement("canvas").getContext("webgl"); | ||
var texture_buffer = gl.createBuffer(); | ||
gl.bindBuffer(gl.ARRAY_BUFFER, texture_buffer); | ||
|
||
var coordI8 = new Int8Array([ 1, 0 ]); | ||
gl.bufferData(gl.ARRAY_BUFFER, coordI8, gl.STATIC_DRAW); | ||
gl.bufferSubData(gl.ARRAY_BUFFER, 1, coordI8); | ||
|
||
var coordU8 = new Uint8Array([ 1, 0 ]); | ||
gl.bufferData(gl.ARRAY_BUFFER, coordU8, gl.STATIC_DRAW); | ||
gl.bufferSubData(gl.ARRAY_BUFFER, 1, coordU8); | ||
|
||
var coordI16 = new Int16Array([ 1, 0 ]); | ||
gl.bufferData(gl.ARRAY_BUFFER, coordI16, gl.STATIC_DRAW); | ||
gl.bufferSubData(gl.ARRAY_BUFFER, 1, coordI16); | ||
|
||
var coordU16 = new Uint16Array([ 1, 0 ]); | ||
gl.bufferData(gl.ARRAY_BUFFER, coordU16, gl.STATIC_DRAW); | ||
gl.bufferSubData(gl.ARRAY_BUFFER, 1, coordU16); | ||
|
||
var coordI32 = new Int32Array([ 1, 0 ]); | ||
gl.bufferData(gl.ARRAY_BUFFER, coordI32, gl.STATIC_DRAW); | ||
gl.bufferSubData(gl.ARRAY_BUFFER, 1, coordI32); | ||
|
||
var coordU32 = new Uint32Array([ 1, 0 ]); | ||
gl.bufferData(gl.ARRAY_BUFFER, coordU32, gl.STATIC_DRAW); | ||
gl.bufferSubData(gl.ARRAY_BUFFER, 1, coordU32); | ||
|
||
var coordF32 = new Float32Array([ 1.0, 0.0 ]); | ||
gl.bufferData(gl.ARRAY_BUFFER, coordF32, gl.STATIC_DRAW); | ||
gl.bufferSubData(gl.ARRAY_BUFFER, 1, coordF32); | ||
|
||
var coordF64 = new Float64Array([ 1.0, 0.0 ]); | ||
gl.bufferData(gl.ARRAY_BUFFER, coordF64, gl.STATIC_DRAW); | ||
gl.bufferSubData(gl.ARRAY_BUFFER, 1, coordF64); | ||
}); | ||
</script> |