mojoshader.c
changeset 1183 ec44ee868688
parent 1182 179ffe99c57f
child 1184 62922fc6abe9
--- a/mojoshader.c	Fri May 04 17:45:20 2018 -0400
+++ b/mojoshader.c	Fri Feb 03 12:52:10 2017 -0500
@@ -9036,8 +9036,9 @@
         case SRCMOD_NOT:  // !!! FIXME: I _think_ this is right...
             if (shader_version_atleast(ctx, 2, 0))
             {
-                if (info->regtype != REG_TYPE_PREDICATE)
-                    fail(ctx, "NOT only allowed on predicate register.");
+                if (info->regtype != REG_TYPE_PREDICATE
+                 && info->regtype != REG_TYPE_CONSTBOOL)
+                    fail(ctx, "NOT only allowed on bool registers.");
             } // if
             break;
 
@@ -10722,6 +10723,13 @@
         if ( (!is_comment_token(ctx, *tokens, &subtokcount)) ||
              (subtokcount > tokcount) )
         {
+            // !!! FIXME: Standalone preshaders have this EOS-looking token,
+            // !!! FIXME:  sometimes followed by tokens that don't appear to
+            // !!! FIXME:  have anything to do with the rest of the blob.
+            // !!! FIXME: So for now, treat this as a special "EOS" comment.
+            if (SWAP32(*tokens) == 0xFFFF)
+                break;
+
             fail(ctx, "Bogus preshader data.");
             return;
         } // if