|
Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
|
Classes | |
| struct | BlendStateWGPU |
| One RHI blend mode as a full WebGPU blend state (color + alpha). More... | |
Functions | |
| BlendStateWGPU | toWGPUBlend (BlendMode mode, bool layerAlpha=false) |
| Maps BlendMode to its WebGPU blend components — mirrors GLDevice's setBlendMode table (Overlay renders as Normal there too; the real overlay math lives in shaders). | |
| WGPUVertexFormat | toWGPUVertexFormat (u8 components, GfxDataType type, bool normalized) |
| Maps one RHI attribute (components × type × normalized) to a WGPUVertexFormat, or kInvalidVertexFormat for combinations the engine never produces. | |
| WGPUIndexFormat | toWGPUIndexFormat (GfxDataType type) |
| Index type for drawElements' GfxDataType. | |
| WGPUTextureFormat | toWGPUTextureFormat (GfxPixelFormat fmt) |
| u32 | wgpuBytesPerPixel (GfxPixelFormat fmt) |
| WGPUTextureFormat | toWGPUCompressedFormat (GfxCompressedFormat fmt) |
| WGPUFeatureName | compressionFeatureFor (GfxCompressedFormat fmt) |
| WGPUFilterMode | toWGPUFilter (TextureFilter filter) |
| WGPUAddressMode | toWGPUAddressMode (TextureWrap wrap) |
| WGPUBufferUsage | toWGPUBufferUsage (GfxBufferUsage usage) |
| WGPUCompareFunction | toWGPUCompare (GfxStencilFunc func) |
| WGPUStencilOperation | toWGPUStencilOp (GfxStencilOp op) |
| WGPUStencilFaceState | toWGPUStencilFace (GfxStencilMode mode) |
| The engine's two stencil modes as WebGPU face states (same table as GLDevice::applyPipeline: Write = Always/Replace + no color write, Test = Equal/Keep). | |
| u32 | toWGPUStencilWriteMask (GfxStencilMode mode) |
| Stencil write mask per mode — the applyStencilMode table: Write fills all planes, Test reads without writing, Off never touches stencil. | |
| WGPUDepthStencilState | toWGPUDepthStencil (const PipelineDesc &desc, WGPUTextureFormat format) |
| A pipeline's full depth-stencil state against a pass attachment format. | |
| bool | hasStencilPlanes (WGPUTextureFormat format) |
| True when a depth-stencil format carries stencil planes (drives whether a pass may set stencil load/store ops — Depth24Plus alone must not). | |
| WGPULoadOp | toWGPULoadOp (bool clearRequested, bool scoped) |
| WGPUColor | toWGPUClearColor (const RenderPassDesc &desc) |
| WGPUCullMode | toWGPUCullMode (bool enabled, bool front) |
| Cull state (PipelineDesc.cullEnabled/cullFront). Front face is CCW, matching the GL backend's default winding. | |
| u64 | scanWGSLTextureKindMask (const char *source, u32 group, const char *kind) |
| Bit mask of the group's bindings whose declaration names the type kind. | |
| u64 | scanWGSLDepthTextureMask (const char *source, u32 group) |
| Bit mask of the group's bindings a WGSL source declares as DEPTH textures. | |
| u64 | scanWGSLArrayTextureMask (const char *source, u32 group) |
| Bit mask of the group's bindings a WGSL source declares as texture_2d_array. | |
| u64 | scanWGSLVolumeTextureMask (const char *source, u32 group) |
| Bit mask of the group's bindings a WGSL source declares as texture_3d. | |
| u32 | alignedWriteSize (u32 size) |
| bool | needsWriteStaging (u32 size) |
| bool | writeFitsInBuffer (u32 offset, u32 size, u32 capacity) |
Variables | |
| constexpr WGPUVertexFormat | kInvalidVertexFormat = WGPUVertexFormat_Force32 |
| Sentinel for "no WGPU spelling": the header defines no Undefined vertex format, so the enum's non-value stands in. Callers treat it as a hard error. | |
| constexpr u32 | kGroup1TextureUnits = WGSL_MAX_TEXTURE_UNITS |
| Texture units the group-1 convention spans — see WGSL_MAX_TEXTURE_UNITS. | |
WriteBuffer's size (and offset) must be a 4-byte multiple; buffers are allocated rounded up so the slack exists. Callers supply exactly size bytes, so an unaligned size must be staged, never read up to alignedWriteSize in place.
Definition at line 445 of file WebGPUMappings.hpp.
|
inline |
The device feature that gates a compressed-format family (BC / ETC2 / ASTC).
Definition at line 197 of file WebGPUMappings.hpp.
References esengine::ASTC_4x4, esengine::ASTC_4x4_SRGB, esengine::ASTC_8x8, esengine::ETC2_RGB8, esengine::ETC2_RGBA8, esengine::ETC2_RGBA8_SRGB, esengine::S3TC_DXT1, esengine::S3TC_DXT5, and esengine::S3TC_DXT5_SRGB.
Referenced by esengine::WebGPUDevice::supportsCompressedFormat().
|
inline |
True when a depth-stencil format carries stencil planes (drives whether a pass may set stencil load/store ops — Depth24Plus alone must not).
Definition at line 347 of file WebGPUMappings.hpp.
Referenced by esengine::WebGPUDevice::clearStencil().
|
inline |
Definition at line 446 of file WebGPUMappings.hpp.
Referenced by esengine::WebGPUDevice::backendUpdateBuffer().
Bit mask of the group's bindings a WGSL source declares as texture_2d_array.
Such a binding's layout entry is viewDimension = 2DArray, and only an array view binds under it.
Definition at line 430 of file WebGPUMappings.hpp.
References scanWGSLTextureKindMask().
Referenced by esengine::WebGPUDevice::backendCreateProgram().
Bit mask of the group's bindings a WGSL source declares as DEPTH textures.
A texture_depth_2d binding needs sampleType = Depth in its layout entry and a depth-aspect view under it; bound as an ordinary float texture WebGPU rejects the pipeline.
Definition at line 422 of file WebGPUMappings.hpp.
References scanWGSLTextureKindMask().
Referenced by esengine::WebGPUDevice::backendCreateProgram().
|
inline |
Bit mask of the group's bindings whose declaration names the type kind.
Same source scan as scanWGSLBindingMask, reading the declaration that follows each binding.
Definition at line 391 of file WebGPUMappings.hpp.
Referenced by scanWGSLArrayTextureMask(), scanWGSLDepthTextureMask(), and scanWGSLVolumeTextureMask().
Bit mask of the group's bindings a WGSL source declares as texture_3d.
Such a binding's layout entry is viewDimension = 3D, and only a volume's view binds under it.
Definition at line 438 of file WebGPUMappings.hpp.
References scanWGSLTextureKindMask().
Referenced by esengine::WebGPUDevice::backendCreateProgram().
|
inline |
Definition at line 216 of file WebGPUMappings.hpp.
References esengine::ClampToEdge, esengine::MirroredRepeat, and esengine::Repeat.
|
inline |
Maps BlendMode to its WebGPU blend components — mirrors GLDevice's setBlendMode table (Overlay renders as Normal there too; the real overlay math lives in shaders).
Definition at line 48 of file WebGPUMappings.hpp.
References esengine::Additive, esengine::Darken, esengine::Lighten, esengine::Multiply, esengine::None, esengine::Normal, esengine::Overlay, esengine::PmaAdditive, esengine::PremultipliedAlpha, and esengine::Screen.
|
inline |
Definition at line 229 of file WebGPUMappings.hpp.
References esengine::Index, esengine::Storage, esengine::Uniform, and esengine::Vertex.
|
inline |
Definition at line 365 of file WebGPUMappings.hpp.
References esengine::RenderPassDesc::clearColorValue.
|
inline |
Definition at line 245 of file WebGPUMappings.hpp.
References esengine::Always, esengine::Equal, esengine::GEqual, esengine::Greater, esengine::LEqual, esengine::Less, esengine::Never, and esengine::NotEqual.
|
inline |
Definition at line 181 of file WebGPUMappings.hpp.
References esengine::ASTC_4x4, esengine::ASTC_4x4_SRGB, esengine::ASTC_8x8, esengine::ETC2_RGB8, esengine::ETC2_RGBA8, esengine::ETC2_RGBA8_SRGB, esengine::S3TC_DXT1, esengine::S3TC_DXT5, and esengine::S3TC_DXT5_SRGB.
Referenced by esengine::WebGPUDevice::backendCreateCompressedTexture(), esengine::WebGPUDevice::estimatedGpuBytes(), and esengine::WebGPUDevice::supportsCompressedFormat().
|
inline |
Cull state (PipelineDesc.cullEnabled/cullFront). Front face is CCW, matching the GL backend's default winding.
Definition at line 372 of file WebGPUMappings.hpp.
|
inline |
A pipeline's full depth-stencil state against a pass attachment format.
GL semantics carried over exactly: a disabled depth test neither compares NOR writes (glDepthMask only applies while GL_DEPTH_TEST is on); an enabled one compares with GL's default Less func. Stencil faces/masks come from the same tables applyStencilMode uses.
Definition at line 327 of file WebGPUMappings.hpp.
References esengine::PipelineDesc::depthBias, esengine::PipelineDesc::depthEqual, esengine::PipelineDesc::depthTest, esengine::PipelineDesc::depthWrite, esengine::PipelineDesc::stencil, toWGPUStencilFace(), and toWGPUStencilWriteMask().
|
inline |
Definition at line 212 of file WebGPUMappings.hpp.
References esengine::Nearest.
|
inline |
Index type for drawElements' GfxDataType.
Definition at line 147 of file WebGPUMappings.hpp.
References esengine::UnsignedInt, and esengine::UnsignedShort.
|
inline |
Definition at line 359 of file WebGPUMappings.hpp.
|
inline |
The engine's two stencil modes as WebGPU face states (same table as GLDevice::applyPipeline: Write = Always/Replace + no color write, Test = Equal/Keep).
Definition at line 276 of file WebGPUMappings.hpp.
References esengine::Decrement, esengine::Increment, esengine::Off, esengine::Test, esengine::TestOutside, esengine::Write, and esengine::Zero.
Referenced by toWGPUDepthStencil().
|
inline |
Definition at line 259 of file WebGPUMappings.hpp.
References esengine::Decr, esengine::DecrWrap, esengine::Incr, esengine::IncrWrap, esengine::Invert, esengine::Keep, esengine::Replace, and esengine::Zero.
|
inline |
Stencil write mask per mode — the applyStencilMode table: Write fills all planes, Test reads without writing, Off never touches stencil.
Definition at line 316 of file WebGPUMappings.hpp.
References esengine::writesStencil().
Referenced by toWGPUDepthStencil().
|
inline |
Definition at line 159 of file WebGPUMappings.hpp.
References esengine::Depth24Stencil8, esengine::DepthComponent24, esengine::RGB8, esengine::RGBA16F, esengine::RGBA32F, esengine::RGBA8, and esengine::SRGB8_ALPHA8.
|
inline |
Maps one RHI attribute (components × type × normalized) to a WGPUVertexFormat, or kInvalidVertexFormat for combinations the engine never produces.
Definition at line 106 of file WebGPUMappings.hpp.
References esengine::Float, esengine::Int, kInvalidVertexFormat, esengine::UnsignedByte, esengine::UnsignedInt, and esengine::UnsignedShort.
Referenced by esengine::WebGPUDevice::backendAcceptsVertexLayout().
|
inline |
Bytes per pixel of an uncompressed upload in fmt (RGB8 expands to RGBA8).
Definition at line 175 of file WebGPUMappings.hpp.
References esengine::RGBA16F, and esengine::RGBA32F.
Whether a write lands inside a buffer. Subtraction, not addition: offset + size can wrap past UINT32_MAX and compare as in-range.
Definition at line 450 of file WebGPUMappings.hpp.
Referenced by esengine::WebGPUDevice::backendUpdateBuffer().
|
inlineconstexpr |
Texture units the group-1 convention spans — see WGSL_MAX_TEXTURE_UNITS.
Definition at line 382 of file WebGPUMappings.hpp.
|
inlineconstexpr |
Sentinel for "no WGPU spelling": the header defines no Undefined vertex format, so the enum's non-value stands in. Callers treat it as a hard error.
Definition at line 101 of file WebGPUMappings.hpp.
Referenced by esengine::WebGPUDevice::backendAcceptsVertexLayout(), and toWGPUVertexFormat().