Skip to content

Fix ternary operator#43

Merged
encounter merged 1 commit into
encounter:mainfrom
PJB3005:26-03-07-ternary
Mar 8, 2026
Merged

Fix ternary operator#43
encounter merged 1 commit into
encounter:mainfrom
PJB3005:26-03-07-ternary

Conversation

@PJB3005

@PJB3005 PJB3005 commented Mar 7, 2026

Copy link
Copy Markdown
Collaborator

should be select() instead

should be select() instead
Comment thread lib/gx/shader.cpp
return fmt::format("select({3}, {2}, round({0}.r * 255.0) == round({1}.r * 255.0)) + {4}", a, b, c, zero, d);
case GX_TEV_COMP_GR16_GT:
return fmt::format(
"((round(dot({0}.rg * 255.0, vec2(1.0, 256.0))) > round(dot({1}.rg * 255.0, vec2(1.0, 256.0)))) ? {2} : {3}) + "

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

probably should fix the other cases down here too

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

a

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

yes would love to fix the others. merging for now

@encounter encounter merged commit f0dc422 into encounter:main Mar 8, 2026
6 checks passed
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.

3 participants