0

I'm making the following call on iOS using OpenGL ES 3:

glTexImage2D(GL_TEXTURE_2D,         // target
             0,                     // level
             GL_RGBA,               // internalformat
             1024,                  // width
             692,                   // height
             0,                     // border
             GL_RGBA,               // format
             GL_UNSIGNED_BYTE,      // type
             NULL);                 // data

However, it is returning GL_INVALID_OPERATION. There are a slew of reasons that GL_INVALID_OPERATION might be returned. However, I can't spot any that are relevant to my situation.

The weird thing is if I just ignore the error, things seem to work anyway. However, I'd like to understand what's going on here because I don't want it to bite me later.

Can anyone explain why I'm getting an error here and how to avoid it?

me--
  • 1,978
  • 1
  • 22
  • 42
  • I sometimes have this issue when I am using `GL_RGBA` instead of `GL_RGB`. – indexoutofbounds Jul 19 '19 at 07:30
  • Try using KHR_debug extension if it's available - you'll get a better error reason on most drivers. – solidpixel Jul 19 '19 at 08:07
  • @solidpixel I can't find any info on `KHR_debug` for iOS - I can only assume it's not available. @indexoutofbounds I tried changing to `GL_RGBA` and get the same problem. – me-- Jul 20 '19 at 01:55

0 Answers0