[Mesa-dev] [PATCH 5/5] radeonsi: bail out instead of crashing if the main shader part failed to compile

Marek Olšák maraeo at gmail.com
Tue Jul 25 18:52:08 UTC 2017


Patches 1, 3-5:

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

Marek

On Mon, Jul 17, 2017 at 12:57 PM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>
> ---
>  src/gallium/drivers/radeonsi/si_shader.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
> index af93ca1..30de03f 100644
> --- a/src/gallium/drivers/radeonsi/si_shader.c
> +++ b/src/gallium/drivers/radeonsi/si_shader.c
> @@ -7359,20 +7359,23 @@ int si_shader_create(struct si_screen *sscreen, LLVMTargetMachineRef tm,
>                  * - the prolog part is inserted at the beginning
>                  * - the epilog part is inserted at the end
>                  *
>                  * The prolog and epilog have many (but simple) variants.
>                  *
>                  * Starting with gfx9, geometry and tessellation control
>                  * shaders also contain the prolog and user shader parts of
>                  * the previous shader stage.
>                  */
>
> +               if (!mainp)
> +                       return -1;
> +
>                 /* Copy the compiled TGSI shader data over. */
>                 shader->is_binary_shared = true;
>                 shader->binary = mainp->binary;
>                 shader->config = mainp->config;
>                 shader->info.num_input_sgprs = mainp->info.num_input_sgprs;
>                 shader->info.num_input_vgprs = mainp->info.num_input_vgprs;
>                 shader->info.face_vgpr_index = mainp->info.face_vgpr_index;
>                 memcpy(shader->info.vs_output_param_offset,
>                        mainp->info.vs_output_param_offset,
>                        sizeof(mainp->info.vs_output_param_offset));
> --
> 2.9.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