[Mesa-dev] [PATCH 5/5] st/glsl_to_tgsi: fix [ui]vec[34] conversion to double

Marek Olšák maraeo at gmail.com
Thu Oct 13 22:36:30 UTC 2016


For the series:

Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Thu, Oct 13, 2016 at 5:13 PM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>
> The corresponding opcodes for integers need to be treated the same as F2D.
>
> Fixes GL45-CTS.gpu_shader_fp64.conversions.
> ---
>  src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> index 682c034..f49a873 100644
> --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> @@ -862,22 +862,23 @@ glsl_to_tgsi_visitor::emit_asm(ir_instruction *ir, unsigned op,
>                    dinst->src[j].index++;
>                }
>
>                 if (swz & 1)
>                    dinst->src[j].swizzle = MAKE_SWIZZLE4(SWIZZLE_Z, SWIZZLE_W, SWIZZLE_Z, SWIZZLE_W);
>                 else
>                    dinst->src[j].swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_X, SWIZZLE_Y);
>
>              } else {
>                 /* some opcodes are special case in what they use as sources
> -                  - F2D is a float src0, DLDEXP is integer src1 */
> -               if (op == TGSI_OPCODE_F2D ||
> +                  - [FUI]2D/[UI]2I64 is a float/[u]int src0, DLDEXP is integer src1 */
> +               if (op == TGSI_OPCODE_F2D || op == TGSI_OPCODE_U2D || op == TGSI_OPCODE_I2D ||
> +                   op == TGSI_OPCODE_I2I64 || op == TGSI_OPCODE_U2I64 ||
>                     op == TGSI_OPCODE_DLDEXP ||
>                     (op == TGSI_OPCODE_UCMP && dst_is_64bit[0])) {
>                    dinst->src[j].swizzle = MAKE_SWIZZLE4(swz, swz, swz, swz);
>                 }
>              }
>           }
>        }
>        inst = dinst;
>     } else {
>        this->instructions.push_tail(inst);
> --
> 2.7.4
>
> _______________________________________________
> 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