[PATCH] etnaviv: Clear lbl_usage array correctly

Christian Gmeiner christian.gmeiner at gmail.com
Sun Jul 23 19:33:31 UTC 2017


2017-07-23 13:24 GMT+02:00 Wladimir J. van der Laan <laanwj at gmail.com>:
> Fill the entire array instead of just a quarter. This avoids
> crashes with large shaders.
> (currently this never causes a problem because shaders larger than 2048/4
> instructions are not supported by this driver on any hardware, but it will
> cause problems in the future)
>
> Signed-off-by: Wladimir J. van der Laan <laanwj at gmail.com>

Reviewed-by: Christian Gmeiner <christian.gmeiner at gmail.com>

> ---
>  src/gallium/drivers/etnaviv/etnaviv_compiler.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/gallium/drivers/etnaviv/etnaviv_compiler.c b/src/gallium/drivers/etnaviv/etnaviv_compiler.c
> index cc6bfc9..165ab74 100644
> --- a/src/gallium/drivers/etnaviv/etnaviv_compiler.c
> +++ b/src/gallium/drivers/etnaviv/etnaviv_compiler.c
> @@ -2353,7 +2353,7 @@ etna_compile_shader(struct etna_shader_variant *v)
>     if (!c)
>        return false;
>
> -   memset(&c->lbl_usage, -1, ARRAY_SIZE(c->lbl_usage));
> +   memset(&c->lbl_usage, -1, sizeof(c->lbl_usage));
>
>     const struct tgsi_token *tokens = v->shader->tokens;
>
> --
> 2.7.4
>

greets
--
Christian Gmeiner, MSc

https://christian-gmeiner.info


More information about the etnaviv mailing list