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

Adds a warning for using [PreferRecompute] on methods that may contain side effects #4707

Merged

Conversation

saipraveenb25
Copy link
Collaborator

@saipraveenb25 saipraveenb25 commented Jul 22, 2024

Also adds a way to suppress this warning by using [PreferRecompute(SideEffects.Allow)]

Not technically a breaking change since this will only generate a warning.

Resolves #3303

@saipraveenb25 saipraveenb25 added the pr: non-breaking PRs without breaking changes label Jul 22, 2024
csyonghe
csyonghe previously approved these changes Jul 23, 2024
@@ -2748,8 +2748,16 @@ attribute_syntax [payload] : PayloadAttribute;
__attributeTarget(DeclBase)
attribute_syntax [deprecated(message: String)] : DeprecatedAttribute;

enum SideEffects
Copy link
Collaborator

Choose a reason for hiding this comment

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

=> SideEffectBehavior

@csyonghe
Copy link
Collaborator

@saipraveenb25 there are CI failures here, will you take a look?

@csyonghe csyonghe merged commit 6bb32aa into shader-slang:master Aug 28, 2024
10 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: non-breaking PRs without breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warn on marking function with known side-effects with [PreferRecompute]
2 participants