Attempt at DSX and DSY in nv2 profile. trunk
authorRyan C. Gordon <icculus@icculus.org>
Sun, 06 Jul 2008 21:57:10 -0400
branchtrunk
changeset 427 e30c136c7358
parent 426 70ad1ac76ffc
child 428 8d410fecd518
Attempt at DSX and DSY in nv2 profile. I'm not sure if these map directly to the Direct3D opcodes, though...
mojoshader.c
--- a/mojoshader.c	Sun Jul 06 21:53:41 2008 -0400
+++ b/mojoshader.c	Sun Jul 06 21:57:10 2008 -0400
@@ -4827,8 +4827,23 @@
 } // emit_ARB1_DP2ADD
 
 
-EMIT_ARB1_OPCODE_UNIMPLEMENTED_FUNC(DSX)
-EMIT_ARB1_OPCODE_UNIMPLEMENTED_FUNC(DSY)
+static void emit_ARB1_DSX(Context *ctx)
+{
+    if (ctx->support_nv2)  // nv2 has a built-in equivalent to DSX.
+        emit_ARB1_opcode_ds(ctx, "DDX");
+    else
+        failf(ctx, "DSX unsupported in %s profile", ctx->profile->name);
+} // emit_ARB1_DSX
+
+
+static void emit_ARB1_DSY(Context *ctx)
+{
+    if (ctx->support_nv2)  // nv2 has a built-in equivalent to DSY.
+        emit_ARB1_opcode_ds(ctx, "DDY");
+    else
+        failf(ctx, "DSY unsupported in %s profile", ctx->profile->name);
+} // emit_ARB1_DSY
+
 EMIT_ARB1_OPCODE_UNIMPLEMENTED_FUNC(TEXLDD)