在Android上使用GL_FIXED还是GL_FLOAT更好
我本以为 GL_FIXED 更快,但 iPhone 文档实际上说使用 GL_FLOAT ,因为 GL_FIXED 必须转换为 GL_FLOAT 。安卓上也一样吗?我想它会因手机而异,但最近流行的手机(Nexus One、Droid/Milestone 等)又如何呢?
加分点:这似乎完全没有记录(例如,在谷歌中搜索GL_FIXED
!),但是GL_FIXED
中的“点”在哪里?即 (GL_FIXED)1
值多少钱?
I would have assumed that GL_FIXED
was faster, but the iPhone docs actually say to use GL_FLOAT
because GL_FIXED
has to be converted to GL_FLOAT
. Is it the same on Android? I suppose it varies by phone, but what about recent popular ones (Nexus One, Droid/Milestone, etc.)?
Bonus points: This appears to be completely undocumented (e.g. search google for GL_FIXED
!) but where is the 'point' in GL_FIXED
? I.e. how much is (GL_FIXED)1
worth?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
就像 Andreas 所说,哪一个更快取决于硬件而不是 gl 标准。一般来说,当使用真正的硬件加速时,您可以预期 GL_FLOAT 可能是更好的选择。如果工作是在对浮点数学支持较差或为零的 CPU 上的软件中完成的,则 GL_FIXED 通常会更快。
GL_FIXED 是 32 位格式,使用 16.16 语义。因此 1 作为 GL_FIXED 值将是 0x10000。
Like Andreas says, which one is faster depends on the hardware rather than on the gl standard. In general, you can expect GL_FLOAT to probably be the better choice when true hardware acceleration is used. GL_FIXED will usually be faster if the work is done in software on a CPU with poor or zero support for floating point math.
GL_FIXED is a 32 bit format, using 16.16 semantics. So 1 as a GL_FIXED value would be 0x10000.
这与 android 无关,这取决于相关手机中的实际 GPU。一般来说,我认为 GL_FLOAT 在现代 GPU 上会更快。
This has nothing to do with android, it will depend on the actual GPU in the telephone in question. Generally I would think that
GL_FLOAT
will be faster on modern GPUs.