Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify NaN propagation for multiplication #779

Merged
merged 2 commits into from Feb 21, 2024

Conversation

dpw13
Copy link
Collaborator

@dpw13 dpw13 commented Feb 13, 2024

This solves some edge cases in presets that suppress NaN or infinities by multiplying by zero. It's not clear what the performance impact is with this change, and it may not be something we want to always enable. Because of that, I've added an option flag to
GLSLGenerator::Generate() to enable or disable the behavior. This may be something we don't want to end up merging if the performance impact is too high.

@@ -619,8 +619,8 @@ const Intrinsic _intrinsic[] =
INTRINSIC_FLOAT2_FUNCTION( "step" ),
INTRINSIC_FLOAT2_FUNCTION( "reflect" ),

INTRINSIC_FLOAT1_FUNCTION("isnan"),
INTRINSIC_FLOAT1_FUNCTION("isinf"),
Intrinsic("isnan", HLSLBaseType_Bool, HLSLBaseType_Float),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not aware of any presets that use these functions, but in trying to identify NaNs and Infs in shaders I found that the return type was declared incorrectly here. Changing this line results in the resulting shader correctly casting the output where necessary.

@kblaschke kblaschke merged commit 07c9a8a into projectM-visualizer:master Feb 21, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants