Skip to content

RDTextureFormat

Inherits: RefCounted < Object

Texture format (used by RenderingDevice).

This object is used by RenderingDevice.

Type Name Default
int array_layers 1
int depth 1
RenderingDevice.DataFormat format 8
int height 1
bool is_discardable false
bool is_resolve_buffer false
int mipmaps 1
RenderingDevice.TextureSamples samples 0
RenderingDevice.TextureType texture_type 1
BitField[RenderingDevice.TextureUsageBits] usage_bits 0
int width 1
Returns Method
void add_shareable_format(format: RenderingDevice.DataFormat)
void remove_shareable_format(format: RenderingDevice.DataFormat)

array_layers

int array_layers = 1

The number of layers in the texture. Only relevant for 2D texture arrays.

depth

int depth = 1

The texture’s depth (in pixels). This is always 1 for 2D textures.

format

RenderingDevice.DataFormat format = 8

The texture’s pixel data format.

height

int height = 1

The texture’s height (in pixels).

is_discardable

bool is_discardable = false

If a texture is discardable, its contents do not need to be preserved between frames. This flag is only relevant when the texture is used as target in a draw list.

This information is used by RenderingDevice to figure out if a texture’s contents can be discarded, eliminating unnecessary writes to memory and boosting performance.

is_resolve_buffer

bool is_resolve_buffer = false

The texture will be used as the destination of a resolve operation.

mipmaps

int mipmaps = 1

The number of mipmaps available in the texture.

samples

RenderingDevice.TextureSamples samples = 0

The number of samples used when sampling the texture.

texture_type

RenderingDevice.TextureType texture_type = 1

The texture type.

usage_bits

BitField[RenderingDevice.TextureUsageBits] usage_bits = 0

The texture’s usage bits, which determine what can be done using the texture.

width

int width = 1

The texture’s width (in pixels).

add_shareable_format

void add_shareable_format(format: RenderingDevice.DataFormat)

Adds format as a valid format for the corresponding RDTextureView’s RDTextureView.format_override property. If any format is added as shareable, then the main format must also be added.

remove_shareable_format

void remove_shareable_format(format: RenderingDevice.DataFormat)

Removes format from the list of valid formats that the corresponding RDTextureView’s RDTextureView.format_override property can be set to.