The ResourceBarrierTransition API was doing a lot of stuff wrong, resulting in undefined behaviour and crashes.
I've fixed all the validation errors here by using the correct expected flags, I've also modified and obsoleted both ResourceState.VertexAndConstantBuffer
and ResourceState.IndexBuffer
instead you should use ResourceState.VertexOrIndexBuffer
which infers the usage from the provided buffer.
I think I didn't design this API as well as I could've, there's a lot of things that should be simpler because we know the usage from the types we pass in.