Description
The WithUAVBinding
method is a member 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 and write operations in shaders, which is useful for compute shaders and other advanced rendering techniques.
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
TextureBuilder builder = new TextureBuilder();
builder.WithUAVBinding(true);
// Continue configuring the texture
builder.WithSize(1024, 1024)
.WithFormat(ImageFormat.RGBA8)
.WithDynamicUsage();
// Create the texture
Texture texture = builder.Create("MyTexture", false, data, data.Length);