[Mesa-stable] [Mesa-dev] [PATCH 03/11] st/nine: propertly declare constants

Ilia Mirkin imirkin at alum.mit.edu
Sun Nov 23 21:54:10 PST 2014


On Sun, Nov 23, 2014 at 5:40 PM, David Heidelberg <david at ixit.cz> wrote:
> From: Axel Davy <axel.davy at ens.fr>
>
> Fixes "Error : CONST[20]: Undeclared source register" when running
> dx9_alpha_blending_material. Also artifacts on ilo.
>
> Cc: "10.4" <mesa-stable at lists.freedesktop.org>
> Tested-by: David Heidelberg <david at ixit.cz>
> Signed-off-by: Axel Davy <axel.davy at ens.fr>
> ---
>  src/gallium/state_trackers/nine/nine_ff.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/state_trackers/nine/nine_ff.c b/src/gallium/state_trackers/nine/nine_ff.c
> index 6890933..f2dbae4 100644
> --- a/src/gallium/state_trackers/nine/nine_ff.c
> +++ b/src/gallium/state_trackers/nine/nine_ff.c
> @@ -189,10 +189,10 @@ static void nine_ureg_tgsi_dump(struct ureg_program *ureg, boolean override)
>
>  /* AL should contain base address of lights table. */
>  #define LIGHT_CONST(i)                                                \
> -    ureg_src_indirect(ureg_src_register(TGSI_FILE_CONSTANT, (i)), _X(AL))
> +    ureg_src_indirect(ureg_DECL_constant(ureg, i), _X(AL))
>
>  #define MATERIAL_CONST(i) \
> -    ureg_src_register(TGSI_FILE_CONSTANT, 19 + (i))
> +    ureg_DECL_constant(ureg, 19 + (i))
>
>  #define MISC_CONST(i) \
>      ureg_src_register(TGSI_FILE_CONSTANT, (i))

I guess this is how _CONST works, so it's OK, although my personal
inclination would have been to declare separately from the uses. I
guess the speed difference is pretty minor for all but the largest
programs.

Does MISC_CONST also need this hack? If not, why not?

In any case, this change is

Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>

> --
> 2.1.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-stable mailing list