Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

275
Visualizações
WebGL Hardware Acceleration - failIfMajorPerformanceCaveat no longer working on Chrome

Previously I was able to detect whether or not the browser has Hardware Acceleration enabled, by using the failIfMajorPerformanceCaveat flag.

        const canvas = document.createElement("canvas");
        canvas.setAttribute("width", "1");
        canvas.setAttribute("height", "1");
        const body = document.getElementsByTagName("body")[0];
        body.appendChild(canvas);
        const gl = canvas.getContext("webgl", { failIfMajorPerformanceCaveat: true });
        body.removeChild(canvas);
        return !gl;

However, this flag no longer seems to fail and the canvas context is still created. I'm on the latest version of Chrome (101.0.4951.67) and using Windows. Can anyone help me?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I ran into this recently too. I have a workaround that I'm using, but no real solution:

function isSwiftShaderRenderer() {
    const canvas = document.createElement('canvas');
    const gl = canvas.getContext('webgl');
    const debug_ext = gl.getExtension('WEBGL_debug_renderer_info');
    if (debug_ext) {
        const renderer = gl.getParameter(debug_ext.UNMASKED_RENDERER_WEBGL);
        if (renderer.indexOf('SwiftShader') >= 0) {
            return true;
        }
    }
    return false;
}

console.log(isSwiftShaderRenderer());

Note: this doesn't work on Firefox and failIfMajorPerformanceCaveat doesn't work on Firefox due to webgl.disable-fail-if-major-performance-caveat defaults to true

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda