WebGLRenderingContext.compileShader()

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

La méthode WebGLRenderingContext.compileShader() de l'API WebGL compile un shader GLSL en données binaires, de sorte qu'il puisse être utilisé par un WebGLProgram.

Syntaxe

js
void gl.compileShader(shader);

Paramètres

shader

Un WebGLShader de fragments ou de sommets.

Exemples

js
var shader = gl.createShader(gl.VERTEX_SHADER);
gl.shaderSource(shader, sourceShader);
gl.compileShader(shader);

Spécifications

Specification
WebGL Specification
# 5.14.9

Compatibilité des navigateurs

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
compileShader

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

Voir aussi