summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2014-10-12 22:02:53 +0100
committerEric Anholt <[email protected]>2014-10-13 08:06:48 +0100
commit926eaa9af464f2448b3840bb401c0b2efe43bb40 (patch)
tree1fff48c21c855c8c798b3cc5c2523118961f3cdd /src/gallium/drivers/vc4
parentb86f814afd4a8cc1d5a17308fcdd05fbb937ae93 (diff)
vc4: Add support for the SSG opcode.
Diffstat (limited to 'src/gallium/drivers/vc4')
-rw-r--r--src/gallium/drivers/vc4/vc4_program.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c
index 690f644b61a..15da3ed3005 100644
--- a/src/gallium/drivers/vc4/vc4_program.c
+++ b/src/gallium/drivers/vc4/vc4_program.c
@@ -811,6 +811,17 @@ tgsi_to_qir_clamp(struct vc4_compile *c,
src[1 * 4 + i]);
}
+static struct qreg
+tgsi_to_qir_ssg(struct vc4_compile *c,
+ struct tgsi_full_instruction *tgsi_inst,
+ enum qop op, struct qreg *src, int i)
+{
+ qir_SF(c, src[0 * 4 + i]);
+ return qir_SEL_X_Y_NC(c,
+ qir_SEL_X_0_ZC(c, qir_uniform_f(c, 1.0)),
+ qir_uniform_f(c, -1.0));
+}
+
static void
emit_vertex_input(struct vc4_compile *c, int attr)
{
@@ -1077,6 +1088,7 @@ emit_tgsi_instruction(struct vc4_compile *c,
[TGSI_OPCODE_SIN] = { 0, tgsi_to_qir_sin },
[TGSI_OPCODE_COS] = { 0, tgsi_to_qir_cos },
[TGSI_OPCODE_CLAMP] = { 0, tgsi_to_qir_clamp },
+ [TGSI_OPCODE_SSG] = { 0, tgsi_to_qir_ssg },
};
static int asdf = 0;
uint32_t tgsi_op = tgsi_inst->Instruction.Opcode;