[Mesa-dev] [PATCH] gallium: Use enum pipe_shader_type in bind_sampler_states()

Kai Wasserbäch kai at dev.carbon-project.org
Sat Aug 27 10:10:00 UTC 2016


Hey Samuel,
Samuel Pitoiset wrote on 26.08.2016 20:22:
> On 08/26/2016 04:17 PM, Kai Wasserbäch wrote:
>> Hey Samuel,
>> Samuel Pitoiset wrote on 26.08.2016 15:54:
>>> On 08/26/2016 01:58 PM, Kai Wasserbäch wrote:
>>>> [...]
>>>> diff --git a/src/gallium/drivers/nouveau/nv30/nv30_texture.c
>>>> b/src/gallium/drivers/nouveau/nv30/nv30_texture.c
>>>> index 4f4f87e..dc1a476 100644
>>>> --- a/src/gallium/drivers/nouveau/nv30/nv30_texture.c
>>>> +++ b/src/gallium/drivers/nouveau/nv30/nv30_texture.c
>>>> @@ -188,7 +188,7 @@ nv30_sampler_state_delete(struct pipe_context *pipe, void
>>>> *hwcso)
>>>>
>>>>  static void
>>>>  nv30_bind_sampler_states(struct pipe_context *pipe,
>>>> -                         unsigned shader, unsigned start_slot,
>>>> +                         enum pipe_shader_type shader, unsigned start_slot,
>>>>                           unsigned num_samplers, void **samplers)
>>>>  {
>>>>     switch (shader) {
>>>> @@ -198,6 +198,10 @@ nv30_bind_sampler_states(struct pipe_context *pipe,
>>>>     case PIPE_SHADER_FRAGMENT:
>>>>        nv30_fragtex_sampler_states_bind(pipe, num_samplers, samplers);
>>>>        break;
>>>> +   default:
>>>> +      assert(shader <= PIPE_SHADER_TYPES);
>>>> +      assert(!"invalid/unhandled type");
>>>
>>> assert(!"invalid PIPE_SHADER type"); is enough here.
>>> Please apply the same change for nv50 and nvc0 as well.
>>
>> Is v2 – with a slightly different assert message – ok then?
> 
> Yeah, I wouldn't worry about it, it's fine by me.
> 
> Just make sure it compiles, it should but who knows. :)
> 
> Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>

thanks for the review! I've sent the complete series and would appreciate
further R-bs (and the subsequent commit). ;-)

Cheers,
Kai

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 630 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160827/4d702850/attachment.sig>


More information about the mesa-dev mailing list