TextureCubeBuilder WithGPUOnlyUsage()

book_4_sparkGenerated
code_blocksInput

Description

The WithGPUOnlyUsage method is part of the TextureCubeBuilder class in the Sandbox namespace. This method configures the texture cube to be used exclusively on the GPU, meaning it will not be accessible from the CPU. This can be beneficial for performance in scenarios where CPU access is not required, as it may reduce memory overhead and improve data transfer speeds between the CPU and GPU.

Usage

To use the WithGPUOnlyUsage method, you must first create an instance of TextureCubeBuilder. Then, call the method on this instance to set the GPU-only usage flag. This method returns the same TextureCubeBuilder instance, allowing for method chaining.

Example

// Create a new TextureCubeBuilder instance
TextureCubeBuilder builder = new TextureCubeBuilder();

// Configure the builder to use GPU-only usage
builder = builder.WithGPUOnlyUsage();

// Continue configuring the builder as needed
builder = builder.WithSize(256, 256)
                 .WithFormat(ImageFormat.RGBA8)
                 .WithMips(1);

// Finish building the texture
Texture texture = builder.Finish();