Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions mojoshader/mojoshader.c
Original file line number Diff line number Diff line change
Expand Up @@ -6626,8 +6626,9 @@ static int parse_source_token(Context *ctx, SourceArgInfo *info)
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;

Expand Down Expand Up @@ -7508,8 +7509,6 @@ static void state_IF(Context *ctx)
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))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE: This code was removed in the upstream MojoShader repo, but i cannot tell when or why.

But this change makes the test shader in...

MonoGame/MonoGame#8655

Compile.

fail(ctx, "IF src0 must have replicate swizzle");
// !!! FIXME: track if nesting depth.
} // state_IF

Expand Down Expand Up @@ -8248,6 +8247,13 @@ static void parse_preshader(Context *ctx, uint32 tokcount)
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
Expand Down
Loading