[Mesa-dev] [PATCH] nvc0: fix line width on GM20x+

Pending Chaos pendingchaos02 at gmail.com
Fri Apr 20 22:26:56 UTC 2018


When both cso->line_smooth and cso->multisample are both false, this
fixes the line rendering issue. So it seems it always uses
LINE_WIDTH_SMOOTH.

The alternative with the ">= GM204_3D" looks fine.

On Fri, Apr 20, 2018 at 11:21 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
> On Fri, Apr 20, 2018 at 6:16 PM, Rhys Perry <pendingchaos02 at gmail.com> wrote:
>> Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
>> ---
>>  src/gallium/drivers/nouveau/nvc0/nvc0_state.c    | 9 +++++----
>>  src/gallium/drivers/nouveau/nvc0/nvc0_stateobj.h | 2 +-
>>  2 files changed, 6 insertions(+), 5 deletions(-)
>>
>> diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
>> index 99d45a238a..9e23340d6e 100644
>> --- a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
>> +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
>> @@ -233,10 +233,11 @@ nvc0_rasterizer_state_create(struct pipe_context *pipe,
>>      SB_IMMED_3D(so, MULTISAMPLE_ENABLE, cso->multisample);
>>
>>      SB_IMMED_3D(so, LINE_SMOOTH_ENABLE, cso->line_smooth);
>> -    if (cso->line_smooth || cso->multisample)
>> -       SB_BEGIN_3D(so, LINE_WIDTH_SMOOTH, 1);
>> -    else
>> -       SB_BEGIN_3D(so, LINE_WIDTH_ALIASED, 1);
>> +    /* On GM20x+, LINE_WIDTH_SMOOTH controls both aliased and smooth
>> +     * rendering, so set set both */
>
> Is there a possibility that instead it's just more controlled by the
> LINE_SMOOTH_ENABLE? i.e. what if you make LINE_SMOOTH_ENABLE come on
> with cso->line_smooth || cso->multisample? Or have you experimented,
> and even when there's no smoothing/multisampling whatsoever, it will
> use the smooth value?
>
> In the latter case, perhaps just do it as
>
> if (cso->line_smooth || cso->multisample || class_3d >= GM204_3D)
>
> ?
>
>> +    SB_BEGIN_3D(so, LINE_WIDTH_SMOOTH, 1);
>> +    SB_DATA    (so, fui(cso->line_width));
>> +    SB_BEGIN_3D(so, LINE_WIDTH_ALIASED, 1);
>>      SB_DATA    (so, fui(cso->line_width));
>>
>>      SB_IMMED_3D(so, LINE_STIPPLE_ENABLE, cso->line_stipple_enable);
>> diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_stateobj.h b/src/gallium/drivers/nouveau/nvc0/nvc0_stateobj.h
>> index 3006ed6195..d4f8af4e75 100644
>> --- a/src/gallium/drivers/nouveau/nvc0/nvc0_stateobj.h
>> +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_stateobj.h
>> @@ -23,7 +23,7 @@ struct nvc0_blend_stateobj {
>>  struct nvc0_rasterizer_stateobj {
>>     struct pipe_rasterizer_state pipe;
>>     int size;
>> -   uint32_t state[43];
>> +   uint32_t state[45];
>>  };
>>
>>  struct nvc0_zsa_stateobj {
>> --
>> 2.14.3
>>
>> _______________________________________________
>> 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