check.jcarr.wit.com/detect_gpu.html

73 lines
1.6 KiB
HTML

<HTML>
<HEAD><TITLE> Banner</TITLE>
</HEAD>
<body >
<script LANGUAGE= "javascript">
/*
// this code doesn't seem to be correct
if (window.WebGLRenderingContext) {
alert('Your browser does not support WebGL');
}
*/
var canvas = document.createElement('canvas');
var gl;
var debugInfo;
var vendor;
var renderer;
document.write("<br>Trying to create a webgl object<br>");
try {
gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
} catch (e) {
}
if (gl) {
debugInfo = gl.getExtension('WEBGL_debug_renderer_info');
vendor = gl.getParameter(debugInfo.UNMASKED_VENDOR_WEBGL);
renderer = gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL);
document.write(debugInfo + "<br><br>");
document.write(vendor + "<br><br>");
document.write(renderer + "<br><br>");
} else {
document.write("<br>Failed gl=NULL<br>");
}
// Sample output:
//
// » console.log(renderer);
// ATI Technologies Inc. AMD Radeon R9 M370X OpenGL Engine
</script>
<h2>All objects in canvas.getContext('webgl')</h2>
<table>
<script language="JavaScript" type="text/javascript">
for (var n in gl) {
document.write("<tr>");
document.write("<th align='left'>webgl." + n + "<\/th>");
document.write("<th align='left'>" + gl[n] + "<\/th>");
document.write("<\/tr>");
}
</script>
</table>
<h2>All objects in gl.getExtension('WEBGL_debug_renderer_info')</h2>
<table>
<script language="JavaScript" type="text/javascript">
for (var n in debugInfo) {
document.write("<tr>");
document.write("<th align='left'>debugInfo." + n + "<\/th>");
document.write("<th align='left'>" + gl[n] + "<\/th>");
document.write("<\/tr>");
}
</script>
</table>
</body></HTML>