WebGLRenderingContext: compileShader() メソッド

WebGLRenderingContext.compileShader()WebGL API のメソッドで、 GLSL シェーダーをバイナリーへコンパイルします。これは WebGLProgram で使用することができます。

構文

js
compileShader(shader)

引数

shader

フラグメントまたは頂点の WebGLShader

返値

なし (undefined)。

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

仕様書

Specification
WebGL Specification
# 5.14.9

ブラウザーの互換性

BCD tables only load in the browser

関連情報