WebGLRenderingContext:deleteShader() 方法
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.
WebGL API 的 WebGLRenderingContext.deleteShader()
方法用于将给定的 WebGLShader
对象标记为删除状态。当着色器不再使用时,它将被删除。如果着色器已经被删除,则此方法不会产生任何效果,当着色器被垃圾回收器销毁时,WebGLShader
会被自动标记为删除状态。
语法
js
deleteShader(shader)
参数
shader
-
需要被删除的
WebGLShader
对象。
返回值
无(undefined
)。
示例
删除一个着色器
js
gl.deleteShader(shader);
规范
Specification |
---|
WebGL Specification # 5.14.9 |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
deleteShader |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.