[Mesa-dev] [PATCH] st/mesa: adjust Z coordinates for quad clearing

Dave Airlie airlied at gmail.com
Tue Aug 5 16:36:03 PDT 2014


On 6 August 2014 02:21, Brian Paul <brianp at vmware.com> wrote:
> On 08/05/2014 10:16 AM, Roland Scheidegger wrote:
>>
>> Am 04.08.2014 18:08, schrieb Brian Paul:
>>>
>>> Specify the quad's Z position in clip coordinate space, not
>>> normalized Z space.  Use viewport scale, translation = 0.5, 0.5.
>>>
>>> Before, we were specifying the quad's Z position in [0,1] and using
>>> viewport scale=1.0, translate=0.0.  That works fine, unless your
>>> driver needs to work in clip coordinate space and needs to
>>> reconstruct viewport near/far values from the scale/translation
>>> factors.  The VMware svga driver falls into that category.
>>>
>>> When we did that reconstruction we wound up with near=-1 and far=1
>>> which are outside the limits of [0,1].  In some cases, this caused
>>> the quad to be drawn at the wrong depth.  In other cases it was
>>> clipped away.
>>>
>>> Fixes some scissored depth clears with VMware driver.  This should
>>> have no effect on other drivers.

I also saw this problem when I was developing virgl, so

Acked-by: Dave Airlie <airlied at redhat.com>

Dave.


More information about the mesa-dev mailing list