Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

My team is working on an engine implementation and we are trying to add multithreaded scene traversal for updating and rendering our components... The question has come up as to whether or not we can create command list for a subscene once and reuse it across multiple frames. Current code recreates the subscene command list for each frame but we would like to track renderables being added or removed from the subscene and only regenerate the command list as needed.

Google searches have revealed that it is OK to reuse the device context for a new cycle after FinishCommandList is called, but there is nothing definitive about reusing the the command list from frame to frame once it is created.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You can submit command lists multiple times across frames, but the current design makes it less than ideal for "display list" style rendering because you can't change modify or inherit state once the command list is created. You can modify resources (constant buffers, textures, shaders, etc.).

The DirectX 11 command list model is really intended for multi-threaded submission. See the MultithreadedRendering11 sample.

See this blog post for some presentation links.

share|improve this answer
    
Unfortunately even the DX11 multi-threaded command list building has design issues where you gain only marginal performance improvements over single-threaded model ): –  JarkkoL Sep 12 '14 at 1:31
    
The main problem is that the expected driver-level command-list optimizations (indicated by D3D11_FEATURE_DATA_THREADING.DriverCommandLists) turned out to be too difficult to implement in practice with good performance. This is definitely an area that is getting attention with DirectX 12. –  Chuck Walbourn Sep 12 '14 at 4:35
    
Your answer has brought up the next argument between the other engine dev and myself -- concerning dirty state management and deciding WHEN to actually rebuild a command list.. his current solution allows the rebuild to happen across as many frames as it takes to create the new list, using the old list until the new is created.... my take is that it should happen within the frame where the dirty condition occured and then the newly created list is reused until the subscene is dirty again. But that is meat for another question another time :) –  Ascendion Sep 12 '14 at 23:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.