GpuTextureDesc¶
Import: import system.gpu;
This reference lists the public declarations for this part of the library. See Reading API signatures for parameter and result notation. Shader-only declarations can be used only inside shader entry points and helpers reached from them; using them elsewhere is a compile error.
GpuTextureDesc¶
The settings a new texture is created with. Start from GpuTextureDesc(...) and chain the settings you want to change. Every texture can be sampled by shaders and copied to and from the CPU.
constructor¶
Creates a 2D texture description with one mip, layer, and sample; width and height are texels.
width¶
Width in texels.
height¶
Height in texels.
format¶
How each texel is stored.
mip_level_count¶
The number of mip levels, each half the size of the previous one. Defaults to 1.
layer_count¶
The number of array layers. Defaults to 1.
sample_count¶
Samples per texel for multisampled render targets: 1 or 4. Defaults to 1.
is_render_target¶
Whether render passes can draw into the texture. Defaults to false.
is_storage¶
Whether shaders can write texels directly. Defaults to false.
mip_levels¶
Sets the number of mip levels, and returns this description.
layers¶
Sets the number of array layers, and returns this description.
samples¶
Sets the samples per texel, and returns this description.
render_target¶
Sets whether render passes can draw into the texture, and returns this description. Depth formats must be render targets to be used as depth buffers.
storage¶
Sets whether shaders can write texels directly, and returns this description.