exokitxr / exokit

Native VR/AR/XR engine for JavaScript 🦖
MIT License
997 stars 118 forks source link

Add WEBGL_debug_renderer_info extension #258

Closed avaer closed 6 years ago

avaer commented 6 years ago

Used by libraries for sniffing GPU performance for scaling XR.

Spec-ish: https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_debug_renderer_info

In Chrome:

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);
VM328:7 Google Inc.
VM328:8 ANGLE (NVIDIA GeForce GTX 1080 Direct3D11 vs_5_0 ps_5_0)
avaer commented 6 years ago

Fixed with https://github.com/webmixedreality/exokit/pull/261