简体   繁体   中英

ios - presentRenderbuffer triggers EXC_BAD_ACCESS

I've found that when I use textures above GL_TEXTURE18 on ios (tested on iOS 10), presentRenderbuffer triggers an EXC_BAD_ACCESS . Is there any reason for that? Can I not use textures up to GL_TEXTURE31

The GL_TEXTUREX are just some defined values, defined enumerations. In your case a GPU is the one that defines the actual number of supported textures and it is your responsibility to check what are these limitations.

You can get that by using glGet something like:

GLint max_combined_texture_image_units;
glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &max_combined_texture_image_units);

Try this thread.

Do note that these defines/enumerations are here just to help you, it does not mean they are actually valid or supported. The openGL API is mostly designed by passing integer values typedef uint32_t GLenum; so as far as the API goes you may replace GL_TEXTURE0 with 1200 or any other value but you do need to ensure that the value is actually valid.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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