Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 923011 of WEBGL_debug_renderer_info

  • Revision slug: Web/API/WEBGL_debug_renderer_info
  • Revision title: WEBGL debug renderer info
  • Revision id: 923011
  • Created:
  • Creator: fscholz
  • Is current revision? No
  • Comment implemented in bug 742781

Revision Content

{{APIRef("WebGL")}}

The WEBGL_debug_renderer_info extension is part of the 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. The {{domxref("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 {{domxref("WebGLRenderingContext.getExtension()")}} method. For more information, see also Using Extensions in the WebGL tutorial.

Constants

UNMASKED_VENDOR_WEBGL
Vendor string of the graphics driver.
UNMASKED_RENDERER_WEBGL
Renderer string of the graphics driver.

Examples

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);

Specifications

Specification Status Comment
{{SpecName('WEBGL_debug_renderer_info', "", "WEBGL_debug_renderer_info")}} {{Spec2('WEBGL_debug_renderer_info')}} Initial definition.

Browser compatibility

{{CompatibilityTable}}
Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support {{CompatUnknown}} {{CompatGeckoDesktop(19)}} [1] {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{CompatUnknown}} {{CompatUnknown}} {{CompatGeckoMobile(19)}} [1] {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}

[1] Only available to privileged contexts (chrome context). See also the preferences webgl.enable-debug-renderer-info and webgl.enable-privileged-extensions in about:config

See also

  • {{domxref("WebGLRenderingContext.getExtension()")}}

Revision Source

<div>{{APIRef("WebGL")}}</div>

<p>The <code><strong>WEBGL_debug_renderer_info</strong></code> extension is part of the <a href="/en-US/docs/Web/API/WebGL_API">WebGL API</a> and exposes two constants with information about the graphics driver for debugging purposes.</p>

<p>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. The {{domxref("WebGLRenderingContext.getParameter()")}} method can help you to detect which features are supported and the <code><a href="/en-US/docs/Web/API/HTMLCanvasElement/getContext">failIfMajorPerformanceCaveat</a></code> context attribute lets you control if a context should be returned at all, if the performance would be dramatically slow.</p>

<p>WebGL extensions are available using the {{domxref("WebGLRenderingContext.getExtension()")}} method. For more information, see also <a href="/en-US/docs/Web/API/WebGL_API/Using_Extensions">Using Extensions</a> in the <a href="/en-US/docs/Web/API/WebGL_API/Tutorial">WebGL tutorial</a>.</p>

<h2 id="Methods">Constants</h2>

<dl>
 <dt>UNMASKED_VENDOR_WEBGL</dt>
 <dd>Vendor string of the graphics driver.</dd>
 <dt>UNMASKED_RENDERER_WEBGL</dt>
 <dd>Renderer string of the graphics driver.</dd>
</dl>

<h2 id="Examples">Examples</h2>

<p>With the help of this extension, privileged contexts are able to retrieve debugging information about about the user's graphic driver:</p>

<pre class="brush: js">
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);
</pre>

<h2 id="Specifications">Specifications</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{SpecName('WEBGL_debug_renderer_info', "", "WEBGL_debug_renderer_info")}}</td>
   <td>{{Spec2('WEBGL_debug_renderer_info')}}</td>
   <td>Initial definition.</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<div>{{CompatibilityTable}}</div>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Chrome</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatGeckoDesktop(19)}} [1]</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android</th>
   <th>Chrome for Android</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE Mobile</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatGeckoMobile(19)}} [1]</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
 </tbody>
</table>
</div>

<p>[1] Only available to privileged contexts (chrome context). See also the preferences <code>webgl.enable-debug-renderer-info</code> and&nbsp;<code>webgl.enable-privileged-extensions</code> in <code>about:config</code></p>

<h2 id="See_also">See also</h2>

<ul>
 <li>{{domxref("WebGLRenderingContext.getExtension()")}}</li>
</ul>
Revert to this revision