TextureBuilder WithSemiStaticUsage()

book_4_sparkGenerated
code_blocksInput

Description

The WithSemiStaticUsage method of the TextureBuilder class provides a hint to the GPU that the texture will only be updated occasionally. This can be useful for textures that do not change frequently, allowing the GPU to optimize its handling of the texture data.

Usage

Use the WithSemiStaticUsage method when you are building a texture that will be updated infrequently. This method is part of a fluent interface, allowing you to chain multiple configuration methods together when constructing a texture.

Example

// Example of using WithSemiStaticUsage
TextureBuilder builder = new TextureBuilder();
Texture texture = builder
    .WithSize(256, 256)
    .WithFormat(ImageFormat.RGBA8)
    .WithSemiStaticUsage()
    .Create("MyTexture", false, data, data.Length);