Hello,
In the article mentioned above (slides 35, 36), they explain how MutiDrawInderect could be use to render multiple meshes with the single CPU call.
In particular, they utilize baseInstance from DrawElementsIndirect struct to encode transform and material indices for the mesh.
Then, this data is exposed in the vertex shader as gl_BaseInstanceARB variable and used to fetch transform for the specific mesh.
It seems that there is no alternative system variable in D3D for gl_BaseInstanceARB. I am thinking how I could work around this.
The first thing that comes to my mind is having a structured buffer, each element of which contains transform and material index for each vertex from the compound mesh vertex buffer. There will be data duplication but it should not be problematic, I gather. After, I could read the data through SV_VertexID in the vertex shader.
Edit: another way would be to add mesh id on vertex object itself.
Do you have any other ideas?