Managing pipeline dependencies in a submission-based renderer

Started by
-1 comments, last by Anfaenger 10 years, 11 months ago

Submission-based engines and stateless renderers (of which the only example i could find is bgfx: https://github.com/bkaradzic/bgfx) are said to be vastly superior than state-machine based APIs. The idea consists in accumulating all the necessary states for making a draw call (helps debugging and filtering out redundant state changes), queuing up the entire frame, sorting the render queue and issuing graphics commands in correct and optimal order.

But in my engine batched draw calls (RenderItems, RenderOps) are not self-contained, they depend on several global constant buffers (per-frame, per-view, per-object, per-material, per-light, etc.), e.g. the cbPerObject buffer should be updated with fresh data before rendering the actual object and some textures must be updated first before being fed to further stages in the post-processing pipeline and so on.

Of course, i could create a separate CB for each object, material, etc., but that seems pretty wasteful to me (eschewed approach in DirectX SDK examples).

How can i ensure the correct execution order (Update,Set,Draw) after sorting the render queue ?

This topic is closed to new replies.

Advertisement