[Mesa-dev] [PATCH 3/5] i965: Include the viewport in the scissor rectangle.

Ilia Mirkin imirkin at alum.mit.edu
Fri Mar 11 01:20:52 UTC 2016


On Thu, Mar 10, 2016 at 8:05 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
> I thought there was some deal where viewport was *not* supposed to act
> as a scissor... perhaps I misunderstood though.

It is, btw, entirely conceivable that I remember that precisely in the
context of wide points/lines...

>
> On Thu, Mar 10, 2016 at 7:59 PM, Kenneth Graunke <kenneth at whitecape.org> wrote:
>> We'll need to use scissoring to restrict fragments to the viewport
>> soon.  It seems harmless to include it generally, so let's do that.
>>
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94453
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94454
>> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
>> ---
>>  src/mesa/drivers/dri/i965/gen6_scissor_state.c | 8 ++++----
>>  1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/src/mesa/drivers/dri/i965/gen6_scissor_state.c b/src/mesa/drivers/dri/i965/gen6_scissor_state.c
>> index 17b4a7f..a206732 100644
>> --- a/src/mesa/drivers/dri/i965/gen6_scissor_state.c
>> +++ b/src/mesa/drivers/dri/i965/gen6_scissor_state.c
>> @@ -58,10 +58,10 @@ gen6_upload_scissor_state(struct brw_context *brw)
>>     for (unsigned i = 0; i < ctx->Const.MaxViewports; i++) {
>>        int bbox[4];
>>
>> -      bbox[0] = 0;
>> -      bbox[1] = fb_width;
>> -      bbox[2] = 0;
>> -      bbox[3] = fb_height;
>> +      bbox[0] = MAX2(ctx->ViewportArray[i].X, 0);
>> +      bbox[1] = MIN2(bbox[0] + ctx->ViewportArray[i].Width, fb_width);
>> +      bbox[2] = MAX2(ctx->ViewportArray[i].Y, 0);
>> +      bbox[3] = MIN2(bbox[2] + ctx->ViewportArray[i].Height, fb_height);
>>        _mesa_intersect_scissor_bounding_box(ctx, i, bbox);
>>
>>        if (bbox[0] == bbox[1] || bbox[2] == bbox[3]) {
>> --
>> 2.7.2
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list