Kudos to Apple
Looks like I'm 0 for 2 this week. I thought I had found a bug in the way CIImage data was processed via NSBitmapImageRep, but it turns out that the problem was entirely my own. The good folks at Apple reviewed my original bug report, and provided an explanation of what I was doing wrong, which completely resolved my issue.
My problems were as follows:
1. The GL_UNPACK_ROW_LENGTH parameter needs to be set to the pixel count equivalent of the number of bytes per row, given the number of bytes per pixel. I was doing something like setting this value to the number of bytes per row, which is not necessarily the same thing (depending on image depth, etc.)
2. My use of the bitmap size (height and width) to the glTexImage2D function was wrong. This was using the image physical size in points.
With these changes, all texture mapping works properly.
My problems were as follows:
1. The GL_UNPACK_ROW_LENGTH parameter needs to be set to the pixel count equivalent of the number of bytes per row, given the number of bytes per pixel. I was doing something like setting this value to the number of bytes per row, which is not necessarily the same thing (depending on image depth, etc.)
2. My use of the bitmap size (height and width) to the glTexImage2D function was wrong. This was using the image physical size in points.
With these changes, all texture mapping works properly.
Comments