stride3d / stride

Stride (formerly Xenko), a free and open-source cross-platform C# game engine.
https://stride3d.net
MIT License
6.56k stars 947 forks source link

(Multi)DrawIndirect support #1222

Open johang88 opened 2 years ago

johang88 commented 2 years ago

Describe the solution you'd like Implement support for MultiDrawIndirect and DrawIndirect in the various rendering api's. MultiDrawIndirect is not supported in DX11 though but could be added to DX12/Vulkan/OGL backends. Having these features would make it possible to more easily implement various gpu driven rendering techniques (culling, lod selection etc).

tebjan commented 2 years ago

These are there as overloads that take a Buffer as the argument. https://github.com/stride3d/stride/blob/master/sources/engine/Stride.Graphics/Direct3D/CommandList.Direct3D.cs#L490

Also took me a while to find them, as the Indirect naming doesn't show up.

The "Multi" versions can be simulated by using SV_VertexID and SV_InstanceID in the vertex shader, afaik.

johang88 commented 2 years ago

ohh, nice I shall check this out :)

tebjan commented 2 years ago

For reference #37 #39 #1218