-
Notifications
You must be signed in to change notification settings - Fork 868
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix patch for getAttachedShaders (uplift to 1.68.x) (#24451)
Uplift of #24446 (squashed) to beta
- Loading branch information
1 parent
862c426
commit 10969b3
Showing
4 changed files
with
44 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>WebGL getAttachedShaders() test</title> | ||
<meta charset="utf-8"> | ||
</head> | ||
<body> | ||
<canvas id="test" width="8" height="8"></canvas> | ||
<script> | ||
const canvas = document.getElementById("test"); | ||
const gl = canvas.getContext("webgl"); | ||
const vsSource = ` | ||
attribute vec4 aVertexPosition; | ||
void main(void) { | ||
gl_Position = aVertexPosition; | ||
} | ||
`; | ||
// Create a vertex shader | ||
const vertexShader = gl.createShader(gl.VERTEX_SHADER); | ||
gl.shaderSource(vertexShader, vsSource); | ||
gl.compileShader(vertexShader); | ||
const shaderProgram = gl.createProgram(); | ||
gl.attachShader(shaderProgram, vertexShader); | ||
// Link the shader program | ||
gl.linkProgram(shaderProgram); | ||
// Get the attached shaders | ||
const attachedShaders = gl.getAttachedShaders(shaderProgram); | ||
document.title = attachedShaders; | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,5 +17,3 @@ | |
</script> | ||
</body> | ||
</html> | ||
|
||
} |