Chia-I Wu <olva...@gmail.com> writes:

> On Tue, Jan 19, 2010 at 2:40 AM, Brian Paul <bri...@vmware.com> wrote:
>>>> But it's not an application bug.
>>>> I could write a GL program that never calls glViewport and still draws
>>>> something meaningful before/after window resizing.
>>> If I understand correctly, the application will draw to an old buffer if
>>> a resize happened and it did not call glViewport.  Right?
>> Are you talking about a specific driver, or in general?
>> In general, it depends on how rendering finds its way to the buffer. If
>> rendering to a surface goes through some kind of handle, reallocating the
>> buffer doesn't change the handle so renering should go to the new buffer.
> What I had in mind was all DRI2 drivers.  I doubt that the handles point to 
> the
> new buffers automatically, but I am not 100% sure.

Yeah, the handles keep pointing to the old buffers until the X server is
asked to allocate the new ones, with DRI2GetBuffers. So, if the
glViewport() hack happened to fail for a given application, it would
never be able to draw outside the subwindow it originally took up.

>>> In that case, we need to call DRI2GetBuffers in buffer swap (for back
>>> rendering) or flush frontbuffer (for front rendering), and copy the
>>> contents of the old buffer to the new one at a suitable position.
>> Off-hand I'm not sure what happens with DRI2.  I could try to look later
>> when I get some time.  Anyone else know?
>>
>> But in the example I alluded to, my app would detect the resize (probably a
>> ConfigureNotify event) and draw a new image and still not call glViewport().
>> Remember that glViewport() _only_ specifies an X/Y transformation of vertex
>> coords from NDC to window space.  It says nothing about the window size or
>> clipping or anything like that.
> Yes, this is what I thought what it should be from the application's point of
> view.  It seems to me that some heuristics are assumed in DRI2 drivers because
> of performance concern.  I think the DRI2 patches Francisco Jerez sent
> yesterday can solve the issue.  (CCed Francisco so that he could provide some
> insights)

Right, that's what I meant to do.

>
> -olv

Attachment: pgpORCVA1dExO.pgp
Description: PGP signature

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to