-
Notifications
You must be signed in to change notification settings - Fork 194
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
[hlsl-out] Arrays in Structs Are Incorrectly Loaded When Loaded as A Whole Struct #2184
Comments
We can inject a function to do inline init of arrays (we have this mechanism already). |
I'll take a look at this in the next few |
The mechanism for this is already in place but we only use it for structs right now. Lines 876 to 881 in 8a72b7a
this is where we detect and inject the function that constructs the type Lines 158 to 161 in 8a72b7a
this is where we inject a call to the function that constructs the type We need to more or less copy-paste the code above for arrays. |
* test(hlsl-out): add failing case for array as ctor arg See issue #2184. * fix(hlsl): emit constructor functions for arrays
WGSL
HLSL
Solution
As far as I can tell, the only real solution is to make the array part of the initialization a temporary. I wish there was a way to initialize an array inline, but I don't think you can. I'm not entirely sure how to do it but this code is the code that needs to be assigned to a temporary.
naga/src/back/hlsl/storage.rs
Lines 145 to 156 in 2754a01
The text was updated successfully, but these errors were encountered: