[Mesa-dev] [PATCH] st/glsl_to_tgsi: don't increase immediate index by 1.

Ilia Mirkin imirkin at alum.mit.edu
Wed Jun 22 01:06:18 UTC 2016


Is that correct in the case where I have something like

dvec4 foo = ...
bool x = (foo == dvec4(0, 1, 2, 3));

?

Can you elaborate a little bit more as to why this is right? Shouldn't
this be based on the swizzle of the src[j] argument? [Note, I haven't
carefully read all the surrounding code.]

On Tue, Jun 21, 2016 at 9:00 PM, Dave Airlie <airlied at gmail.com> wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> index 9de603c..3d8ddc3 100644
> --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> @@ -816,7 +816,7 @@ glsl_to_tgsi_visitor::emit_asm(ir_instruction *ir, unsigned op,
>
>              if (glsl_base_type_is_64bit(dinst->src[j].type)) {
>                 dinst->src[j].index = initial_src_idx[j];
> -               if (swz > 1) {
> +               if (swz > 1 && dinst->src[j].file != PROGRAM_IMMEDIATE) {
>                    dinst->src[j].double_reg2 = true;
>                    dinst->src[j].index++;
>                }
> --
> 2.5.5
>
> _______________________________________________
> 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