有没有办法为浏览器的GPU加速编程测试? [英] Is there a way to programmatically test for browser GPU acceleration?

查看:112
本文介绍了有没有办法为浏览器的GPU加速编程测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想包括在网站上我目前正在开发的几个花里胡哨的功能,但我不想陷入瘫痪整个机器为我的用户。有没有一种方法,我可以测试一下,看看如果当前的浏览器GPU加速?

I want to include a few "bells and whistles" features on a site I'm currently developing, but I don't want to bog down the entire machine for my users. Is there a way I can test to see if the current browser is GPU accelerated?

我可以只核对UserAgents,但我一直听说它不够准确信任。

I could just check against UserAgents, but I've always heard it's not accurate enough to trust.

我想我可以建立一个canvas元素,使相当多的绘图电话,和时间呢?在任何一个特定的阈值,我可以考虑我的多余演员不够好?这将是足够好?

I guess I could build a canvas element, make quite a few drawing calls, and time them? Anything under a certain threshold I could consider good enough for my superfluous extras? Would this be good enough?

推荐答案

为何重要如果GPU加速?应该没关系的唯一的事情是性能。

Why does it matter if its GPU accelerated? The only thing that should matter is performance.

所以定时画布元素,即使你可以找出是否有GPU加速与否更好的选择。

So timing the canvas element is the better choice even if you could find out if there is GPU acceleration or not.

这篇关于有没有办法为浏览器的GPU加速编程测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆