diff --git a/graphic/webGL/src/main/js/default/test/WebGL.test01.js b/graphic/webGL/src/main/js/default/test/WebGL.test01.js index c789ca97ef23f69bf70da096fc7c4ccf9077c184..7918fc12f457444faca71585d46513630bf810e8 100644 --- a/graphic/webGL/src/main/js/default/test/WebGL.test01.js +++ b/graphic/webGL/src/main/js/default/test/WebGL.test01.js @@ -1998,11 +1998,7 @@ describe('webgl1Test_webgl2', function() { const indexBuffer = gl.createBuffer(); gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer); - gl.bufferData( - gl.ELEMENT_ARRAY_BUFFER, - indices, - gl.STATIC_DRAW - ); + gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices.buffer, gl.STATIC_DRAW); var maxViewPortDimsParameter = gl.getParameter(gl.MAX_VIEWPORT_DIMS); console.log('maxViewPortDimsParameter: ' + maxViewPortDimsParameter); diff --git a/graphic/webGL/src/main/js/default/test/WebGL.test02.js b/graphic/webGL/src/main/js/default/test/WebGL.test02.js index e7a133fa2b296f79b4411873c65f8d37ed0b3937..970ddbef69e42d4a60afaed50fcee16a5ddfcc2a 100644 --- a/graphic/webGL/src/main/js/default/test/WebGL.test02.js +++ b/graphic/webGL/src/main/js/default/test/WebGL.test02.js @@ -2441,6 +2441,9 @@ describe('webgl1Test_webgl3', function() { it('webgl_test_drawElementsInstanced', 0, async function(done) { //initContext(); 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); @@ -2462,6 +2465,9 @@ describe('webgl1Test_webgl3', function() { it('webgl_test_drawRangeElements', 0, async function(done) { //initContext(); 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); diff --git a/graphic/webGL/src/main/js/default/test/WebGL.test05.js b/graphic/webGL/src/main/js/default/test/WebGL.test05.js index af2608323879278c2b8a288d07347f9eae901fbd..28db6a9f522b7d00d0986e70cb43d0fae1607d3e 100644 --- a/graphic/webGL/src/main/js/default/test/WebGL.test05.js +++ b/graphic/webGL/src/main/js/default/test/WebGL.test05.js @@ -1241,7 +1241,7 @@ describe('webgl1Test_webgl6', function() { gl.uniform4iv(uniformlocationObj, int32list); const uniform4ivError = gl.getError(); console.info("testUniform4ivError: " + uniform4ivError); - expect(uniform4ivError).assertEqual(gl.INVALID_OPERATION); + expect(uniform4ivError).assertEqual(gl.NO_ERROR); done(); }) @@ -1331,7 +1331,7 @@ describe('webgl1Test_webgl6', function() { gl.uniformMatrix2fv(uniformlocationObj, true, flaot32list); const uniformMatrix2fvError = gl.getError(); 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;) {} done(); })