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.

@kblaschke kblaschke added this to the 4.1 milestone Feb 13, 2024
@dpw13 dpw13 force-pushed the dev/dwagner-nan-prop-1 branch from 36d590a to 762c146 Compare February 16, 2024 13:26
@@ -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.

@dpw13 dpw13 force-pushed the dev/dwagner-nan-prop-1 branch from 762c146 to b3a1483 Compare February 21, 2024 13:18
@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.

2 participants