[Mesa-dev] [PATCH] st/mesa: only flip stipple pattern for winsys fbo's
Ilia Mirkin
imirkin at alum.mit.edu
Wed Oct 12 18:52:16 UTC 2016
On Wed, Oct 12, 2016 at 2:46 PM, Brian Paul <brianp at vmware.com> wrote:
> On 10/12/2016 12:06 PM, Ilia Mirkin wrote:
>>
>> Gallium is completely oblivious to whether the fbo is flipped or not.
>> Only flip the stipple pattern when the fbo is flipped as well. Otherwise
>> the driver has no idea when to unflip the pattern.
>>
>> Fixes bin/gl-2.1-polygon-stipple-fs -fbo on nv50 and nvc0.
>>
>> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
>> ---
>>
>> This keeps working on llvmpipe. I assume this is because the emulation
>> uses fragcoord to determine the effect, which will be fixed up by the
>> state tracker's wpos logic.
>>
>> src/mesa/state_tracker/st_atom_stipple.c | 10 +++++++---
>> 1 file changed, 7 insertions(+), 3 deletions(-)
>>
>> diff --git a/src/mesa/state_tracker/st_atom_stipple.c
>> b/src/mesa/state_tracker/st_atom_stipple.c
>> index a30215f..5f7bf82 100644
>> --- a/src/mesa/state_tracker/st_atom_stipple.c
>> +++ b/src/mesa/state_tracker/st_atom_stipple.c
>> @@ -61,7 +61,7 @@ invert_stipple(GLuint dest[32], const GLuint src[32],
>> GLuint winHeight)
>>
>>
>>
>> -static void
>> +static void
>> update_stipple( struct st_context *st )
>> {
>> const struct gl_context *ctx = st->ctx;
>> @@ -74,8 +74,12 @@ update_stipple( struct st_context *st )
>>
>> memcpy(st->state.poly_stipple, ctx->PolygonStipple, sz);
>>
>> - invert_stipple(newStipple.stipple, ctx->PolygonStipple,
>> - ctx->DrawBuffer->Height);
>> + if (_mesa_is_user_fbo(ctx->DrawBuffer)) {
>> + memcpy(newStipple.stipple, ctx->PolygonStipple,
>> sizeof(newStipple.stipple));
>> + } else {
>> + invert_stipple(newStipple.stipple, ctx->PolygonStipple,
>> + ctx->DrawBuffer->Height);
>> + }
>>
>> st->pipe->set_polygon_stipple(st->pipe, &newStipple);
>> }
>>
>
> Fixes the test on llvmpipe too.
>
> Reviewed-by: Brian Paul <brianp at vmware.com>
> Tested-by: Brian Paul <brianp at vmware.com>
Thanks. Somehow in my testing I thought llvmpipe was previously
working as well. But that's not the case - it failed same as nouveau,
and this does indeed fix llvmpipe.
Nicolai/Marek - I sorta assume this will break radeonsi. Do you guys
want to sort that out before I push?
-ilia
More information about the mesa-dev
mailing list