-
Notifications
You must be signed in to change notification settings - Fork 249
Properly document support for shared memory (aka groupshared) (was: implement too) #695
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
Comments
This appears to be referenced here: and here: But the actual implementation I can't find in issues. Another problem is that "groupshared" is not standard nomenclature, and is HLSL specific, and probably should not be used as the name for this.
AFAIK the only reason HLSL calls this " Heck HLSL even refers to this memory as "shared memory" in their own documentation:
|
Good point, slightly changed the issue. |
Shared memory needs to be specified in the entry point with the #[spirv(compute(threads(256)))]
pub unsafe fn downsample_cs(
..
#[spirv(workgroup)] scratch: &mut [[f32x4; 16]; 16],
) { |
Ah, thanks! Then this issue is only about improving the documentation so that it's easy to find. Maybe it should actually be Also need to figure out barriers.. |
I like the |
@hrydgard Actually didn't know this either, and even though I suggested using shared, I think following spirv semantics in code is much more important, so I agree with @msiglreith that nothing should change codewise, though clearly there is an issue with finding if these features have been implemented or are being worked on or not. |
Uh oh!
There was an error while loading. Please reload this page.
EDIT: Answer in #695 (comment) , but docs still need improvement.
Shared memory within a group (as annotated with groupshared in HLSL) doesn't seem to be documented at least, and I can't figure out how to use it.
Basically, this in HLSL:
groupshared float4 buffer[window_size];
where threads in a whole group can share data with each other (with careful use of group barriers).
The documentation for the barriers should also be linked from the documentation for this. Also, barriers need better documentation with examples. For example https://embarkstudios.github.io/rust-gpu/api/spirv_std/arch/fn.memory_barrier.html# , it really could use a copy-pastable line. It's not super clear what to pass into the two generics arguments.
So if support isn't there, it needs to be implemented, or if it is, it needs to be documented .The text was updated successfully, but these errors were encountered: