From b6cbc28533a3fd68dbfe694c0774735233df8758 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 9 Jan 2012 11:49:34 +0000 Subject: tgsi: add ISSG support This adds integer version of SSG that GLSL 1.30 can produce. Signed-off-by: Dave Airlie Reviewed-by: Brian Paul --- src/gallium/auxiliary/tgsi/tgsi_exec.c | 14 ++++++++++++++ src/gallium/auxiliary/tgsi/tgsi_info.c | 1 + 2 files changed, 15 insertions(+) (limited to 'src/gallium/auxiliary/tgsi') diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c index 3046656faeb..72b1dcab603 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_exec.c +++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c @@ -374,6 +374,16 @@ micro_sgn(union tgsi_exec_channel *dst, dst->f[3] = src->f[3] < 0.0f ? -1.0f : src->f[3] > 0.0f ? 1.0f : 0.0f; } +static void +micro_isgn(union tgsi_exec_channel *dst, + const union tgsi_exec_channel *src) +{ + dst->i[0] = src->i[0] < 0 ? -1 : src->i[0] > 0 ? 1 : 0; + dst->i[1] = src->i[1] < 0 ? -1 : src->i[1] > 0 ? 1 : 0; + dst->i[2] = src->i[2] < 0 ? -1 : src->i[2] > 0 ? 1 : 0; + dst->i[3] = src->i[3] < 0 ? -1 : src->i[3] > 0 ? 1 : 0; +} + static void micro_sgt(union tgsi_exec_channel *dst, const union tgsi_exec_channel *src0, @@ -4207,6 +4217,10 @@ exec_instruction( exec_vector_unary(mach, inst, micro_iabs, TGSI_EXEC_DATA_INT, TGSI_EXEC_DATA_INT); break; + case TGSI_OPCODE_ISSG: + exec_vector_unary(mach, inst, micro_isgn, TGSI_EXEC_DATA_INT, TGSI_EXEC_DATA_INT); + break; + default: assert( 0 ); } diff --git a/src/gallium/auxiliary/tgsi/tgsi_info.c b/src/gallium/auxiliary/tgsi/tgsi_info.c index c9acdb9fbf8..5b26d8ff09b 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_info.c +++ b/src/gallium/auxiliary/tgsi/tgsi_info.c @@ -193,6 +193,7 @@ static const struct tgsi_opcode_info opcode_info[TGSI_OPCODE_LAST] = { 1, 1, 0, 0, 0, 0, "UARL", TGSI_OPCODE_UARL }, { 1, 3, 0, 0, 0, 0, "UCMP", TGSI_OPCODE_UCMP }, { 1, 1, 0, 0, 0, 0, "IABS", TGSI_OPCODE_IABS }, + { 1, 1, 0, 0, 0, 0, "ISSG", TGSI_OPCODE_ISSG }, }; const struct tgsi_opcode_info * -- cgit v1.2.3