[Mesa-dev] [PATCH] st/nir: Use nir_src_as_uint for tokens
Marek Olšák
maraeo at gmail.com
Fri Dec 14 19:25:11 UTC 2018
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Marek
On Fri, Dec 14, 2018 at 12:20 PM Jason Ekstrand <jason at jlekstrand.net>
wrote:
> ---
> src/mesa/state_tracker/st_nir_lower_builtin.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/src/mesa/state_tracker/st_nir_lower_builtin.c
> b/src/mesa/state_tracker/st_nir_lower_builtin.c
> index 195dc40b2ef..ab74d3183dc 100644
> --- a/src/mesa/state_tracker/st_nir_lower_builtin.c
> +++ b/src/mesa/state_tracker/st_nir_lower_builtin.c
> @@ -107,10 +107,6 @@ get_variable(lower_builtin_state *state,
> nir_deref_path *path,
> memcpy(tokens, element->tokens, sizeof(tokens));
>
> if (path->path[idx]->deref_type == nir_deref_type_array) {
> - nir_const_value *c =
> nir_src_as_const_value(path->path[idx]->arr.index);
> -
> - assert(c);
> -
> /* we need to fixup the array index slot: */
> switch (tokens[0]) {
> case STATE_MODELVIEW_MATRIX:
> @@ -123,7 +119,7 @@ get_variable(lower_builtin_state *state,
> nir_deref_path *path,
> case STATE_TEXGEN:
> case STATE_TEXENV_COLOR:
> case STATE_CLIPPLANE:
> - tokens[1] = c->u32[0];
> + tokens[1] = nir_src_as_uint(path->path[idx]->arr.index);
> break;
> }
> }
> --
> 2.19.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20181214/e578c06c/attachment-0001.html>
More information about the mesa-dev
mailing list