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

One resource a compute dispatch binds, at @group(0) @binding(binding). More...

#include <GfxEnums.hpp>

Public Types

enum class  Kind : u8 {
  Uniform , StorageRead , Storage , Texture ,
  StorageTexture , Sampler , DepthTexture
}

Static Public Member Functions

static GfxComputeBinding uniform (u32 binding, BufferHandle buffer, u32 offset=0, u32 size=0)
static GfxComputeBinding storageRead (u32 binding, BufferHandle buffer, u32 offset=0, u32 size=0)
static GfxComputeBinding storage (u32 binding, BufferHandle buffer, u32 offset=0, u32 size=0)
static GfxComputeBinding sampled (u32 binding, TextureHandle texture)
static GfxComputeBinding storageTexture (u32 binding, TextureHandle texture)
static GfxComputeBinding depth (u32 binding, TextureHandle texture)
static GfxComputeBinding sampler (u32 binding, TextureFilter filter)

Public Attributes

Kind kind = Kind::Uniform
u32 binding = 0
BufferHandle buffer = BufferHandle::Invalid
u32 offset = 0
 Bytes into the buffer (a multiple of 256 for a uniform, 4 for storage) and how many; 0 = the rest.
u32 size = 0
TextureHandle texture = TextureHandle::Invalid
TextureFilter filter = TextureFilter::Linear
 A Sampler's filter.

Detailed Description

One resource a compute dispatch binds, at @group(0) @binding(binding).

The bind-group layout is built from the list itself, so the shader's declarations have to say the same thing: Uniform is var<uniform>, StorageRead is var<storage, read>, Storage is var<storage, read_write>, Texture is a texture_2d<f32> (or texture_depth_2d for a depth texture) read with textureLoad, StorageTexture is a texture_storage_2d<FORMAT, write> whose format is the texture's, and Sampler is a sampler.

Definition at line 689 of file GfxEnums.hpp.

Member Enumeration Documentation

◆ Kind

Enumerator
Uniform 
StorageRead 
Storage 
Texture 
StorageTexture 
Sampler 
DepthTexture 

Definition at line 690 of file GfxEnums.hpp.

Member Function Documentation

◆ depth()

GfxComputeBinding esengine::GfxComputeBinding::depth ( u32 binding,
TextureHandle texture )
inlinestatic

A depth texture, read with textureLoad as texture_depth_2d. An Invalid handle binds a stand-in, so a shader that declares the binding runs whether or not the frame wrote depth.

Definition at line 718 of file GfxEnums.hpp.

References binding, DepthTexture, kind, and texture.

Referenced by esengine::DynamicGI::declare(), and esengine::VoxelGI::declare().

◆ sampled()

GfxComputeBinding esengine::GfxComputeBinding::sampled ( u32 binding,
TextureHandle texture )
inlinestatic

Definition at line 710 of file GfxEnums.hpp.

References binding, kind, Texture, and texture.

Referenced by esengine::DynamicGI::declare(), and esengine::VoxelGI::declare().

◆ sampler()

GfxComputeBinding esengine::GfxComputeBinding::sampler ( u32 binding,
TextureFilter filter )
inlinestatic

Definition at line 721 of file GfxEnums.hpp.

References binding, filter, kind, and Sampler.

◆ storage()

GfxComputeBinding esengine::GfxComputeBinding::storage ( u32 binding,
BufferHandle buffer,
u32 offset = 0,
u32 size = 0 )
inlinestatic

◆ storageRead()

GfxComputeBinding esengine::GfxComputeBinding::storageRead ( u32 binding,
BufferHandle buffer,
u32 offset = 0,
u32 size = 0 )
inlinestatic

◆ storageTexture()

GfxComputeBinding esengine::GfxComputeBinding::storageTexture ( u32 binding,
TextureHandle texture )
inlinestatic

Definition at line 713 of file GfxEnums.hpp.

References binding, kind, StorageTexture, and texture.

Referenced by esengine::DynamicGI::declare(), and esengine::VoxelGI::declare().

◆ uniform()

GfxComputeBinding esengine::GfxComputeBinding::uniform ( u32 binding,
BufferHandle buffer,
u32 offset = 0,
u32 size = 0 )
inlinestatic

Member Data Documentation

◆ binding

u32 esengine::GfxComputeBinding::binding = 0

Definition at line 692 of file GfxEnums.hpp.

Referenced by depth(), sampled(), sampler(), storage(), storageRead(), storageTexture(), and uniform().

◆ buffer

BufferHandle esengine::GfxComputeBinding::buffer = BufferHandle::Invalid

Definition at line 693 of file GfxEnums.hpp.

Referenced by storage(), storageRead(), and uniform().

◆ filter

TextureFilter esengine::GfxComputeBinding::filter = TextureFilter::Linear

A Sampler's filter.

Definition at line 699 of file GfxEnums.hpp.

Referenced by sampler().

◆ kind

Kind esengine::GfxComputeBinding::kind = Kind::Uniform

Definition at line 691 of file GfxEnums.hpp.

Referenced by depth(), sampled(), sampler(), storage(), storageRead(), storageTexture(), and uniform().

◆ offset

u32 esengine::GfxComputeBinding::offset = 0

Bytes into the buffer (a multiple of 256 for a uniform, 4 for storage) and how many; 0 = the rest.

Definition at line 695 of file GfxEnums.hpp.

Referenced by storage(), storageRead(), and uniform().

◆ size

u32 esengine::GfxComputeBinding::size = 0

Definition at line 696 of file GfxEnums.hpp.

Referenced by storage(), storageRead(), and uniform().

◆ texture

TextureHandle esengine::GfxComputeBinding::texture = TextureHandle::Invalid

Definition at line 697 of file GfxEnums.hpp.

Referenced by depth(), sampled(), and storageTexture().


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