iPad 1与iPad 2 GPU决心的最佳技术? [英] Best technique for iPad 1 vs iPad 2 GPU determination?

查看:149
本文介绍了iPad 1与iPad 2 GPU决心的最佳技术?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

iPad 2 GPU的性能方式比iPad 1更好。当我知道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.

所以我希望能够检测到iPad 1和2(及更高版本)之间的区别,理想情况下使用尽可能接近能力检测。我可以打开很多不相关的东西(相机的存在等),但理想情况下我想找到一些东西,可能是OpenGL功能,可以更直接地区分GPU。

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.

Apple页面未列出对iPad 1 vs 2有用的任何内容,以及这篇文章讨论基准测试和GPU拱差异,但没有找到任何看起来像我可以直接查询的东西(例如纹理单位的数量或其他)。

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.

推荐答案

您可以查询的一个区别是最大纹理大小。在iPad 2和iPhone 4S上,最大纹理尺寸是4096 x 4096,在所有其他iOS设备上它是2048 x 2048.在我看来,安全地假设未来更强大的iOS设备也将具有最大纹理大小至少为这么大。

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.

要查询最大纹理大小,首先创建OpenGL ES上下文,然后将其设置为当前上下文并运行以下查询: / p>

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:

GLint maxTextureSize; 
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize);

在我的iPhone 4上,这在maxTextureSize中返回2048,但在我的iPad 2和iPhone 4S上,这给出了返回值4096。

On my iPhone 4, this returns 2048 in maxTextureSize, but on my iPad 2 and iPhone 4S this gives back the value of 4096.

您还可以测试iPad 2支持的一些新扩展程序的存在,例如 EXT_shadow_samplers (更多内容记录在 iOS中的新功能:iOS 5.0 ),但这些测试仅适用于iOS 5.0。仍然在iOS 4.x上的Stragglers将没有这些功能注册。

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.

这篇关于iPad 1与iPad 2 GPU决心的最佳技术?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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