[Mesa-dev] [PATCH 2/2] st: add NIR GL_ARB_get_program_binary support

Marek Olšák maraeo at gmail.com
Wed Feb 14 17:43:59 UTC 2018


For the series:

Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Tue, Feb 13, 2018 at 4:27 AM, Timothy Arceri <tarceri at itsqueeze.com> wrote:
> ---
>  src/mesa/state_tracker/st_context.c | 15 +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
> index 7e721572e0..e23f9fd70b 100644
> --- a/src/mesa/state_tracker/st_context.c
> +++ b/src/mesa/state_tracker/st_context.c
> @@ -758,6 +758,17 @@ st_init_driver_functions(struct pipe_screen *screen,
>
>     /* GL_ARB_get_program_binary */
>     functions->GetProgramBinaryDriverSHA1 = st_get_program_binary_driver_sha1;
> -   functions->ProgramBinarySerializeDriverBlob = st_serialise_tgsi_program;
> -   functions->ProgramBinaryDeserializeDriverBlob = st_deserialise_tgsi_program;
> +
> +   enum pipe_shader_ir preferred_ir = (enum pipe_shader_ir)
> +      screen->get_shader_param(screen, PIPE_SHADER_VERTEX,
> +                               PIPE_SHADER_CAP_PREFERRED_IR);
> +   if (preferred_ir == PIPE_SHADER_IR_NIR) {
> +      functions->ProgramBinarySerializeDriverBlob = st_serialise_nir_program;
> +      functions->ProgramBinaryDeserializeDriverBlob =
> +         st_deserialise_nir_program;
> +   } else {
> +      functions->ProgramBinarySerializeDriverBlob = st_serialise_tgsi_program;
> +      functions->ProgramBinaryDeserializeDriverBlob =
> +         st_deserialise_tgsi_program;
> +   }
>  }
> --
> 2.14.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list