Brian Paul wrote:
> Alex Deucher wrote:
>> On Mon, Sep 21, 2009 at 12:51 PM, Jeremy Murphy
>> <[email protected]> wrote:
>>> On Tue, 22 Sep 2009 02:43:04 am Alex Deucher wrote:
>>>> On Mon, Sep 21, 2009 at 12:29 PM, Jeremy Murphy
>>>>
>>>> <[email protected]> wrote:
>>>>> On Tue, 22 Sep 2009 01:50:45 am Brian Paul wrote:
>>>>>> Jeremy Murphy wrote:
>>>>>>> Hi there,
>>>>>>>
>>>>>>> I've come up against a bug, but I'm not sure if it's in Mesa or
>>>>>>> something else.  I was testing the example programs from OpenGL
>>>>>>> Distilled (http://code.google.com/p/ogld/), especially the Picking
>>>>>>> program for its mouse stuff.  If you don't feel like compiling it to
>>>>>>> see for yourself, it's just three objects that can be dragged around
>>>>>>> in the x-y plane, but if you drag on the background then it rotates
>>>>>>> the view.  Pretty standard stuff.  Works as expected on my x86
>>>>>>> machine, but doesn't work as expected on my x86_64 machine where
>>>>>>> attempting to drag an object never works -- it always rotates the
>>>>>>> view. Object selection just isn't working.  Both machines are
>>>>>>> relatively identical Linux systems and both have a Radeon graphics
>>>>>>> card.  Does this sound like a bug in Mesa3d?  If it is, I'm happy to
>>>>>>> help with fixing it, but being new to the code, I'm not sure where to
>>>>>>> start looking.  Thanks!  Cheers.
>>>>>> Does the problem occur only with hardware rendering or with software
>>>>>> rendering too?
>>>>> Good question: what's the simplest way to test s/w rendering?  Is that
>>>>> with something like LIBGL_ALWAYS_INDIRECT=1?
>>>> LIBGL_ALWAYS_SOFTWARE=1
>>> What insight!  Apart from the fact that the torus does not display, it does 
>>> fix
>>> the problem with selection.  So what does that mean in terms of locating the
>>> bug?
>> Sounds like there may be issues with both the driver and core mesa.
> 
> Looks like a bug in the application code.
> 
> There are several calls to glDrawRangeElements() in which Mesa's 
> detecting invalid values and skipping the drawing call.  If you export 
> MESA_DEBUG=1 you should see the warning messages.
> 
> I think there's a common misunderstanding around the 'end' parameter 
> for glDrawRangeElements().  It's the max index, inclusive, not 
> exclusive.  That is, if your indexes are [0,1,2,3] then end should be 
> 3, not 4.  When drawing out of a VBO, we need to be sure we don't go 
> out of bounds when reading vertex data out of the VBO.  Mesa does some 
> checking in this area and raises a warning and no-ops the draw when an 
> out of bounds memory read would occur.
> 
> I'll report this to Paul Martz.

Actually, it's technically OK if 'end' is too large since if it were 
99999999 it would still be true that all the indices are <= that 
value.  But it's not giving GL accurate information and the spec 
implies this could lead to slower rendering.

I've changed Mesa to issue a warning in this case but then check the 
actual indices to see if they're in bounds.

-Brian


------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to