Description
The WithDynamicUsage
method of the TextureBuilder
class provides a hint to the GPU that the texture will be updated regularly, almost every frame. This is useful for textures that are expected to change frequently, allowing the GPU to optimize its handling of the texture data accordingly.
Usage
To use the WithDynamicUsage
method, call it on an instance of TextureBuilder
when you are configuring a texture that will be updated frequently. This method is part of a fluent interface, so it returns the TextureBuilder
instance, allowing you to chain further configuration methods.
Example
// Example of using WithDynamicUsage in a texture building process
TextureBuilder builder = new TextureBuilder();
Texture texture = builder
.WithSize(1024, 1024) // Set the size of the texture
.WithDynamicUsage() // Indicate that the texture will be updated frequently
.Create("DynamicTexture", false, data, data.Length);