I'm getting this error from dx:
"ID3D11DeviceContext::DrawIndexed: The Shader Resource View in slot 0 of the Vertex Shader unit has structure stride 128 while the shader expects a structure stride of 32. This mismatch is invalid if the shader actually uses the view (e.g. it is not skipped due to shader code branching)."
The app works as expected, but I want to avoid the error filling the log. Have done lots of searching on net and experimenting with code and can't get rid of it.
What I've got is an append buffer that the compute shader writes to through a UAV. It's then unbound from compute shader, and bound to the vertex shader as a resource view.
The append buffer is made with a StructureByteStride of 128 bytes. This one struct contains 4 vertices. Need to have 4 vertices in one chunk, so that when vertices are written to the append buffer they are written in one append() as two primitives and aren't mixed up in the append process.
But the vertex shader reads single 32 byte vertices. Here's how the buffer is declared in the vert shader:
So I guess the mismatch is between the 128 byte stride specified when the buffer was created, and the 32 byte stride of the struct declared in the vert shader hlsl.
Is there a way of having different byte strides for a resource view and its associated buffer? Any other way to avoid the error? I have to use an append buffer, because the amount of data the compute shader generates is variable.
Paul__Member Since 17 May 2012
Offline Last Active May 30 2012 09:46 PM