<texture> (//pfx/texture)

A <texture> element is used to describe an image

A <texture> element describes an image. There are two main ways to describe it:
  1. Instruct the implementation to create it (by passing its format and so on..). In this case, most of the time, it would be used as a render target,
  2. Load it from disc. All of the textures will be defined automatically in this case.

A <texture> element can be referenced as a color attachment or input attachment by subpasses, or as a sampled textures (and input attachments) by pipelines.

XML Attributes (texture block)

ATTRIBUTE

Description

name

A text identifier for this texture.

apiVersion

(OPTIONAL) A string describing for which API versions this element will be active. If omitted, always active.

path

(OPTIONAL) The filename of the texture, defined in a way suitable for consumption by the application (raw, absolute, relative).

width/height/depth

(OPTIONAL) The relevant size (number of pixels) of a direction of an image.

Ignored if path is specified (the resolution will be that of the loaded texture).

If neither this nor path is specified, it defaults to screen size for both u and v coordinates.

mipmapped

(OPTIONAL) If path is not provided, mipmapped defines if mipmaps will be created for this texture.

Defaults to false.

Ignored if path is provided. If defined, a full mipmap chain will be provided.

Format

(OPTIONAL) Describes the surface/pixel type of the texture. This will be ignored if PATH is specified, where the surface type will be that of the loaded texture.

Minimum recognized values:

rgba8888 (default)

r8_unorm, r8_uint, r8_sint, r8g8_unorm, r8g8_uint, r8g8_sint

r8g8b8a8_unorm, r8g8b8a8_uint, r8g8b8a8_sint

r8g8b8a8_unorm_srgb,

b8g8r8a8_unorm, b8g8r8a8_unorm_srgb, a8b8g8r8_unorm

a8b8g8r8_uint, a8b8g8r8_sint, a8b8g8r8_unorm_srgb

a2b10g10r10_unorm, a2b10g10r10_uint,

r16_uint, r16_sint, r16_sfloat, r16g16_uint, r16g16_sint, r16g16_sfloat, r16g16b16a16_uint, r16g16b16a16_sint, r16g16b16a16_sfloat

r32_uint, r32_sintm r32_sfloat, r32g32_uint

r32g32_sint, r32g32_sfloat, r32g32b32a32_uint, r32g32b32a32_sint, r32g32b32a32_sfloat, d16

d24, d24s8, d32

This are the minimum values but what values are recognized is implementation–defined. The set of these values which are suitable for rendering may additionally be API-defined.

If a texture is used for rendering, the implementation is free to disregard this format and treat it as a hint, but it must issue a warning when doing so.