[Mesa-dev] [PATCH] nv50, nvc0: Report correct caps for pixel center integer

Tiziano Bacocco tizbac2 at gmail.com
Tue Jan 20 09:47:38 PST 2015


I've done some tests, after being confirmed that the 0.5 subtraction done
in gallium nine is correct,
I've tried to set raster half_pixel_center to 1 , and this way , with the
0.5 subtraction is fine like it is on radeon
With half_pixel_center set to 0 instead the default behavior on shaders
seems to be fragcoord center pixel integer
So i'm guessing it is more like a D3D/OGL switch rather than on/off, and
switches between default behaviors for the two APIs


2015-01-20 0:46 GMT+01:00 Ilia Mirkin <imirkin at alum.mit.edu>:

> Nope. But feel free to do a piglit run to prove/disprove. The fragcoord
> origin tests should start failing with your patch.
> On Jan 19, 2015 3:41 PM, "Tiziano Bacocco" <tizbac2 at gmail.com> wrote:
>
>> Could it be that it affects also fragcoord? because also on rnndb it says
>> that
>>
>> 2015-01-20 0:17 GMT+01:00 Ilia Mirkin <imirkin at alum.mit.edu>:
>>
>>> Oops, dropped cc.
>>> On Jan 19, 2015 3:15 PM, "Ilia Mirkin" <imirkin at alum.mit.edu> wrote:
>>>
>>>> Nope, that's for something else. This has to do with whether gl
>>>> fragcoord is at the integer or half integer coord. The other is a
>>>> rasterizer setting.
>>>> On Jan 19, 2015 3:06 PM, "Tiziano Bacocco" <tizbac2 at gmail.com> wrote:
>>>>
>>>>> On the commit
>>>>> http://cgit.freedesktop.org/mesa/mesa/commit/?id=aafd13027a38d5a2ab5d80019b282b8233c15a8a
>>>>> , the part where the supported caps are added was missing
>>>>>
>>>>>     nv50,nvc0: Report correct caps for pixel center integer
>>>>>
>>>>>     Signed-off-by: Tiziano Bacocco <tizbac2 at gmail.com>
>>>>>
>>>>> diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c
>>>>> b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
>>>>> index da237f9..d6b8d34 100644
>>>>> --- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c
>>>>> +++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
>>>>> @@ -157,6 +157,7 @@ nv50_screen_get_param(struct pipe_screen *pscreen,
>>>>> enum pipe_cap param)
>>>>>     case PIPE_CAP_INDEP_BLEND_ENABLE:
>>>>>     case PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT:
>>>>>     case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER:
>>>>> +   case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER:
>>>>>     case PIPE_CAP_PRIMITIVE_RESTART:
>>>>>     case PIPE_CAP_TGSI_INSTANCEID:
>>>>>     case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR:
>>>>> @@ -190,7 +191,6 @@ nv50_screen_get_param(struct pipe_screen *pscreen,
>>>>> enum pipe_cap param)
>>>>>     /* unsupported caps */
>>>>>     case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
>>>>>     case PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT:
>>>>> -   case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER:
>>>>>     case PIPE_CAP_SHADER_STENCIL_EXPORT:
>>>>>     case PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS:
>>>>>     case PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY:
>>>>> diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
>>>>> b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
>>>>> index 1d7caf8..24eb4d7 100644
>>>>> --- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
>>>>> +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
>>>>> @@ -150,6 +150,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen,
>>>>> enum pipe_cap param)
>>>>>     case PIPE_CAP_INDEP_BLEND_FUNC:
>>>>>     case PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT:
>>>>>     case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER:
>>>>> +   case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER:
>>>>>     case PIPE_CAP_PRIMITIVE_RESTART:
>>>>>     case PIPE_CAP_TGSI_INSTANCEID:
>>>>>     case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR:
>>>>> @@ -180,7 +181,6 @@ nvc0_screen_get_param(struct pipe_screen *pscreen,
>>>>> enum pipe_cap param)
>>>>>
>>>>>     /* unsupported caps */
>>>>>     case PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT:
>>>>> -   case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER:
>>>>>     case PIPE_CAP_SHADER_STENCIL_EXPORT:
>>>>>     case PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS:
>>>>>     case PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY:
>>>>>
>>>>> _______________________________________________
>>>>> mesa-dev mailing list
>>>>> mesa-dev at lists.freedesktop.org
>>>>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>>>>>
>>>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150120/1eaf0efe/attachment.html>


More information about the mesa-dev mailing list