简体   繁体   English

在iPad上未创建OpenGl ES 3.0上下文(在Simulator中可以运行)

[英]OpenGl ES 3.0 Context not created on iPad (works in Simulator)

I'm working on a cross platform renderer for PC (Windows, Linux, Mac) and iOS. 我正在为PC(Windows,Linux,Mac)和iOS开发跨平台渲染器。 The iOS part is currently built around OpenGL ES 2.0 and I wanted to upgrade to ES 3.0. iOS部分当前围绕OpenGL ES 2.0构建,我想升级到ES 3.0。 So I replaced the following line (that works) 所以我替换了以下行(有效)

context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];

with this line: 用这一行:

context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3];

... and I included OpenGLES/ES3/gl.h and OpenGLES/ES3/glext.h. ...,我包括OpenGLES / ES3 / gl.h和OpenGLES / ES3 / glext.h。

In the simulator this works perfectly fine but running on the actual iPad it doesn't work anymore and the context is nil. 在模拟器中,它可以很好地运行,但是在实际的iPad上运行时,它不再起作用,上下文为零。

I really don't know what I'm missing here since the iPad is running the newest version of iOS (iOS 8.3) and shouldn't have problems with ES 3.0. 我真的不知道我在这里缺少什么,因为iPad正在运行最新版本的iOS(iOS 8.3),并且ES 3.0应该没有问题。 I don't get any errors and I can't really debug it (“Step into” doesn't seem to work here). 我没有收到任何错误,也无法真正调试它(“进入”似乎在这里不起作用)。

The features that OpenGL ES 3 adds over OpenGL ES 2 are hardware dependent, so you can create an ES3 context only on hardware that supports it. OpenGL ES 3在OpenGL ES 2之上添加的功能取决于硬件,因此您只能在支持它的硬件上创建ES3上下文。 If you get back nil when creating a context, you need to fall back to rendering with OpenGL ES 2. 如果在创建上下文时返回nil ,则需要使用OpenGL ES 2进行渲染。

The iOS hardware that supports ES3 is anything with an A7 or better GPU. 支持ES3的iOS硬件可以是具有A7或更好GPU的任何硬件。 That's iPad Air, iPad Air 2, iPad mini 2 & 3, iPhone 5s, 6, & 6 plus... and presumably anything that comes later. 这就是iPad Air,iPad Air 2,iPad mini 2和3,iPhone 5s,6和6 plus ...以及以后可能出现的任何东西。

Note that the GPU requirement for ES3 is the same as that for Metal, so if you're going to do multiple renderers with a fallback path anyway you might want to just go all-out to get the best possible performance for those devices. 请注意,ES3的GPU要求与Metal的要求相同,因此,无论如何,如果要使用后备路径进行多个渲染器,则可能要全力以赴,以使这些设备获得最佳性能。

Note also that many of the features that are part of the core OpenGL ES specification in ES3 are still available in iOS as extensions under ES2. 还要注意,ES3中作为OpenGL ES核心规范一部分的许多功能仍在iOS中作为ES2下的扩展提供。 So you can stick to ES2 and support all devices if you're just looking for, say, instancing. 因此,如果您只是想实例化,则可以坚持使用ES2并支持所有设备。

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

相关问题 iPad Opengl ES程序可以在模拟器上正常运行,但不能在设备上运行 - iPad Opengl ES program works fine on simulator but not device Opengl ES应用程序可在模拟器中运行,但不能在手机上运行 - Opengl ES Application works in simulator, but not on phone 渲染到iOS上的纹理OpenGL ES可以在模拟器上运行,但不能在设备上运行 - Rendering to texture on iOS OpenGL ES—works on simulator, but not on device 顶点着色器中的纹理查找在iPad设备与iPad模拟器 - OpenGL ES 2.0上的行为有所不同 - Texture lookup in vertex shader behaves differently on iPad device vs iPad simulator - OpenGL ES 2.0 AVExportSession可在Simulator,iPad 2而非iPad 4上运行 - AVExportSession works on Simulator, iPad 2 but not iPad 4 在iPad Simulator上可用,但在iPad上崩溃 - Works on iPad Simulator but crashes on iPad 应用程式可在模拟器上运作,但不适用于iPad - App works on simulator but not on iPad NSDateFormatter stringFromDate在模拟器中无法在iPad上使用 - NSDateFormatter stringFromDate works in simulator not on iPad MutliTouch可在iPad Simulator上运行,但不能在设备上运行 - MutliTouch Works on iPad Simulator, but not devices JayData / Phonegap可在iPad Simulator中使用,但不适用于iPad设备 - JayData / Phonegap works in iPad Simulator but not iPad device
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM