blob: 957ba7db1bd3ad7bce72d1888a68396ba71cd7d6 [file] [log] [blame]
<canvas width="1" height="1"></canvas>
<p></p>
<script>
if (window.testRunner) {
window.testRunner.dumpAsText();
}
const canvas = document.querySelector("canvas");
const gl = canvas.getContext("webgl");
const texture = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, texture);
const data = new Uint16Array(4);
const halfFloat = gl.getExtension("OES_texture_half_float");
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, halfFloat.HALF_FLOAT_OES, data);
const p = document.querySelector("p");
if (gl.getError() != gl.NO_ERROR) {
p.textContent = "Saw an error";
} else {
p.textContent = "No error";
}
</script>