Skip to main content
A GPU texture (2-D, cube, 3-D, or array).

Fields

width

Width of mip 0 in texels.

height

Height of mip 0 in texels.

format

Pixel format.

Constructors

new

Methods

view

Create a view into a sub-range of this texture. All fields optional; omit desc entirely for a full-texture view. Views are immutable. Create them once at init next to the texture and reuse them every frame. Calling view() in a per-frame draw callback creates and destroys a native GPU object each frame.

upload

Upload pixel data to a specific mip / layer.