Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
GfxEnums.hpp File Reference

Backend-agnostic graphics enumerations. More...

#include "../../core/Types.hpp"
#include <string>
Include dependency graph for GfxEnums.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  esengine::GfxVertexAttribute
struct  esengine::VertexLayoutDesc
 Describes how vertex-buffer bytes map to shader attributes. More...
struct  esengine::GfxBlockInfo
 Block footprint of a compressed format, the single source both backends use to size each mip level's upload. BC1/ETC2_RGB are 4x4x8B, the RGBA block formats 4x4x16B, ASTC's block matches its name. More...
struct  esengine::BufferDesc
 Immutable creation parameters of a GPU buffer. More...
struct  esengine::TextureDesc
 Immutable creation parameters of a 2D texture or 2D texture array. More...
struct  esengine::FramebufferDesc
 Attachments of an offscreen render target. The attach point of depthStencil follows its texture's pixel format. More...
struct  esengine::RenderPassDesc
 One render pass: a target, which attachments to clear on entry, and the clear values — full load-op semantics, no sticky device clear state. More...
struct  esengine::GfxDeviceIdentity
 Everything a human needs to know about one device loss. More...
struct  esengine::GfxDeviceLostInfo
struct  esengine::GfxShaderSource
 A program's source pair, tagged with the language it is written in. More...
struct  esengine::GfxComputeSource
 A compute program's source. Compute is WGSL only: GLSL ES 3.00 has no compute stage. More...
struct  esengine::GfxComputeBinding
 One resource a compute dispatch binds, at @group(0) @binding(binding). More...
struct  esengine::GfxAttribBinding
 Vertex attribute location binding applied before a program is linked. More...
struct  esengine::GfxUniformInfo

Namespaces

namespace  esengine

Typedefs

using esengine::AsyncComputeFence = i32

Enumerations

enum class  esengine::AsyncComputePriority { esengine::Default , esengine::High }
enum class  esengine::BufferHandle : u32 { esengine::Invalid = 0 }
enum class  esengine::TextureHandle : u32 { esengine::Invalid = 0 }
enum class  esengine::ShaderHandle : u32 { esengine::Invalid = 0 }
enum class  esengine::ComputeHandle : u32 { esengine::Invalid = 0 }
 A compute program (GfxDevice::createCompute); only a device that supportsCompute() issues one. More...
enum class  esengine::FramebufferHandle : u32 { esengine::Default = 0 }
 Handle 0 is the default framebuffer (backbuffer); it cannot be created or deleted. More...
enum class  esengine::ReadbackHandle : u32 { esengine::Invalid = 0 }
 An in-flight framebuffer readback (GfxDevice::requestReadback). More...
enum class  esengine::GfxReadbackStatus : u8 { esengine::Pending = 0 , esengine::Ready = 1 , esengine::Failed = 2 }
 State of an in-flight readback. GL completes at request time (first poll reports Ready); WebGPU resolves when its staging-buffer map lands. More...
enum class  esengine::TextureFilter : u8 { esengine::Nearest , esengine::Linear }
enum class  esengine::TextureWrap : u8 { esengine::Repeat , esengine::ClampToEdge , esengine::MirroredRepeat }
enum class  esengine::GfxBufferUsage : u8 { esengine::Vertex , esengine::Index , esengine::Uniform , esengine::Storage }
enum class  esengine::LayoutId : u8 {
  esengine::Batch = 0 , esengine::ParticleInstance = 1 , esengine::Shape = 2 , esengine::MeshInstance = 3 ,
  esengine::Sky = 4
}
 Identifies a transient vertex stream / vertex format. Each layout has its own VBO+EBO+VAO in TransientBufferPool and is part of a pipeline's identity. More...
enum class  esengine::MeshChannel : u8 {
  esengine::Position = 0 , esengine::Color = 1 , esengine::TexCoord0 = 2 , esengine::Normal = 3 ,
  esengine::Tangent = 4 , esengine::Joints = 5 , esengine::Weights = 6 , esengine::TexCoord1 = 7
}
 What a mesh vertex channel MEANS, and the attribute location it binds to. More...
enum class  esengine::MeshChannelType : u8 {
  esengine::Float32 = 0 , esengine::UNorm8 = 1 , esengine::UInt16 = 2 , esengine::UInt8 = 3 ,
  esengine::UNorm16 = 4
}
 How a channel's components are stored, as the file spells it. More...
enum class  esengine::GfxDataType : u8 {
  esengine::Float , esengine::Int , esengine::UnsignedByte , esengine::UnsignedShort ,
  esengine::UnsignedInt
}
enum class  esengine::VertexLayoutHandle : u32 { esengine::Invalid = 0 }
enum class  esengine::GfxStencilFunc : u8 {
  esengine::Never , esengine::Less , esengine::Equal , esengine::LEqual ,
  esengine::Greater , esengine::NotEqual , esengine::GEqual , esengine::Always
}
enum class  esengine::GfxStencilOp : u8 {
  esengine::Keep , esengine::Zero , esengine::Replace , esengine::Incr ,
  esengine::Decr , esengine::Invert , esengine::IncrWrap , esengine::DecrWrap
}
enum class  esengine::GfxPixelFormat : u8 {
  esengine::RGB8 , esengine::RGBA8 , esengine::SRGB8_ALPHA8 , esengine::RGBA16F ,
  esengine::RGBA32F , esengine::DepthComponent24 , esengine::Depth24Stencil8
}
enum class  esengine::GfxCompressedFormat : u8 {
  esengine::ETC2_RGB8 , esengine::ETC2_RGBA8 , esengine::ASTC_4x4 , esengine::ASTC_8x8 ,
  esengine::S3TC_DXT1 , esengine::S3TC_DXT5 , esengine::ETC2_RGBA8_SRGB , esengine::ASTC_4x4_SRGB ,
  esengine::S3TC_DXT5_SRGB
}
 GPU-compressed texture internal formats for createCompressedTexture. More...
enum class  esengine::GfxStringName : u8 { esengine::Version , esengine::Renderer , esengine::Vendor , esengine::ShadingLanguageVersion }
 Backend identification strings. More...
enum class  esengine::GfxIntParam : u8 { esengine::MaxTextureSize , esengine::MaxTextureImageUnits , esengine::MaxVertexAttribs }
 Backend integer capabilities/limits. More...
enum class  esengine::GfxDeviceStatus : u8 { esengine::Live , esengine::Lost , esengine::Recovering , esengine::Dead }
 Whether the device can still be drawn to. More...
enum class  esengine::GfxDeviceLostReason : u8 {
  esengine::Unknown , esengine::ContextLost , esengine::OutOfMemory , esengine::Reset ,
  esengine::Removed , esengine::Destroyed , esengine::Validation , esengine::Internal
}
 Why the device was lost. The report leads with this. More...
enum class  esengine::ClipDepthRange : u8 { esengine::MinusOneToOne , esengine::ZeroToOne }
 What a device's clip volume does with depth. More...
enum class  esengine::GfxShaderLanguage : u8 { esengine::GLSL_ES300 = 0 , esengine::WGSL = 1 }
 Shader source language a backend consumes. More...
enum class  esengine::GfxShaderStage : u8 { esengine::None , esengine::Vertex , esengine::Fragment , esengine::Link }
 Which pipeline stage rejected a program during createProgram(). More...
enum class  esengine::GfxUniformType : u8 {
  esengine::Unknown , esengine::Float , esengine::Vec2 , esengine::Vec3 ,
  esengine::Vec4 , esengine::Int , esengine::IVec2 , esengine::IVec3 ,
  esengine::IVec4 , esengine::Bool , esengine::Mat2 , esengine::Mat3 ,
  esengine::Mat4 , esengine::Sampler2D , esengine::SamplerCube , esengine::Sampler2DArray
}

Functions

constexpr bool esengine::meshShaderReads (MeshChannel c)
 Whether the mesh shaders READ a channel, as opposed to the file carrying it.
u32 esengine::gfxBytesPerPixel (GfxPixelFormat fmt)
 Bytes one pixel occupies in the CALLER's upload buffer — the single source both backends size a read of caller-owned pixels with. A backend's own texel size may differ (RGB8 widens to RGBA8 on WebGPU). Depth formats are attachment-only and never uploaded.
GfxBlockInfo esengine::gfxCompressedBlockInfo (GfxCompressedFormat fmt)
u32 esengine::gfxWholeBlockLevels (GfxCompressedFormat fmt, u32 width, u32 height, u32 mipLevels)
 How many mip levels of a width x height image are WHOLE blocks, counting from the base — the levels a compressed copy may write, since a copy whose size is not a multiple of the block is refused. 72x72 has two (72, 36; 18 stops it) and 70x70 has none, which is what makes an image uncompressible rather than merely short of mips.
u32 esengine::gfxCompressedPyramidBytes (GfxCompressedFormat fmt, u32 width, u32 height, u32 mipLevels)
 Total bytes of a full mip pyramid (levels 0..mipLevels-1) for a base-size compressed texture — the block-aligned sum both the transcoder (packing) and the device (uploading) agree on.
std::string esengine::gfxFormatDeviceLost (const GfxDeviceLostInfo &info)
 The whole report as one line, for a log or a crash report.
const char * esengine::gfxDeviceLostReasonName (GfxDeviceLostReason reason)
 Human-readable reason, for logs and diagnostics reports.

Variables

constexpr AsyncComputeFence esengine::kNoAsyncComputeFence = -1
static constexpr u32 esengine::LAYOUT_COUNT = 5
static constexpr u32 esengine::MESH_INSTANCE_TEXELS = 8
static constexpr u32 esengine::MESH_INSTANCE_TEXEL_MODEL = 0
static constexpr u32 esengine::MESH_INSTANCE_TEXEL_TINT = 3
static constexpr u32 esengine::MESH_INSTANCE_TEXEL_NORMAL = 4
static constexpr u32 esengine::MESH_INSTANCE_TEXEL_LIGHTMAP = 7
static constexpr u32 esengine::MESH_INSTANCE_STRIDE = MESH_INSTANCE_TEXELS * 16
static constexpr u32 esengine::PARTICLE_INSTANCE_STRIDE = 60
static constexpr u32 esengine::MESH_INSTANCE_TEXTURE_WIDTH = 2048
static constexpr u32 esengine::MESH_INSTANCE_MAX_RECORDS
static constexpr u32 esengine::MESH_INSTANCE_TEXTURE_UNIT = 15
static constexpr u32 esengine::MESH_MAX_BONES = 256
static constexpr u32 esengine::MESH_MAX_ACTIVE_MORPHS = 64
static constexpr u32 esengine::MORPH_TEXTURE_WIDTH = 2048
static constexpr u32 esengine::MORPH_MAX_TEXELS = MORPH_TEXTURE_WIDTH * MORPH_TEXTURE_WIDTH
static constexpr u32 esengine::MESH_VARIANTS = 4096
static constexpr u32 esengine::MAX_VERTEX_ATTRIBUTES = 16
static constexpr u32 esengine::MAX_VERTEX_BUFFER_SLOTS = 2

Detailed Description

Backend-agnostic graphics enumerations.

Replaces raw GL enum constants in the GfxDevice interface so that upper-layer code has zero dependency on OpenGL headers.

Author
ESEngine Team
Date
2026

Definition in file GfxEnums.hpp.