Creating a native UAV into a meshes native vertex buffer (DX11)
I have a native plugin which generates mesh data using compute shaders. My ideal solution would be to pass down the native vertex buffer pointer down to the plugin, create a UAV into it, and bind that directly to my compute shader.
Attempting to create the UAV returns an invalid args result. The vertex buffer appears to not be a structured buffer (buffer description has a structured byte stride of 0). Could this be why this method will not work?
Answer by Char111 · Aug 08, 2019 at 01:24 PM
It occurs to me that unity probably has not created the buffer with the UAV bind flag set and so i will not be able to create UAVs into it.
Ill create a copy of the buffer to bind to my shader and try to copy the results across into the vertex buffer.
Even this didn't work. I have reverted to binding a compute buffer to the vertex shader and passing the pointer to that buffer down to my plugin.