mojoshader.c
changeset 496 a5418917b49c
parent 494 309f60d7cf8c
child 518 8c0f80fea9ef
--- a/mojoshader.c	Wed Dec 10 05:21:32 2008 -0500
+++ b/mojoshader.c	Wed Dec 10 05:30:38 2008 -0500
@@ -6160,8 +6160,11 @@
 
 static void state_IF(Context *ctx)
 {
-    if (ctx->source_args[0].regtype != REG_TYPE_CONSTBOOL)
-        fail(ctx, "IF src0 must be CONSTBOOL");
+    const RegisterType regtype = ctx->source_args[0].regtype;
+    if ((regtype != REG_TYPE_PREDICATE) && (regtype != REG_TYPE_CONSTBOOL))
+        fail(ctx, "IF src0 must be CONSTBOOL or PREDICATE");
+    else if (!replicate_swizzle(ctx->source_args[0].swizzle))
+        fail(ctx, "IF src0 must have replicate swizzle");
     // !!! FIXME: track if nesting depth.
 } // state_IF