简体   繁体   English

在Flash Player 10中检测GPU渲染

[英]Detecting GPU rendering in Flash Player 10

Apparently, in Flash 10, you can use the GPU to calculate shaders, and if the user doesn't have a compatible gpu, it falls back to the cpu. 显然,在Flash 10中,您可以使用GPU来计算着色器,如果用户没有兼容的gpu,则它会回退到cpu。 The problem is that the cpu is very slow to calculate the filters, it would be nice to detect if it can't use the gpu, and use fewer effects. 问题是cpu计算过滤器的速度很慢,检测它是否不能使用gpu并使用较少的效果会很好。 Is it possible to detect using actionscript if it's using gpu rendering? 如果使用gpu渲染,是否可以使用actionscript进行检测?

为什么不测量做某事所花费的时间,如果花了太长时间,则禁用一些效果。

If by shaders you mean things you compile with the pixel bender toolkit, they don't run on the GPU. 如果着色器是指用像素弯曲工具包编译的东西,它们不会在GPU上运行。 See: 看到:

http://www.kaourantin.net/2008/05/adobe-pixel-bender-in-flash-player-10.html http://www.kaourantin.net/2008/05/adobe-pixel-bender-in-flash-player-10.html

要检测GPU加速,您可以读取wmodeGPU stage属性。

As far as I know there is no API for this, I think that's why Adobe recommends limiting its use to 1 SWF per HTML page and discourages its use in banners, etc. since it can be very expensive for CPU / memory. 据我所知,没有这方面的API,我认为这就是为什么Adobe建议将每个HTML页面的使用限制为1个SWF,并且不鼓励在横幅等中使用它,因为它对于CPU /内存来说可能非常昂贵。

I guess a graceful workaround is to let your users choose. 我想一个优雅的解决方法是让用户选择。

Adobe relies on OpenGL in non-windows platforms to use hardware acceleration and there is no such distinction in OpenGL. Adobe在非Windows平台上依赖OpenGL来使用硬件加速,在OpenGL中没有这样的区别。 To maintain consistency accross platforms (which is one of the strengths of Flash) it is desirable behaviour. 为了保持平台的一致性(这是Flash的优势之一),这是理想的行为。

In ActionScript 3 there is the Capabilities class. 在ActionScript 3中有Capabilities类。 Maybe you find there what you're looking for. 也许你找到了你想要的东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM