未验证 提交 8bec0cae 编写于 作者: O openharmony_ci 提交者: Gitee

!7418 修复graphic webgl drawElements|drawElementsInstanced|drawRangeElements 用例错误

Merge pull request !7418 from xiahaiqin/master
......@@ -1989,6 +1989,10 @@ export default function webgl1Test_webgl1(){
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);
......
......@@ -2433,12 +2433,15 @@ export default function webgl1Test_webgl2(){
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();
});
......@@ -2452,12 +2455,15 @@ export default function webgl1Test_webgl2(){
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();
......
......@@ -380,7 +380,7 @@ export default function webgl1Test_webgl5() {
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();
})
......@@ -485,7 +485,7 @@ export default function webgl1Test_webgl5() {
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();
})
......@@ -1231,7 +1231,7 @@ export default function webgl1Test_webgl5() {
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.
先完成此消息的编辑!
想要评论请 注册