提交 fc9adcfe 编写于 作者: X xiahaiqin

fix drawElements|drawElementsInstanced|drawRangeElements test

Signed-off-by: Nxiahaiqin <xiahaiqin1@huawei.com>
Change-Id: Ie92c7c5c8c6a7b02a0dc808b0fd156d352173fab
上级 335c9627
......@@ -1997,6 +1997,10 @@ describe('webgl1Test_webgl1', function() {
return;
}
const indexBuffer = gl.createBuffer();
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);
gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices.buffer, gl.STATIC_DRAW);
var maxViewPortDimsParameter = gl.getParameter(gl.MAX_VIEWPORT_DIMS);
console.log('maxViewPortDimsParameter: ' + maxViewPortDimsParameter);
var viewPortParameter = gl.getParameter(gl.VIEWPORT);
......
......@@ -2441,12 +2441,15 @@ describe('webgl1Test_webgl2', 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);
let errorCode = gl.getError();
console.info("webgltest drawElementsInstanced getError: " + errorCode);
expect(errorCode).assertEqual(gl.INVALID_VALUE);
expect(errorCode).assertEqual(gl.NO_ERROR);
//deleteContext();
done();
});
......@@ -2460,12 +2463,15 @@ describe('webgl1Test_webgl2', 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);
let errorCode = gl.getError();
console.info("webgltest drawRangeElements getError: " + errorCode);
expect(errorCode).assertEqual(gl.INVALID_VALUE);
expect(errorCode).assertEqual(gl.NO_ERROR);
//deleteContext();
done();
......
......@@ -388,7 +388,7 @@ describe('webgl1Test_webgl5', function() {
gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new ArrayBuffer(8), gl.STATIC_DRAW);
const bufferDataError = gl.getError();
console.info("bufferDataError: " + bufferDataError);
expect(bufferDataError).assertEqual(gl.INVALID_OPERATION);
expect(bufferDataError).assertEqual(gl.NO_ERROR);
done();
})
......@@ -493,7 +493,7 @@ describe('webgl1Test_webgl5', function() {
gl.bufferSubData(gl.COPY_READ_BUFFER, 512, new ArrayBuffer(8));
const bufferSubDataError = gl.getError();
console.info("bufferSubDataError: " + bufferSubDataError);
expect(bufferSubDataError).assertEqual(gl.INVALID_OPERATION);
expect(bufferSubDataError).assertEqual(gl.NO_ERROR);
done();
})
......@@ -1239,7 +1239,7 @@ describe('webgl1Test_webgl5', 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();
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册