[Mesa-dev] [PATCH 11/17] st/mesa: add conversion for compute shaders

Ilia Mirkin imirkin at alum.mit.edu
Mon Jan 25 06:39:21 PST 2016


On Sun, Jan 24, 2016 at 4:09 PM, Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
> The size of shared variables needs to be stored in gl_compute_program
> in order to set up pipe_compute_state::req_local_mem. According to the
> spec, there are no predefined inputs nor any fixed-function outputs.
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>  src/mesa/main/mtypes.h                     |  5 +++++
>  src/mesa/main/shaderapi.c                  |  1 +
>  src/mesa/state_tracker/st_glsl_to_tgsi.cpp |  8 ++++++++
>  src/mesa/state_tracker/st_program.c        | 19 ++++++++++++++++++-
>  4 files changed, 32 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
> index 3376549..dc6409a 100644
> --- a/src/mesa/main/mtypes.h
> +++ b/src/mesa/main/mtypes.h
> @@ -2033,6 +2033,11 @@ struct gl_compute_program
>      * Size specified using local_size_{x,y,z}.
>      */
>     unsigned LocalSize[3];
> +
> +   /**
> +    * Size of shared variables accessed by the compute shader.
> +    */
> +   unsigned SharedSize;
>  };
>
>
> diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
> index a988f41..7f19e67 100644
> --- a/src/mesa/main/shaderapi.c
> +++ b/src/mesa/main/shaderapi.c
> @@ -2124,6 +2124,7 @@ _mesa_copy_linked_program_data(gl_shader_stage type,
>        int i;
>        for (i = 0; i < 3; i++)
>           dst_cp->LocalSize[i] = src->Comp.LocalSize[i];
> +      dst_cp->SharedSize = src->Comp.SharedSize;
>        break;
>     }
>     default:

The above 2 hunks should go into a separate change (e.g. mesa: store
shared size in gl_compute_program).

  -ilia


More information about the mesa-dev mailing list