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

Is it possible to access SSBO (RWByteAddressBuffer in HLSL lingo) as a struct? #23

Open
redgpu opened this issue Jan 11, 2024 · 3 comments
Labels
question Further information is requested

Comments

@redgpu
Copy link

redgpu commented Jan 11, 2024

Is there a shader code example how to do this in vcc? I know the GLSL and HLSL ways of doing this, but I don't know how vcc does it :) Thanks!

@redgpu
Copy link
Author

redgpu commented Jan 11, 2024

And, logically, what about the used-to-be-nasty alignment issues in this case? Do you use scalar layout vulkan extensions to match the C behavior?

@redgpu
Copy link
Author

redgpu commented Jan 11, 2024

Can I use int8, int16, int64 in such structs? Questions, questions... 😄

@Hugobros3
Copy link
Collaborator

I have not tested SSBOs specifically but it should be possible to create a global variable and put the right address space on it so that the generated SPIR-V conforms to what Vulkan wants. See shady.h and grammar.json for how those are defined

As far as alignment issues go, you can read the logic for it here, I don't do different layouts for address spaces so you will likely require the scalar layout extension or have to be careful with what data types you use.

@Hugobros3 Hugobros3 added the question Further information is requested label Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants