-
Notifications
You must be signed in to change notification settings - Fork 250
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
Default member initialization crashes compiler #6328
Comments
I didn't get a repro using Slang @ 2/5/2025
I compiled the shader in https://gist.github.com/exdal/2d40533d7a8df813a6996771b1f9f95d (named to repro.slang locally) With this command:
|
I am able to reproduce with v2025.5 though |
No repro on v2025.4, so regression is recent |
#6058 Is the regression point. @kaizhangNV |
this is as expected, because in the intializer list proposal SP004, we remove the implicit constructor call for a struct that dones't define an explicit constructor. So for your current example since you have to explicit write it like So your statement |
@kaizhangNV the warning is good, but the compiler shouldn't crash. Where are we crashing? |
I'm currently looking into the crash. It crashes at IR link stage, we eliminate the uninitialized variable at call site:
becomes:
specifically, it's wiped out in this call |
close shader-slang#6328. When declare a var with struct type, if the struct has a resource type field and it doesn't provide explicit constructor, because slang won't implicit construct such variable at declare site if user doesn't explicitly call the initializer list, we should report the resource type field uninitialized as an error to prevent future possible crash when legalize any use of such variable.
close shader-slang#6328. When declare a var with struct type, if the struct has a resource type field and it doesn't provide explicit constructor, because slang won't implicit construct such variable at declare site if user doesn't explicitly call the initializer list, we should report the resource type field uninitialized as an error to prevent future possible crash when legalize any use of such variable.
close shader-slang#6328. When declare a var with struct type, if the struct has a resource type field and it doesn't provide explicit constructor, because slang won't implicit construct such variable at declare site if user doesn't explicitly call the initializer list, we should report the resource type field uninitialized as an error to prevent future possible crash when legalize any use of such variable.
close shader-slang#6328. When declare a var with struct type, if the struct has a resource type field and it doesn't provide explicit constructor, because slang won't implicit construct such variable at declare site if user doesn't explicitly call the initializer list, we should report the resource type field uninitialized as an error to prevent future possible crash when legalize any use of such variable.
close shader-slang#6328. When declare a var with struct type, if the struct has a resource type field and it doesn't provide explicit constructor, because slang won't implicit construct such variable at declare site if user doesn't explicitly call the initializer list, we should report the resource type field uninitialized as an error to prevent future possible crash when legalize any use of such variable.
Default initialized RW/Textures/Resources seem to be crashing compiler despite a condition is set to false, this is started happening after I bumped slang version from
v2024.17.4
tov2025.5
Repro: https://gist.github.com/exdal/2d40533d7a8df813a6996771b1f9f95d
Command line:
Version: v2025.5 (
57b09a8986668626c37055e431fa0ac6449d7214
)Target profile:
spirv_1_4
Link to original Discord post: https://discord.com/channels/1303735196696445038/1337851943942619298/1337851943942619298
The text was updated successfully, but these errors were encountered: