Skip to content

Conversation

@tomspilman
Copy link
Member

@tomspilman tomspilman commented Jan 23, 2026

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.

@tomspilman
Copy link
Member Author

Ok this all works and the test shader in...

MonoGame/MonoGame#8655

... compile now.

I built all the stock effects and verified that these MojoShader changes do not break them.

And in theory these changes at worst would cause shaders that didn't compile before, to compile. It should not break any working shaders.

So i feel this is safe, but maybe needs a little testing by users on their own shaders to ensure no issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mojoshader: NOT only allowed on predicate register

1 participant