Description
The WithGPUOnlyUsage
method is part of the Texture3DBuilder
class in the Sandbox namespace. This method configures the texture to be used exclusively on the GPU, meaning it will not be accessible from the CPU. This can be beneficial for performance optimization in scenarios where CPU access is not required, as it can reduce memory overhead and improve data transfer speeds between the CPU and GPU.
Usage
To use the WithGPUOnlyUsage
method, first create an instance of Texture3DBuilder
. Then, call the WithGPUOnlyUsage
method on this instance to set the texture usage to GPU-only. This method is chainable, allowing you to configure other properties of the texture before finalizing it with the Finish
method.
Example
// Create a new Texture3DBuilder instance
Texture3DBuilder builder = new Texture3DBuilder();
// Configure the texture to be GPU-only
builder.WithGPUOnlyUsage();
// Further configuration can be done here
// ...
// Finalize and create the texture
Texture texture = builder.Finish();