简体   繁体   English

带有IOS 7的iPhone 5s上的OpenglES 2.0问题

[英]OpenglES 2.0 issue on iphone 5s with IOS 7

I'm writing a piece of software involving OpenGL ES 2.0. 我正在写一个涉及OpenGL ES 2.0的软件。 It's just about presenting photos with some addon special effects using GLSL. 这只是使用GLSL呈现带有一些附加特效的照片。

Everything worked fine and the shaders performed well on iPhone 4, iPhone 4s and iPhone 5 with IOS7. 一切正常,并且着色器在带有IOS7的iPhone 4,iPhone 4s和iPhone 5上运行良好。 But when I tested the software with an iPhone 5S with IOS7 installed, OpenGL only gives me the clear color (able to change with glClearColor) for all the GLSL shaders I wrote. 但是,当我在安装了IOS7的iPhone 5S上测试该软件时,OpenGL仅为我编写的所有GLSL着色器提供了清晰的颜色(可以使用glClearColor进行更改)。 Not able to work on the latest device is certainly not acceptable. 无法在最新设备上工作肯定是不能接受的。

Another abnormal phenomenon on iPhone 5S is that every first call to glDrawElements (I'm using VBO if that matters) after the used opengl program is compiled (a new opengl shader program is compiled each time the user switches the special effect), will block the current thread for about 10 seconds. iPhone 5S上的另一个异常现象是, 在编译使用过的opengl程序 (每次用户切换特殊效果时都会 编译一个新的opengl着色器程序) 之后, glDrawElements的第一次调用 (如果需要的话,我正在使用VBO)当前线程大约10秒钟。

I tried to compile with XCode 5 and 4.6, and both gave the same result (Fine on all devices other than iPhone 5s). 我尝试使用XCode 5和4.6进行编译,并且都给出了相同的结果(在iPhone 5s以外的所有设备上都很好)。

The project work on IOS7 installed on iPhone 5, so the problem shouldn't be the os version or SDK version. 该项目适用于安装在iPhone 5上的IOS7,因此问题不应该是操作系统版本或SDK版本。 I suspect that the new GPU might be the cause, but I have no idea of how to fix it or even test out where in the code is failing. 我怀疑可能是新GPU的原因,但我不知道如何修复它,甚至无法测试代码中的错误之处。 It took me a whole day to only finding out that glDrawElements issue. 我花了整整一天才才发现那个glDrawElements问题。

The code of the software is huge and it's impossible for me to post all it in my question. 该软件的代码巨大,我无法将所有问题都张贴在我的问题中。 I will be grateful if anyone can provide me with some help or just some idea. 如果有人可以为我提供帮助或只是一些想法,我将不胜感激。

To make the question more consice, my OpenGL shaders seems to fail on the latest iPhone GPU. 为了使这个问题更有意义,我的OpenGL着色器似乎在最新的iPhone GPU上失败。 So I'm wondering if: 所以我想知道是否:

  • The latest Apple A7 GPU cut off supports to some OpenGL ES 2.0 features 最新的Apple A7 GPU终止支持某些OpenGL ES 2.0功能
  • There are some limitations on creating vertex buffer objects (vbo) with iPhone 5s 在iPhone 5s上创建顶点缓冲区对象(vbo)有一些限制
  • The use of RenderBuffer, FrameBuffer and TextureBuffer (used to perform multipass shader) have any difference on iPhone 5s 在iPhone 5s上使用RenderBuffer,FrameBuffer和TextureBuffer(用于执行多遍着色器)有什么不同

These are all the suspicious part I can think of now, but I have no idea how to test them, because I'm not getting even one rendered frame by now. 这些都是我现在可以想到的所有可疑部分,但是我不知道如何测试它们,因为到目前为止我什至没有得到一个渲染帧。

The big difference between the iPhone 5 and the 5S is the 64-bit architecture. iPhone 5和5S之间的最大区别是64位体系结构。 I am seeing problems in my app now that deal with passing floats to the shaders. 我现在在我的应用程序中看到一些问题,这些问题涉及将浮点传递到着色器。 In 64-bit mode, when I pass in 0.8 it gets to the shader as -1.58819e-23. 在64位模式下,当我传入0.8时,它以-1.58819e-23的形式到达着色器。 I am about to open a new question regarding the issue, but you might want to check your values at runtime using the OpenGL ES Frame Capture. 我将要就此问题提出一个新问题,但您可能希望使用OpenGL ES Frame Capture在运行时检查您的值。

https://developer.apple.com/library/mac/recipes/xcode_help-debugger/articles/debugging_opengl_es_frame.html https://developer.apple.com/library/mac/recipes/xcode_help-debugger/articles/debugging_opengl_es_frame.html

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

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