[Mesa-dev] [PATCH] mesa/st: Don't copy propagate from swizzles.

Brian Paul brianp at vmware.com
Wed Apr 24 08:54:22 PDT 2013


On 04/20/2013 11:40 AM, Fabian Bieler wrote:
> Do not propagate a copy if source and destination are identical.
>
> Otherwise code like
>
> MOV TEMP[0].xyzw, TEMP[0].wzyx
> mov TEMP[1].xyzw, TEMP[0].xyzw
>
> is changed to
>
> MOV TEMP[0].xyzw, TEMP[0].wzyx
> mov TEMP[1].xyzw, TEMP[0].wzyx
> ---
>   src/mesa/state_tracker/st_glsl_to_tgsi.cpp |    2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> index f2eb3e7..b5d0534 100644
> --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> @@ -3544,6 +3544,8 @@ glsl_to_tgsi_visitor::copy_propagate(void)
>         /* If this is a copy, add it to the ACP. */
>         if (inst->op == TGSI_OPCODE_MOV&&
>             inst->dst.file == PROGRAM_TEMPORARY&&
> +          !(inst->dst.file == inst->src[0].file&&
> +             inst->dst.index == inst->src[0].index)&&
>             !inst->dst.reladdr&&
>             !inst->saturate&&
>             !inst->src[0].reladdr&&

I'm not too familiar with this code, but if you tested with Piglit and 
found no regressions, then Reviewed-by: Brian Paul <brianp at vmware.com>

Is there a piglit test that hits this specific case?

Does this fix a particular test or app?  If so, please mention it in 
the commit msg.

-Brian


More information about the mesa-dev mailing list