获取gpu

Posted on 2019-11-21 15:28  凡凡0410  阅读(806)  评论(0编辑  收藏  举报
  //获取gpu
  function getGpu(){
    var gpu = "";
    var canvas = document.getElementById("glcanvas");
    var gl = canvas.getContext("experimental-webgl");
    var dbgRenderInfo = gl.getExtension("WEBGL_debug_renderer_info");
    if (dbgRenderInfo != null) {
      gpu = gl.getParameter(dbgRenderInfo.UNMASKED_RENDERER_WEBGL);
    };
    return gpu;

  };
  getGpu();

直接调用就可以;
可以解决在ie下,WebGL 内容用时过长,无法在 GPU 上呈现。正在临时切换到软件呈现 ,获取到的gpu为mircroce...

Copyright © 2024 凡凡0410
Powered by .NET 9.0 on Kubernetes