Description
The WithSemiStaticUsage
method of the TextureBuilder
class provides a hint to the GPU that the texture will only be updated occasionally. This can help optimize performance by allowing the GPU to manage resources more efficiently, knowing that the texture data will not change frequently.
Usage
Use this method when you are building a texture that will be updated infrequently. This is suitable for textures that change occasionally, such as those used for static or semi-static elements in a scene.
Example
// Example of using WithSemiStaticUsage
TextureBuilder builder = new TextureBuilder();
builder = builder.WithSize(256, 256)
.WithFormat(ImageFormat.RGBA8)
.WithSemiStaticUsage();
Texture texture = builder.Create("MyTexture", false, data, data.Length);