mojoshader.c
branchtrunk
changeset 293 57ccf4911b77
parent 292 f6c1a2ec6030
child 294 b522180c78f8
--- a/mojoshader.c	Thu May 08 01:02:07 2008 -0400
+++ b/mojoshader.c	Thu May 08 01:07:16 2008 -0400
@@ -4205,6 +4205,16 @@
     // !!! FIXME: checks for ps_1_4 and ps_1_0 versions...
 } // state_TEXLD
 
+static void state_TEXLDL(Context *ctx)
+{
+    if (!shader_version_atleast(ctx, 3, 0))
+        fail(ctx, "TEXLDL in version < Shader Model 3.0");
+    else if (ctx->source_args[0].regtype != REG_TYPE_TEXTURE)
+        fail(ctx, "TEXLDL src0 must be texture register");
+    else if (ctx->source_args[1].regtype != REG_TYPE_SAMPLER)
+        fail(ctx, "TEXLDL src1 must be sampler register");
+} // state_TEXLDL
+
 static void state_DP2ADD(Context *ctx)
 {
     if (!replicate_swizzle(ctx->source_args[2].swizzle))
@@ -4334,7 +4344,7 @@
     INSTRUCTION(DSY, DS, MOJOSHADER_TYPE_PIXEL),
     INSTRUCTION(TEXLDD, DSSSS, MOJOSHADER_TYPE_PIXEL),
     INSTRUCTION_STATE(SETP, DSS, MOJOSHADER_TYPE_ANY),
-    INSTRUCTION(TEXLDL, DSS, MOJOSHADER_TYPE_ANY),
+    INSTRUCTION_STATE(TEXLDL, DSS, MOJOSHADER_TYPE_ANY),
     INSTRUCTION_STATE(BREAKP, S, MOJOSHADER_TYPE_ANY),
 
     #undef INSTRUCTION