[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Public WebGL] WEBGL_video_texture shader error on Chrome Canary



Hi all,

I watched SIGGRAPH 2019 khronos BOF yesterday and I want to experiment WEBGL_video_texture extension because Chromium build supports now.

I tried on Chrome Canary, but it doesn't seem to accept "#extension GL_WEBGL_video_texture : require" in shader even though it returns non-null from gl.getExtension('WEBGL_video_texture').

Is it intentional and Canary doesn't expose WEBGL_video_texture extension yet to users? Or am I missing something?

I already reported to Chromium bugs https://bugs.chromium.org/p/chromium/issues/detail?id=776222#c32 but no response yet.

I decided to post here too because I think not only I but also other people may be interested in WEBGL_video_texture from yesterday's BOF and want to test. And I hope someone here knows about the solution or status.

Environment:

WIndows 10
Chrome Canary (78.0.3871.0 (Official Build) canary (64-bit))
WebGL Draft Extensions is enabled via chrome://flags

Sample code:

const shaderSource = `
#extension GL_WEBGL_video_texture : require
precision mediump float;
varying vec2 v_texCoord;

uniform samplerVideoWEBGL uSampler;

void main(void) {
gl_FragColor = texture2D(uSampler, v_texCoord);
}
`;

const canvas = document.createElement('canvas');
const gl = canvas.getContext('webgl');
const extension = gl.getExtension('WEBGL_video_texture');

console.log(extension);

const shader = gl.createShader(gl.FRAGMENT_SHADER);
gl.shaderSource(shader, shaderSource);
gl.compileShader(shader);
const success = gl.getShaderParameter(shader, gl.COMPILE_STATUS);
if (!success) {
  console.error('Compile error:' + gl.getShaderInfoLog(shader));
}

// result
-> WebGLVideoTexture {} // gl.getExtension('WEBGL_video_texture') returns non-null
-> Compile error:ERROR: 0:2: 'GL_WEBGL_video_texture' : extension is not supported
ERROR: 0:6: 'uSampler' : syntax error

Thanks

Takahiro