iPad 2 GPU 的性能远比 iPad 1 更好。当我知道 GPU 可以处理它时,我想切换到我的应用程序并添加一些额外漂亮的图形细节。
因此,我希望能够本质上检测 iPad 1 和 2(及更高版本)之间的区别,最好使用尽可能接近的功能检测。有很多不相关的东西我可以打开(相机的存在等),但理想情况下我想找到一些东西,也许是 OpenGL 功能,可以更直接地区分 GPU。
这个Apple 页面 未列出任何对 iPad 1 与 2 有用的内容,并且 本文讨论基准测试和 GPU 架构差异,但没有指出任何看起来我可以直接查询的内容(例如纹理单元的数量或其他)。
有人对如何做到这一点有任何想法,还是我错过了一些明显的东西?谢谢。
The performance of the iPad 2 GPU is way better than the iPad 1. I'd like to switch in my app and add some extra nice graphical subtlety when I know the GPU can handle it.
So I'd like to be able to detect essentially the distinction between the iPad 1 and 2 (and later), ideally using as close to a capability detection as I can. There are plenty of unrelated things I could switch on (presence of camera, etc), but ideally I'd like to find something, maybe an OpenGL capability, that distinguishes the GPU more directly.
This Apple page doesn't list anything useful for iPad 1 vs 2, and this article talks about benchmarking and GPU arch differences but doesn't pinpoint anything that looks like I can query directly (e.g. number of texture units or whatever).
Anyone have any thoughts on how to do this, or am I missing something obvious? Thanks.
发布评论
评论(2)
您可以查询的一项区别是最大纹理大小。在 iPad 2 和 iPhone 4S 上,最大纹理尺寸为 4096 x 4096,而在所有其他 iOS 设备上为 2048 x 2048。在我看来,一个安全的假设是,未来更强大的 iOS 设备也将具有最大纹理尺寸至少有这么大。
要查询最大纹理大小,请首先创建 OpenGL ES 上下文,然后将其设置为当前上下文并运行以下查询:
在我的 iPhone 4 上,这会在 maxTextureSize 中返回 2048,但在我的 iPad 2 和 iPhone 4S 上,这会返回值 4096。
您还可以测试 iPad 2 支持的一些新扩展是否存在,例如
EXT_shadow_samplers
(更多内容记录在“iOS 新增功能:iOS 5.0”),但这些测试只会在 iOS 5.0 上工作。仍在使用 iOS 4.x 的落后者将无法注册这些功能。One distinction you can query for is maximum texture size. On iPad 2 and iPhone 4S, the maximum texture size is 4096 x 4096, where on all other iOS devices it's 2048 x 2048. It would seem to me to be a safe assumption that future, more powerful iOS devices would also have a maximum texture size at least this large.
To query for the maximum texture size, first create your OpenGL ES context, then set it as the current context and run the following query:
On my iPhone 4, this returns 2048 in maxTextureSize, but on my iPad 2 and iPhone 4S this gives back the value of 4096.
You can also test for the presence of some new extensions that the iPad 2 supports, such as
EXT_shadow_samplers
(more are documented in "What's New in iOS: iOS 5.0"), but those tests will only work on iOS 5.0. Stragglers still on iOS 4.x won't have those capabilities register.如今,随着 GPU 的增多,我根据自己的需求提出了以下方案。
您可以通过指定更完整的版本号来进一步区分特定芯片。例如指定 IMGSGX543 而不仅仅是 IMGSGX5。
Today with more GPU's available, here is what I came up with for my own needs.
You may further differentiate between specific chips by specifying more full version numbers. e.g. specify IMGSGX543 instead of just IMGSGX5.