Bug 5001 - Indirect rendering of glInterleavedArrays() broke
Summary: Indirect rendering of glInterleavedArrays() broke
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Ian Romanick
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 1690
  Show dependency treegraph
 
Reported: 2005-11-09 16:49 UTC by tom
Modified: 2005-11-29 16:07 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Fix typeo in __indirect_glInterleavedArrays (547 bytes, patch)
2005-11-10 08:51 UTC, Ian Romanick
Details | Splinter Review
Major re-work of __indirect_glInterleavedArrays (6.62 KB, patch)
2005-11-10 10:11 UTC, Ian Romanick
Details | Splinter Review
Major re-work of __indirect_glInterleavedArrays, take 2 (7.55 KB, patch)
2005-11-15 13:01 UTC, Ian Romanick
Details | Splinter Review

Description tom 2005-11-09 16:49:10 UTC
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;
Comment 1 Ian Romanick 2005-11-10 08:51:06 UTC
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.
Comment 2 Ian Romanick 2005-11-10 10:11:36 UTC
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.
Comment 3 tom 2005-11-10 16:18:03 UTC
I've tested the patch, glInterleavedArrays() now works for me.  Thanks.
Comment 4 Brian Paul 2005-11-11 13:47:48 UTC
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.
Comment 5 Ian Romanick 2005-11-15 13:01:21 UTC
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.
Comment 6 Ian Romanick 2005-11-30 11:07:33 UTC
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.