WEBGL_debug_renderer_info
扩展属于
WebGL API
and exposes two constants with information about the graphics driver for debugging purposes.
Depending on the privacy settings of the browser, this extension might only be available to privileged contexts. Generally, the graphics driver information should only be used in edge cases to optimize your WebGL content or to debug GPU problems. The
WebGLRenderingContext.getParameter()
method can help you to detect which features are supported and the
failIfMajorPerformanceCaveat
context attribute lets you control if a context should be returned at all, if the performance would be dramatically slow.
WebGL extensions are available using the
WebGLRenderingContext.getExtension()
method. For more information, see also
使用扩展
在
WebGL 教程
.
可用性:
Depending on the privacy settings of the browser, this extension might only be available to privileged contexts or not work at all. In Firefox, if
privacy.resistFingerprinting
被设为
true
, this extensions is disabled.
This extension is available to both, WebGL1 and WebGL2 上下文。
Vendor string of the graphics driver.
Renderer string of the graphics driver.
With the help of this extension, privileged contexts are able to retrieve debugging information about about the user's graphic driver:
var canvas = document.getElementById('canvas');
var gl = canvas.getContext('webgl');
var debugInfo = gl.getExtension('WEBGL_debug_renderer_info');
var vendor = gl.getParameter(debugInfo.UNMASKED_VENDOR_WEBGL);
var renderer = gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL);
console.log(vendor);
console.log(renderer);
| 规范 | 状态 | 注释 |
|---|---|---|
|
WEBGL_debug_renderer_info
The definition of 'WEBGL_debug_renderer_info' in that specification. |
推荐 | 初始定义。 |
The compatibility table in 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.
更新 GitHub 上的兼容性数据| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
WEBGL_debug_renderer_info
|
Chrome 33 | Edge ≤18 |
Firefox
53
|
IE No | Opera Yes | Safari Yes | WebView Android 37 | Chrome Android 33 | Firefox Android ? | Opera Android ? | Safari iOS ? | Samsung Internet Android 2.0 |
完整支持
不支持
兼容性未知
用户必须明确启用此特征。
WEBGL_debug_renderer_info
ANGLE_instanced_arrays
EXT_blend_minmax
EXT_color_buffer_half_float
EXT_disjoint_timer_query
EXT_frag_depth
EXT_sRGB
EXT_shader_texture_lod
EXT_texture_filter_anisotropic
OES_element_index_uint
OES_standard_derivatives
OES_texture_float
OES_texture_float_linear
OES_texture_half_float
OES_texture_half_float_linear
OES_vertex_array_object
WEBGL_color_buffer_float
WEBGL_compressed_texture_atc
WEBGL_compressed_texture_etc1
WEBGL_compressed_texture_pvrtc
WEBGL_compressed_texture_s3tc
WEBGL_compressed_texture_s3tc_srgb
WEBGL_debug_shaders
WEBGL_depth_texture
WEBGL_draw_buffers
WEBGL_lose_context
WebGL2RenderingContext
WebGLActiveInfo
WebGLBuffer
WebGLContextEvent
WebGLFramebuffer
WebGLObject
WebGLProgram
WebGLQuery
WebGLRenderbuffer
WebGLRenderingContext
WebGLSampler
WebGLShader
WebGLShaderPrecisionFormat
WebGLSync
WebGLTexture
WebGLTransformFeedback
WebGLUniformLocation
WebGLVertexArrayObject