File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -263,6 +263,8 @@ namespace vsg
263263
264264 void reserve (const Slots& in_maxSlots);
265265
266+ void connect (ref_ptr<CommandBuffer> commandBuffer);
267+
266268 void reset ();
267269
268270 inline void dirtyStateStacks ()
Original file line number Diff line number Diff line change @@ -114,9 +114,7 @@ void CommandGraph::record(ref_ptr<RecordedCommandBuffers> recordedCommandBuffers
114114
115115 commandBuffer->numDependentSubmissions ().fetch_add (1 );
116116
117- commandBuffer->state = recordTraversal->getState ();
118- recordTraversal->getState ()->_commandBuffer = commandBuffer;
119- recordTraversal->getState ()->reset ();
117+ recordTraversal->getState ()->connect (commandBuffer);
120118
121119 // or select index when maps to a dormant CommandBuffer
122120 VkCommandBuffer vk_commandBuffer = *commandBuffer;
Original file line number Diff line number Diff line change @@ -44,6 +44,13 @@ void State::reset()
4444 activeMaxStateSlot = maxSlots.max ();
4545}
4646
47+ void State::connect (ref_ptr<CommandBuffer> commandBuffer)
48+ {
49+ _commandBuffer = commandBuffer;
50+ commandBuffer->state = this ;
51+ reset ();
52+ }
53+
4754void State::pushView (ref_ptr<StateCommand> command)
4855{
4956 stateStacks[command->slot ].push (command);
You can’t perform that action at this time.
0 commit comments