KiCad PCB EDA Suite
Loading...
Searching...
No Matches
rhi_bind_group.h File Reference
#include <rhi/rhi_types.h>
#include <rhi/rhi_handle.h>
#include <algorithm>
#include <cstdint>
#include <vector>

Go to the source code of this file.

Classes

struct  RHI_BINDING_ENTRY
 
struct  RHI_BIND_GROUP_LAYOUT_DESC
 
struct  RHI_BIND_GROUP_RESOURCE
 Buffer bindings set bufferHandle; a COMBINED_TEXTURE_SAMPLER binding sets textureHandle. More...
 
struct  RHI_BIND_GROUP_DESC
 

Enumerations

enum class  RHI_BINDING_TYPE { UNIFORM_BUFFER , COMBINED_TEXTURE_SAMPLER , STORAGE_BUFFER , STORAGE_BUFFER_READONLY }
 
enum class  RHI_SHADER_STAGE : uint32_t {
  NONE = 0 , VERTEX = 1u << 0 , FRAGMENT = 1u << 1 , COMPUTE = 1u << 2 ,
  ALL = ( 1u << 0 ) | ( 1u << 1 )
}
 Bit flags for the shader stages that see a binding. More...
 
enum class  RHI_BIND_FREQUENCY { PER_FRAME = 0 , PER_PASS = 1 , PER_DRAW = 3 }
 How often a group's resources change. More...
 

Functions

RHI_SHADER_STAGE operator& (RHI_SHADER_STAGE a, RHI_SHADER_STAGE b)
 
bool operator! (RHI_SHADER_STAGE a)
 

Variables

constexpr int RHI_MAX_BIND_GROUPS = 4
 Most bind groups one pipeline can use.
 
constexpr uint32_t RHI_UBO_BINDING = 1
 MSL is generated with –msl-decoration-binding, so a Metal buffer index is its binding number in every set and push constants take buffer 0.
 

Enumeration Type Documentation

◆ RHI_BIND_FREQUENCY

enum class RHI_BIND_FREQUENCY
strong

How often a group's resources change.

A hint only, as the group index is the layout's position in RHI_PIPELINE_DESC::bindGroupLayouts.

Enumerator
PER_FRAME 
PER_PASS 
PER_DRAW 

Definition at line 64 of file rhi_bind_group.h.

◆ RHI_BINDING_TYPE

enum class RHI_BINDING_TYPE
strong
Enumerator
UNIFORM_BUFFER 
COMBINED_TEXTURE_SAMPLER 
STORAGE_BUFFER 
STORAGE_BUFFER_READONLY 

Definition at line 31 of file rhi_bind_group.h.

◆ RHI_SHADER_STAGE

enum class RHI_SHADER_STAGE : uint32_t
strong

Bit flags for the shader stages that see a binding.

Enumerator
NONE 
VERTEX 
FRAGMENT 
COMPUTE 
ALL 

Graphics stages only, compute is opted into explicitly.

Definition at line 40 of file rhi_bind_group.h.

Function Documentation

◆ operator!()

bool operator! ( RHI_SHADER_STAGE a)
inline

Definition at line 55 of file rhi_bind_group.h.

◆ operator&()

Definition at line 49 of file rhi_bind_group.h.

Variable Documentation

◆ RHI_MAX_BIND_GROUPS

int RHI_MAX_BIND_GROUPS = 4
constexpr

Most bind groups one pipeline can use.

Definition at line 29 of file rhi_bind_group.h.

Referenced by RHI_VULKAN_DEVICE::BindGroup(), RhiValidateComputePipelineDesc(), and RHI_BIND_GROUP_LAYOUT_DESC::Validate().

◆ RHI_UBO_BINDING

uint32_t RHI_UBO_BINDING = 1
constexpr

MSL is generated with –msl-decoration-binding, so a Metal buffer index is its binding number in every set and push constants take buffer 0.

Uniform buffer bindings therefore start at 1 and must not repeat across the sets of one pipeline. Textures and samplers have separate index tables.

Definition at line 76 of file rhi_bind_group.h.

Referenced by RHI_GAL_PIPELINES::Initialize(), and KIGFX::RENDER_THREAD::writeUniform().