[Mesa-dev] [PATCH 2/2] st_glsl_to_tgsi: use ISSG

Brian Paul brianp at vmware.com
Mon Jan 9 06:47:26 PST 2012


On 01/09/2012 04:54 AM, Dave Airlie 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 |    5 ++++-
>   1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> index 3b8e2fe..460bc04 100644
> --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> @@ -1416,7 +1416,10 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir)
>            emit(ir, TGSI_OPCODE_ABS, result_dst, op[0]);
>         break;
>      case ir_unop_sign:
> -      emit(ir, TGSI_OPCODE_SSG, result_dst, op[0]);
> +      if (result_dst.type == GLSL_TYPE_INT || result_dst.type == GLSL_TYPE_UINT)
> +         emit(ir, TGSI_OPCODE_ISSG, result_dst, op[0]);
> +      else
> +         emit(ir, TGSI_OPCODE_SSG, result_dst, op[0]);
>         break;
>      case ir_unop_rcp:
>         emit_scalar(ir, TGSI_OPCODE_RCP, result_dst, op[0]);

Is ISSG going to work properly for unsigned integers?  Maybe 
ISSG(UINT) should be replaced by a set-not-equal-to-zero instruction?

-Brian


More information about the mesa-dev mailing list