Can I create shared memories for graphic shaders?

Hello,
As far as I find on google searches, there is a way to create shared memories (no staging) between Host and GPU if I use computer shaders (Is this correct ?)

Then, can I create and use shared memories between two for usual graphics works (GLSL, vertex, fragment shaders) ?

Thank you

In the context of compute shaders “shared memory” usually refers to a small amount of memory that can be accessed by all invocations in a single workgroup. It is not accessible outside the workgroup (and certainly not by the host). To make use of this variables in the shader source code are annotated with shared. See example and corresponding shaders.

All that is separate from whether device memory (allocated with vkAllocateMemory) is accessible by the host - the propertyFlags of the memory type that you allocate from determines that: if flag VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT is present, the host can get access to the memory (with vkMapMemory).

1 Like

Hello, Carsten
I think you mentioned that the propertyFlags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT guarantees that memory is also accessible by the device
Now I understand

Thank you very much for your help and kindness
(Also thank you for the example sources)
Have a great weekend and see you, Carsten