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

Ilia Mirkin imirkin at alum.mit.edu
Mon Aug 29 15:53:31 UTC 2016


On Fri, Aug 26, 2016 at 7:58 AM, Kai Wasserbäch
<kai at dev.carbon-project.org> wrote:
> diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
> index b9ac9f4..48aaa46 100644
> --- a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
> +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
> @@ -426,7 +426,8 @@ nvc0_sampler_state_delete(struct pipe_context *pipe, void *hwcso)
>  }
>
>  static inline void
> -nvc0_stage_sampler_states_bind(struct nvc0_context *nvc0, int s,
> +nvc0_stage_sampler_states_bind(struct nvc0_context *nvc0,
> +                               enum pipe_shader_type s,
>                                 unsigned nr, void **hwcso)
>  {
>     unsigned i;
> @@ -456,7 +457,7 @@ nvc0_stage_sampler_states_bind(struct nvc0_context *nvc0, int s,
>
>  static void
>  nvc0_stage_sampler_states_bind_range(struct nvc0_context *nvc0,
> -                                     const unsigned s,
> +                                     const enum pipe_shader_type s,
>                                       unsigned start, unsigned nr, void **cso)
>  {
>     const unsigned end = start + nr;

Just noticed it, but these hunks are wrong. No ill effect at runtime,
since enum == int basically, but s != shader enum. It's an unwritten
enum in nvc0 code where 0 = vertex, 1 = tcs, etc. In nv50 code, there
are only 4 values (no tess).

I don't have time to revert them right now, but I'll try to do it
tonight if no one else beats me to it.

  -ilia


More information about the mesa-dev mailing list