TextureBuilder
public sealed struct TextureBuilder Methods
TextureBuilder WithInitialColor(Color color) Once the texture is created it will be cleared to this color
TextureBuilder WithStaticUsage() Provides a hint to the GPU that this texture will not be modified.
TextureBuilder WithSemiStaticUsage() Provides a hint to the GPU that this texture will only be updated sometimes.
TextureBuilder WithDynamicUsage() Provides a hint to the GPU that this texture will be updated regularly. (almost every frame)
TextureBuilder WithGPUOnlyUsage() Specify the texture to ONLY be used on the GPU on not allow CPU access.
TextureBuilder WithSize(Int32 width, Int32 height) TextureBuilder WithSize(Vector2 size) TextureBuilder WithWidth(Int32 width) TextureBuilder WithHeight(Int32 height) TextureBuilder WithDepth(Int32 depth) TextureBuilder WithMSAA(MultisampleAmount amount) TextureBuilder WithMultiSample2X() Sets the texture to use 2x multisampling.
TextureBuilder WithMultiSample4X() Sets the texture to use 4x multisampling.
TextureBuilder WithMultiSample6X() Sets the texture to use 6x multisampling.
TextureBuilder WithMultiSample8X() Sets the texture to use 8x multisampling.
TextureBuilder WithMultiSample16X() Sets the texture to use 16x multisampling.
TextureBuilder WithScreenMultiSample() Sets the texture to use the same multisampling as whatever the screen/framebuffer uses
TextureBuilder WithFormat(ImageFormat format) The internal texture format to use.
format — Texture format TextureBuilder WithScreenFormat() Sets the internal texture format to use the same format as the screen/frame buffer.
TextureBuilder WithDepthFormat() Uses the same depth format as what the screen/framebuffer uses.
TextureBuilder WithMips(Int32? mips = null) TextureBuilder WithUAVBinding(Boolean uav = True) Support binding the texture as a Unordered Access View in a compute or pixel shader. This is required for binding a texture within a compute shader.
Texture Create(String name = null, Boolean anonymous = True, ReadOnlySpan<Byte> data = null, Int32 dataLength = 0)