candlewick 0.1.0
A renderer
Loading...
Searching...
No Matches
candlewick::rend Namespace Reference

Functions

void bindMesh (SDL_GPURenderPass *pass, const Mesh &mesh)
 Bind a Mesh object.
 
void bindMeshView (SDL_GPURenderPass *pass, const MeshView &view)
 Bind a MeshView object.
 
void drawViews (SDL_GPURenderPass *pass, std::span< const MeshView > meshViews, Uint32 numInstances=1)
 Render a collection of MeshView. This collection must satisfy the invariant that they all have the same parent Mesh object, which allows batching draw calls like this without having to rebind the Mesh.
 
void draw (SDL_GPURenderPass *pass, const Mesh &mesh, Uint32 numInstances=1)
 
void drawView (SDL_GPURenderPass *pass, const MeshView &mesh, Uint32 numInstances=1)
 Draw a MeshView.
 
void bindVertexSamplers (SDL_GPURenderPass *pass, Uint32 first_slot, std::span< const SDL_GPUTextureSamplerBinding > bindings)
 Bind multiple fragment shader samplers.
 
void bindVertexSamplers (SDL_GPURenderPass *pass, Uint32 first_slot, std::initializer_list< SDL_GPUTextureSamplerBinding > sampler_bindings)
 Bind multiple fragment shader samplers. This overload exists to enable taking a brace-initialized array.
 
void bindFragmentSamplers (SDL_GPURenderPass *pass, Uint32 first_slot, std::span< const SDL_GPUTextureSamplerBinding > bindings)
 Bind multiple fragment shader samplers.
 
void bindFragmentSamplers (SDL_GPURenderPass *pass, Uint32 first_slot, std::initializer_list< SDL_GPUTextureSamplerBinding > sampler_bindings)
 Bind multiple fragment shader samplers. This overload exists to enable taking a brace-initialized array.
 

Function Documentation

◆ bindFragmentSamplers() [1/2]

void candlewick::rend::bindFragmentSamplers ( SDL_GPURenderPass * pass,
Uint32 first_slot,
std::initializer_list< SDL_GPUTextureSamplerBinding > sampler_bindings )
inline

Bind multiple fragment shader samplers. This overload exists to enable taking a brace-initialized array.

◆ bindFragmentSamplers() [2/2]

void candlewick::rend::bindFragmentSamplers ( SDL_GPURenderPass * pass,
Uint32 first_slot,
std::span< const SDL_GPUTextureSamplerBinding > bindings )
inline

Bind multiple fragment shader samplers.

◆ bindMesh()

void candlewick::rend::bindMesh ( SDL_GPURenderPass * pass,
const Mesh & mesh )

Bind a Mesh object.

See also
bindMeshView()

◆ bindMeshView()

void candlewick::rend::bindMeshView ( SDL_GPURenderPass * pass,
const MeshView & view )

Bind a MeshView object.

Warning
This performs the same logic as bindMesh(). The entire buffer is bound, because drawView() uses the vertex and index offsets to draw. Binding offset buffers would, then, be incorrect.
See also
bindMesh()
drawView()
drawViews()

◆ bindVertexSamplers() [1/2]

void candlewick::rend::bindVertexSamplers ( SDL_GPURenderPass * pass,
Uint32 first_slot,
std::initializer_list< SDL_GPUTextureSamplerBinding > sampler_bindings )
inline

Bind multiple fragment shader samplers. This overload exists to enable taking a brace-initialized array.

◆ bindVertexSamplers() [2/2]

void candlewick::rend::bindVertexSamplers ( SDL_GPURenderPass * pass,
Uint32 first_slot,
std::span< const SDL_GPUTextureSamplerBinding > bindings )
inline

Bind multiple fragment shader samplers.

◆ draw()

void candlewick::rend::draw ( SDL_GPURenderPass * pass,
const Mesh & mesh,
Uint32 numInstances = 1 )
inline

Render an individual Mesh as part of a render pass, using a provided first index or vertex offset.

This routine will bind the vertex and index buffer. Prefer one of the other routines to e.g. batch draw calls that use the same buffer bindings.

Warning
Call bindMesh() first!
Parameters
passThe GPU render pass
meshThe Mesh to draw.

◆ drawView()

void candlewick::rend::drawView ( SDL_GPURenderPass * pass,
const MeshView & mesh,
Uint32 numInstances = 1 )

Draw a MeshView.

Warning
Call bindMesh() first!
Parameters
passThe GPU render pass.
meshMeshView object to be drawn.
See also
draw()

◆ drawViews()

void candlewick::rend::drawViews ( SDL_GPURenderPass * pass,
std::span< const MeshView > meshViews,
Uint32 numInstances = 1 )

Render a collection of MeshView. This collection must satisfy the invariant that they all have the same parent Mesh object, which allows batching draw calls like this without having to rebind the Mesh.

Parameters
passThe GPU render pass
meshViewsCollection of MeshView objects with the same parent Mesh.
See also
drawView() (for individual views)