Class Texture

A 2D image stored in GPU memory.

class Texture
  : BindingDescriptor
  , IResource ;

Constructors

NameDescription
this (size, usage, shaderStage) Initialize a new Texture.
this (name, size, usage, shaderStage) Initialize a new named Texture.
this (size, bindingLocation, usage, shaderStage) Initialize a new Texture.
this (name, size, bindingLocation, usage, shaderStage) Initialize a new named Texture.
this (size, data, bindingLocation, usage, shaderStage) Initialize a new Texture with initial data.
this (name, size, data, bindingLocation, usage, shaderStage) Initialize a new named Texture with initial data.

Fields

NameTypeDescription
defaultUsage const(gfx.graal.image.ImageUsage)Default value of a Texture's usage.
format const(gfx.graal.format.Format)Data format of a Texture's data.
usage const(gfx.graal.image.ImageUsage)Manner in which this Texture will be used. Defaults to ImageUsage.sampled | ImageUsage.transferDst.
onChanged Event!(const(ubyte)[])Fired when this BindingDescriptor's data changes.

Properties

NameTypeDescription
data[get] const(ubyte[])Texture data.
dimensions[get] SizeSize of this Texture, in pixels.
initialized[get] boolWhether this Shader has been successfully initialized.
size[get] ulong
bindingLocation[get] uintDescriptor binding location, e.g. layout(binding = 0) in GLSL.
dirty[get] boolWhether this uniform's data is new or changed and needs to be uploaded to the GPU.
shaderStage[get] gfx.graal.pipeline.ShaderStageWhich shader stages this descriptor is going to be referenced.

Methods

NameDescription
initialize (device) Initialize this Texture.
resize (size) Resize this Texture.
update (data) Update this Texture's data.