This adds integer version of SSG that GLSL 1.30 can produce.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
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,
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 );
}
{ 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 *
#define TGSI_OPCODE_UARL 157
#define TGSI_OPCODE_UCMP 158
#define TGSI_OPCODE_IABS 159
+#define TGSI_OPCODE_ISSG 160
-#define TGSI_OPCODE_LAST 160
+#define TGSI_OPCODE_LAST 161
#define TGSI_SAT_NONE 0 /* do not saturate */
#define TGSI_SAT_ZERO_ONE 1 /* clamp to [0,1] */