-
Notifications
You must be signed in to change notification settings - Fork 722
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
Assert on static const
in template
functions
#5273
Comments
20 tasks
This test case should pass. The code that is generated when the assert is disabled is correct. We just need to fix the assert. It seems too restrictive. |
s-perron
added a commit
to s-perron/DirectXShaderCompiler
that referenced
this issue
Jun 30, 2023
There is an assert that checks if a variable will be placed in the Function or Private storage class in the spir-v. However, the condition checked in that assert is inconsistent with the part of the code that determines which storage class a variable belongs to. The fix is to make the function `isExternalVar` available outside of SprivEmitter.cpp, and use that in the assert. Now the same check is used everywhere. Fixes microsoft#5273
s-perron
added a commit
that referenced
this issue
Jul 7, 2023
There is an assert that checks if a variable will be placed in the Function or Private storage class in the spir-v. However, the condition checked in that assert is inconsistent with the part of the code that determines which storage class a variable belongs to. The fix is to make the function `isExternalVar` available outside of SprivEmitter.cpp, and use that in the assert. Now the same check is used everywhere. Fixes #5273
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compiling some HLSL code with
static const
in templates seems to be fine in the release builds, but when asserts are turned on in a debug build the following appears:Repro with:
Should this be turned into an
emitError()
to disallow the case globally, with a fitting error message? I haven't checked if the code generates and runs as expected, but it seems so.The text was updated successfully, but these errors were encountered: