Brian Paul wrote:
> Ian Romanick wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> It looks like adding support for GLX_SGI_make_current_read is almost as
>> easy as just enabling the extension thanks to Mesa's internal
>> framebuffer object changes.  Thanks Brian!
>>
>> However, there is one thing that I don't get.  Each driver supplies a
>> GetBufferSize callback.  This callback is passed a GLframebuffer
>> pointer, but all of the drivers ignore it.  They simply return the size
>> of the currently bound drawable.  Should these functions determine if
>> the supplied GLframebuffer is the current drawable or readable and
>> return the appropriate size?
> 
> GetBufferSize() should return the width/height of the X window (or 
> Pbuffer) that corresponds to the given GLframebuffer.
>  
> Unfortunately, GetBufferSize() isn't correctly implemented in most 
> (any?) DRI drivers.  It really needs to be fixed to support 
> make_current_read.

Well, actually it is impossible to implement correctly.  For any given 
window you have a possible implementation:

        LOCK_HARDWARE()
        (do something to update window dimensions)
        UNLOCK_HARDWARE()

The trouble is that as soon as you unlock the hardware, the window 
dimensions are no longer trustworthy.  If you use those values in such a 
way that carries over to another hardware interaction, you end up with 
potentially incorrect rendering.

This has lead to real bugs in things like the driver clear functions - 
Mesa attempts to pass in some x,y,w,h values to the clear function under 
certain circumstances (when the 'all' parameter is non-true).  These 
values are not trustworthy and must be recalculated once LOCK_HARDWARE 
has been called again.

In general, GetBufferSize is not an answerable question.  It's been a 
vague irritant for a long time, but up until bugs like the above started 
surfacing I was sort of ok about ignoring the issue.  I need to get a 
better understanding of where the buffer size values are used and under 
what conditions they need to be updated.  As it stands I think there are 
any number of latent bugs hidden behind the assumption that we can know 
what size a window is when the hardware lock is not held.

Keith

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to