Description
The SetGlobal
method in the CommandList
class is used to set a global GPU buffer for rendering operations. This method allows you to bind a GpuBuffer
to a specific StringToken
, which can then be accessed globally within the rendering pipeline.
Usage
To use the SetGlobal
method, you need to provide a StringToken
that identifies the global variable and a GpuBuffer
that you want to bind to this token. This setup is typically used in advanced rendering scenarios where you need to share data across different shaders or rendering passes.
Example
// Example of using SetGlobal method
var commandList = new CommandList();
var token = new StringToken("GlobalBuffer");
var gpuBuffer = new GpuBuffer();
// Set the global GPU buffer
commandList.SetGlobal(token, gpuBuffer);