Description
The WithUAVBinding
method is part of the TextureBuilder
class in the Sandbox namespace. This method allows you to specify whether the texture should be created with Unordered Access View (UAV) binding. UAVs enable the texture to be used for read/write operations in shaders, which is useful for advanced rendering techniques such as compute shaders.
Usage
To use the WithUAVBinding
method, call it on an instance of TextureBuilder
and pass a boolean value indicating whether UAV binding should be enabled. This method returns the TextureBuilder
instance, allowing for method chaining.
Example
// Example of using WithUAVBinding method
TextureBuilder textureBuilder = new TextureBuilder();
textureBuilder = textureBuilder.WithUAVBinding(true);
// Continue configuring the texture
textureBuilder = textureBuilder.WithSize(1024, 1024)
.WithFormat(ImageFormat.RGBA8);
// Create the texture
Texture texture = textureBuilder.Create("MyTexture", false, data, data.Length);