[Mesa-dev] [PATCH 05/17] nir/info: Add compute shader local size to nir_shader_info

Pohjolainen, Topi topi.pohjolainen at intel.com
Fri Oct 9 00:19:53 PDT 2015


On Thu, Oct 08, 2015 at 05:22:37PM -0700, Jason Ekstrand wrote:
> ---
>  src/glsl/nir/glsl_to_nir.cpp | 8 ++++++++
>  src/glsl/nir/nir.h           | 4 ++++
>  2 files changed, 12 insertions(+)

This is needed in patch 14 and

Reviewed-by: Topi Pohjolainen <topi.pohjolainen at intel.com>

> 
> diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp
> index da15927..e4aa709 100644
> --- a/src/glsl/nir/glsl_to_nir.cpp
> +++ b/src/glsl/nir/glsl_to_nir.cpp
> @@ -173,6 +173,14 @@ glsl_to_nir(const struct gl_shader_program *shader_prog,
>        shader->info.gs.invocations = sh->Geom.Invocations;
>        break;
>  
> +   case MESA_SHADER_COMPUTE: {
> +      struct gl_compute_program *cp = (struct gl_compute_program *)sh->Program;
> +      shader->info.cs.local_size[0] = cp->LocalSize[0];
> +      shader->info.cs.local_size[1] = cp->LocalSize[1];
> +      shader->info.cs.local_size[2] = cp->LocalSize[2];
> +      break;
> +   }
> +
>     default:
>        break; /* No stage-specific info */
>     }
> diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h
> index e511298..2ce958a 100644
> --- a/src/glsl/nir/nir.h
> +++ b/src/glsl/nir/nir.h
> @@ -1501,6 +1501,10 @@ typedef struct nir_shader_info {
>           /** 1 .. MAX_GEOMETRY_SHADER_INVOCATIONS */
>           unsigned invocations;
>        } gs;
> +
> +      struct {
> +         unsigned local_size[3];
> +      } cs;
>     };
>  } nir_shader_info;
>  
> -- 
> 2.5.0.400.gff86faf
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list