Commit 8d87790e authored by qiankun.miao's avatar qiankun.miao Committed by Commit bot

Check EXT_color_buffer_float extension is available

If the extension isn't available, we cannot read from fbo attaching
float texture attachment. This CL adds error message when the extension
is not available.

BUG=369849, 624436

Review-Url: https://codereview.chromium.org/2565703002
Cr-Commit-Position: refs/heads/master@{#437744}
parent 97430eb7
......@@ -144,9 +144,9 @@
canvas.width = 96;
canvas.height = 96;
var gl = canvas.getContext('webgl');
if(!gl)
if (!gl)
return error({name:"WebGL is not available."});
if(!gl.getExtension("OES_texture_float"))
if (!gl.getExtension("OES_texture_float"))
return error({name:"OES_texture_float extension is not available."});
return testVideoToTexture(gl, video, gl.RGBA, gl.RGBA, gl.FLOAT,
readAndVerifyRGBA32F, success, error);
......@@ -158,7 +158,7 @@
canvas.width = 96;
canvas.height = 96;
var gl = canvas.getContext('webgl');
if(!gl)
if (!gl)
return error({name:"WebGL is not available."});
return testVideoToTexture(gl, video, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE,
readAndVerifyRGBA8, success, error);
......@@ -170,9 +170,10 @@
canvas.width = 96;
canvas.height = 96;
var gl = canvas.getContext('webgl2');
if(!gl)
if (!gl)
return error({name:"WebGL2 is not available."});
var color_buffer_float_ext = gl.getExtension('EXT_color_buffer_float');
if (!gl.getExtension('EXT_color_buffer_float'))
return error({name:"EXT_color_buffer_float extension is not available."});
return testVideoToTexture(gl, video, gl.R32F, gl.RED, gl.FLOAT,
readAndVerifyR32F, success, error);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment