Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
esengine::TextureDesc Struct Reference

Immutable creation parameters of a 2D texture or 2D texture array. More...

#include <GfxEnums.hpp>

Public Member Functions

bool layered () const
 An array or a volume: pixels given slice by slice, fixed at creation, never an attachment.

Public Attributes

u32 width = 1
u32 height = 1
u32 samples = 1
GfxPixelFormat format = GfxPixelFormat::RGBA8
TextureFilter minFilter = TextureFilter::Linear
TextureFilter magFilter = TextureFilter::Linear
TextureWrap wrapS = TextureWrap::ClampToEdge
TextureWrap wrapT = TextureWrap::ClampToEdge
bool mipmaps = false
bool flipY = false
bool storage = false
u32 layers = 1
bool volume = false
bool asyncShareable = false
 Allow a native compute queue to share this single-sample colour target.

Detailed Description

Immutable creation parameters of a 2D texture or 2D texture array.

flipY applies to the initial pixel upload only (WebGL upload state; native backends flip CPU-side at load time).

Definition at line 414 of file GfxEnums.hpp.

Member Function Documentation

◆ layered()

bool esengine::TextureDesc::layered ( ) const
inline

An array or a volume: pixels given slice by slice, fixed at creation, never an attachment.

Definition at line 444 of file GfxEnums.hpp.

References layers, and volume.

Referenced by esengine::GLDevice::copyFramebufferColor(), and esengine::GfxDevice::createTexture().

Member Data Documentation

◆ asyncShareable

bool esengine::TextureDesc::asyncShareable = false

Allow a native compute queue to share this single-sample colour target.

Definition at line 441 of file GfxEnums.hpp.

◆ flipY

bool esengine::TextureDesc::flipY = false

◆ format

◆ height

◆ layers

u32 esengine::TextureDesc::layers = 1

Above 1 the texture is a 2D ARRAY of this many layers, sampled through sampler2DArray / texture_2d_array. Its pixels are the layers back to back, each width * height texels. Colour, single-sample and sampled only: never an attachment, a storage target or compressed, and flipY does not apply.

Definition at line 434 of file GfxEnums.hpp.

Referenced by esengine::GLDevice::backendCreateTexture(), and layered().

◆ magFilter

◆ minFilter

◆ mipmaps

◆ samples

u32 esengine::TextureDesc::samples = 1

Samples per pixel. Above 1 the attachment is MULTISAMPLED and cannot be sampled by a shader — it is only ever drawn into and resolved from. Ask GfxDevice::maxSamples() first; a backend that answers 1 wants 1.

Definition at line 420 of file GfxEnums.hpp.

Referenced by esengine::GLDevice::backendCreateTexture(), esengine::GLDevice::copyFramebufferColor(), and esengine::GfxDevice::createTexture().

◆ storage

bool esengine::TextureDesc::storage = false

Writable from a compute shader as a storage texture. RGBA8, RGBA16F and RGBA32F only, and only on a device that supportsCompute(); a texture asked for this elsewhere is created without it.

Definition at line 430 of file GfxEnums.hpp.

Referenced by esengine::GfxDevice::createTexture().

◆ volume

bool esengine::TextureDesc::volume = false

A 3D texture, layers deep, sampled through sampler3D / texture_3d: filtered across its depth as well as its rows, which an array never is. Its pixels are its slices back to back, as an array's layers are, and it carries every restriction an array does.

Definition at line 438 of file GfxEnums.hpp.

Referenced by esengine::GLDevice::backendCreateTexture(), esengine::GfxDevice::createTexture(), and layered().

◆ width

◆ wrapS

◆ wrapT


The documentation for this struct was generated from the following file:
  • /home/runner/work/estella/estella/src/esengine/renderer/rhi/GfxEnums.hpp