提交 af1cd5cc 编写于 作者: X xiahaiqin

fix drawElements|drawElementsInstanced|drawRangeElements test

Signed-off-by: Nxiahaiqin <xiahaiqin1@huawei.com>
Change-Id: I35077498566603a64acc9086eeda713c479bcc38
上级 6de68a83
...@@ -1998,11 +1998,7 @@ describe('webgl1Test_webgl2', function() { ...@@ -1998,11 +1998,7 @@ describe('webgl1Test_webgl2', function() {
const indexBuffer = gl.createBuffer(); const indexBuffer = gl.createBuffer();
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer); gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);
gl.bufferData( gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices.buffer, gl.STATIC_DRAW);
gl.ELEMENT_ARRAY_BUFFER,
indices,
gl.STATIC_DRAW
);
var maxViewPortDimsParameter = gl.getParameter(gl.MAX_VIEWPORT_DIMS); var maxViewPortDimsParameter = gl.getParameter(gl.MAX_VIEWPORT_DIMS);
console.log('maxViewPortDimsParameter: ' + maxViewPortDimsParameter); console.log('maxViewPortDimsParameter: ' + maxViewPortDimsParameter);
......
...@@ -2441,6 +2441,9 @@ describe('webgl1Test_webgl3', function() { ...@@ -2441,6 +2441,9 @@ describe('webgl1Test_webgl3', function() {
it('webgl_test_drawElementsInstanced', 0, async function(done) { it('webgl_test_drawElementsInstanced', 0, async function(done) {
//initContext(); //initContext();
console.info("webgltest into drawElementsInstanced"); console.info("webgltest into drawElementsInstanced");
const indexBuffer = gl.createBuffer();
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);
gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices.buffer, gl.STATIC_DRAW);
const a = gl2.drawElementsInstanced(gl.POINTS, 2, gl.UNSIGNED_SHORT, 0, 4); const a = gl2.drawElementsInstanced(gl.POINTS, 2, gl.UNSIGNED_SHORT, 0, 4);
...@@ -2462,6 +2465,9 @@ describe('webgl1Test_webgl3', function() { ...@@ -2462,6 +2465,9 @@ describe('webgl1Test_webgl3', function() {
it('webgl_test_drawRangeElements', 0, async function(done) { it('webgl_test_drawRangeElements', 0, async function(done) {
//initContext(); //initContext();
console.info("webgltest into drawRangeElements"); console.info("webgltest into drawRangeElements");
const indexBuffer = gl.createBuffer();
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);
gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices.buffer, gl.STATIC_DRAW);
const a = gl2.drawRangeElements(gl.POINTS, 0, 7, 8, gl.UNSIGNED_BYTE, 0); const a = gl2.drawRangeElements(gl.POINTS, 0, 7, 8, gl.UNSIGNED_BYTE, 0);
......
...@@ -1241,7 +1241,7 @@ describe('webgl1Test_webgl6', function() { ...@@ -1241,7 +1241,7 @@ describe('webgl1Test_webgl6', function() {
gl.uniform4iv(uniformlocationObj, int32list); gl.uniform4iv(uniformlocationObj, int32list);
const uniform4ivError = gl.getError(); const uniform4ivError = gl.getError();
console.info("testUniform4ivError: " + uniform4ivError); console.info("testUniform4ivError: " + uniform4ivError);
expect(uniform4ivError).assertEqual(gl.INVALID_OPERATION); expect(uniform4ivError).assertEqual(gl.NO_ERROR);
done(); done();
}) })
...@@ -1331,7 +1331,7 @@ describe('webgl1Test_webgl6', function() { ...@@ -1331,7 +1331,7 @@ describe('webgl1Test_webgl6', function() {
gl.uniformMatrix2fv(uniformlocationObj, true, flaot32list); gl.uniformMatrix2fv(uniformlocationObj, true, flaot32list);
const uniformMatrix2fvError = gl.getError(); const uniformMatrix2fvError = gl.getError();
console.info("uniformMatrix2fvError: " + uniformMatrix2fvError); console.info("uniformMatrix2fvError: " + uniformMatrix2fvError);
expect(uniformMatrix2fvError).assertEqual(gl.NO_ERROR); expect(uniformMatrix2fvError).assertEqual(gl.INVALID_OPERATION);
for(let err; (err = gl.getError()) != gl.NO_ERROR;) {} for(let err; (err = gl.getError()) != gl.NO_ERROR;) {}
done(); done();
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册