Is it possible to use an RWStructuredBuffer in a vertex shader in Unity? Most I have read indicates it should be possible, but I am not having any success. Using a read-only StructuredBuffer does work.
Note that I am not using a Compute Shader. I create a ComputeBuffer on the CPU side and fill it with some vertex positions, then use DrawProcedural and read those vertex positions. Eventually I’d like to be able write back to the buffer when I get this working, but for now I’m simply reading data. StructuredBuffer works, RWStructuredBuffer does not.
Unfortunately, the above solution doesn’t work on some GPUs.
First, code was executed on laptop with Intel integrated graphics card, it worked well, so I decided to publish it.
Today I tried to run code on NVIDIA GPU, but still I see pink color (by the way, there are no errors in debug console, so it strange).
Could someone try to run code in different machine to compare results ?
RWStructuredBuffer is supported for all types of shaders in hardware with minimum D3D_FEATURE_LEVEL_11_1.
(minimum AMD Radeon HD 8000 or NVIDIA GeForce GTX 900 or Intel HD Graphics 5000/4x00 and Windows 8).
For hardware with D3D_FEATURE_LEVEL_11_0 is only supported for pixel and compute shaders.
So, now it explains, why my sample code works on the newest GPUs and not on NVIDIA GTX 660.
I have to upgrade graphics card.