Bug 28110 - Mesa classic-only: glMultiDrawElements doesn't draw right
Summary: Mesa classic-only: glMultiDrawElements doesn't draw right
Status: RESOLVED MOVED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/swrast (show other bugs)
Version: 7.7
Hardware: Other All
: medium normal
Assignee: Brian Paul
QA Contact:
URL:
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2010-05-14 11:30 UTC by Clinton Stimpson
Modified: 2019-09-18 18:44 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
testcase (3.46 KB, text/plain)
2010-05-14 13:02 UTC, Clinton Stimpson
Details
patch to fix min/max index computation (2.92 KB, patch)
2010-06-24 14:23 UTC, Brian Paul
Details | Splinter Review
backtrace.txt (2.90 KB, text/plain)
2010-06-24 15:09 UTC, Clinton Stimpson
Details

Description Clinton Stimpson 2010-05-14 11:30:50 UTC

    
Comment 1 Clinton Stimpson 2010-05-14 11:39:50 UTC
I first got this from a background process:
Mesa 7.7.1 implementation error: bad datatype in interpolate_int_colors
Please report at bugzilla.freedesktop.org
Mesa 7.7.1 implementation error: ...
... 
then the program crashes.

So I ran it through valgrind and watched it to get more detail, and long before the "implementation error," valgrind is spitting out issues with glMultiDrawElements.

The first is:
==26120== Conditional jump or move depends on uninitialised value(s)
==26120==    at 0xF1BC2B5: triangle_offset_twoside_rgba (ss_tritmp.h:88)
==26120==    by 0xF14B199: _tnl_render_poly_elts (t_vb_rendertmp.h:352)
==26120==    by 0xF14B87A: run_render (t_vb_render.c:320)
==26120==    by 0xF13EE19: _tnl_run_pipeline (t_pipeline.c:157)
==26120==    by 0xF1404CF: _tnl_draw_prims (t_draw.c:467)
==26120==    by 0xF140835: _tnl_vbo_draw_prims (t_draw.c:376)
==26120==    by 0xF130DE2: vbo_validated_multidrawelements (vbo_exec_array.c:935)
==26120==    by 0xF1312B3: vbo_exec_MultiDrawElements (vbo_exec_array.c:984)
and there are many more afterwards coming from MultiDrawElements.

A bunch of triangles on the screen look very distorted.

I'm not seeing this problem using nVidia's libGL.
Comment 2 Clinton Stimpson 2010-05-14 13:02:28 UTC
Created attachment 35658 [details]
testcase

I've attached a simple test case.  It doesn't draw correctly with Mesa, but does draw correctly with nVidia's libGL.
Comment 3 Brian Paul 2010-06-24 14:23:31 UTC
Created attachment 36478 [details] [review]
patch to fix min/max index computation

Can you try the attached patch against Mesa git/master or 7.8.x?
Comment 4 Clinton Stimpson 2010-06-24 15:09:06 UTC
Created attachment 36479 [details]
backtrace.txt

It does help and my smaller data sets render correctly.
But it appears when I get to larger arrays, I get an infinite loop or something.
I'm attaching a backtrace when I interrupted it in a debugger.
Comment 5 Brian Paul 2010-06-24 15:22:59 UTC
(In reply to comment #4)
> Created an attachment (id=36479) [details]
> backtrace.txt
> 
> It does help and my smaller data sets render correctly.
> But it appears when I get to larger arrays, I get an infinite loop or
> something.
> I'm attaching a backtrace when I interrupted it in a debugger.

Can you set a breakpoint on _tnl_vbo_draw_prims() and see if it's getting called a lot or if you're stuck down inside it?
Comment 6 Clinton Stimpson 2010-06-24 16:09:26 UTC
> (In reply to comment #4)
> Can you set a breakpoint on _tnl_vbo_draw_prims() and see if it's getting
> called a lot or if you're stuck down inside it?

_tnl_vbo_draw_prims() is called repeatedly.

In vbo_split_copy.c line 591 I see
for (i = 0; i < nr_prims;)
{ ....

and i starts at 0, then goes to 16 and stays at 16 for many iterations afterwards.
It also appears one iteration takes too long, considering the size of the data.

So basically, it won't come out of vbo_split_copy().(In reply to comment #5)
Comment 7 Marek Olšák 2011-03-02 06:20:50 UTC
The test case doesn't work with swrast/r300c, but works with Gallium.
Comment 8 Corbin Simpson 2011-09-14 04:39:53 UTC
Triaging somewhat.
Comment 9 GitLab Migration User 2019-09-18 18:44:17 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/295.


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.