Description
The InsertList
method is a member of the CommandList
class within the Sandbox.Rendering
namespace. This method allows you to insert the contents of another CommandList
into the current command list. This is useful for combining multiple command lists into a single execution sequence, which can be beneficial for optimizing rendering operations or managing complex rendering tasks.
Usage
To use the InsertList
method, you need to have an instance of CommandList
that you want to insert into the current command list. Call the method on the current CommandList
instance and pass the other CommandList
as a parameter.
Ensure that the otherBuffer
is properly initialized and contains the commands you wish to insert. The method does not return a value, and it modifies the current CommandList
by appending the commands from otherBuffer
.
Example
// Create two CommandList instances
CommandList mainCommandList = new CommandList();
CommandList secondaryCommandList = new CommandList();
// Populate the secondaryCommandList with commands
// ... (add commands to secondaryCommandList)
// Insert the secondaryCommandList into the mainCommandList
mainCommandList.InsertList(secondaryCommandList);
// Now mainCommandList contains all commands from both lists