The data format we're using is GL_C4UB_V3F. There seems to be a typo in the code in vertarr.c. vOffset = __glXTypeSize(vType) * cSize; in the case statement for GL_C4UB_V3F, looks like it should be: vOffset = __glXTypeSize(cType) * cSize;
Created attachment 3766 [details] [review] Fix typeo in __indirect_glInterleavedArrays That appears to be the only case in __indirect_glInterleavedArrays that has this copy-and-paste type bug. Good catch. Assuming this actually fixes the problem for you, I'll commit to Mesa CVS and X.org 6.8.x CVS.
Created attachment 3768 [details] [review] Major re-work of __indirect_glInterleavedArrays This is a major re-work of the __indirect_glInterleavedArrays routine. The big, ugly, error prone switch-statement is replaced with a compact table. This change cuts the lines of code by more than half (from 156 to 76). This is the patch I intend to commit to Mesa CVS and Xorg 6.7 / 7.0. I will leave attachment #3766 [details] [review] for X.org 6.8.3.
I've tested the patch, glInterleavedArrays() now works for me. Thanks.
There are actually two bugs in your table-driven code: 1. The <format> parameter is never check for legallity, if it's not, <idx> will be invalid. 2. The call to glNormalPointer passes <count> instead of <type> as the first parameter. I'd also like to see a comment before the code where you initialize the offsets[] array because it's not immediately obvious what it does.
Created attachment 3807 [details] [review] Major re-work of __indirect_glInterleavedArrays, take 2 Changes from attachment #3768 [details] [review]: Added numerous comments, including a comment explaining how the format parameter is validated. Explicitly pass GL_FLOAT as the type in the cases where that is the only possible value (e.g., everywhere except the call to glColorPointer). Fixed the error in the glNormalPointer call. Validate that stride is >= 0 (bug #5058). Tested with all modes (including the two error modes) of progs/tests/interleave.c.
I have committed attachment #3807 [details] [review] to both Mesa HEAD and the 6.4 branch. Resolving bug as FIXED.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.