问题
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?
来源:https://stackoverflow.com/questions/57104033/why-is-glteximage2d-returning-gl-invalid-operation-on-ios