Closed mnem closed 11 years ago
OMG, you're right! Thanks a lot for that -- I looked over this code several times after iOS 7 beta was released, but always overlooked it. I thought it was a bug in iOS 7, and was about to open up an issue at Apple ... -- stupid me! You saved me a lot of time, thanks! :-)
Sometimes bugs just need a new set of eyes. I always find that out about 5 seconds after I've asked someone to help with something and they point out an enormous flaw in my code that my mind was suppressing :)
Currently,
SPProgram
uses the uniform name index as the program location for the uniform. While this works (through coincidence) on iOS 5 and 6, it breaks for iOS 7 preview 2, causing the call toglUniformMatrix4fv
inSPBaseEffect.m:97
to fail with aGL_INVALID_OPERATION
error due to the wrong location being used.The fix is to use
glGetUniformLocation
andglGetAttribLocation
to fetch the correct locations for the inputs from the input name.The fix was tested with a trivial program showing a textured sprite and untextured quad which now works on both iOS 6.1 and iOS 7 DP2 (unfortunately I don't have any iOS 5 devices to hand). Unit tests also pass of course.