candlewick 0.1.0
A renderer
Loading...
Searching...
No Matches
candlewick::DepthPass Class Reference

Helper struct for depth or light pre-passes. More...

#include <candlewick/core/DepthAndShadowPass.h>

Classes

struct  Config
 

Public Member Functions

 DepthPass (NoInitT)
 
 DepthPass (const Device &device, const MeshLayout &layout, SDL_GPUTexture *depth_texture, SDL_GPUTextureFormat format, const Config &config={})
 Create DepthPass (e.g. for a depth pre-pass) from a Device, specified mesh layout, and raw texture handle along with its format.
 
 DepthPass (const Device &device, const MeshLayout &layout, const Texture &depth_texture, const Config &config={})
 Create DepthPass (e.g. for a depth pre-pass) from a Device, specified mesh layout, and the RAIII Texture object.
 
 DepthPass (const DepthPass &)=delete
 
DepthPassoperator= (const DepthPass &)=delete
 
 DepthPass (DepthPass &&other) noexcept
 
DepthPassoperator= (DepthPass &&other) noexcept
 
void render (CommandBuffer &cmdBuf, const Mat4f &viewProj, std::span< const OpaqueCastable > castables)
 
void release () noexcept
 Release the pass resources.
 
 ~DepthPass () noexcept
 

Public Attributes

SDL_GPUTexture * depthTexture = nullptr
 
SDL_GPUGraphicsPipeline * pipeline = nullptr
 

Static Public Attributes

static constexpr Uint32 TRANSFORM_SLOT = 0
 

Detailed Description

Helper struct for depth or light pre-passes.

Warning
The depth pre-pass is meant for opaque geometries. Hence, the pipeline created by the create() factory function will have back-face culling enabled.

Constructor & Destructor Documentation

◆ DepthPass() [1/5]

candlewick::DepthPass::DepthPass ( NoInitT )
inline

◆ DepthPass() [2/5]

candlewick::DepthPass::DepthPass ( const Device & device,
const MeshLayout & layout,
SDL_GPUTexture * depth_texture,
SDL_GPUTextureFormat format,
const Config & config = {} )

Create DepthPass (e.g. for a depth pre-pass) from a Device, specified mesh layout, and raw texture handle along with its format.

Parameters
deviceThe device object.
layoutMesh layout used for the render pipeline's vertex input state.
depth_textureRaw handle to a texture. Cannot be null.
formatTexture format. Has to be passed here because we pass the raw handle.
configConfiguration.

◆ DepthPass() [3/5]

candlewick::DepthPass::DepthPass ( const Device & device,
const MeshLayout & layout,
const Texture & depth_texture,
const Config & config = {} )

Create DepthPass (e.g. for a depth pre-pass) from a Device, specified mesh layout, and the RAIII Texture object.

Parameters
deviceThe device object.
layoutMesh layout used for the render pipeline's vertex input state.
depth_textureTexture object.
configConfiguration.

◆ DepthPass() [4/5]

candlewick::DepthPass::DepthPass ( const DepthPass & )
delete

◆ DepthPass() [5/5]

candlewick::DepthPass::DepthPass ( DepthPass && other)
noexcept

◆ ~DepthPass()

candlewick::DepthPass::~DepthPass ( )
inlinenoexcept

Member Function Documentation

◆ operator=() [1/2]

DepthPass & candlewick::DepthPass::operator= ( const DepthPass & )
delete

◆ operator=() [2/2]

DepthPass & candlewick::DepthPass::operator= ( DepthPass && other)
noexcept

◆ release()

void candlewick::DepthPass::release ( )
noexcept

Release the pass resources.

◆ render()

void candlewick::DepthPass::render ( CommandBuffer & cmdBuf,
const Mat4f & viewProj,
std::span< const OpaqueCastable > castables )

Member Data Documentation

◆ depthTexture

SDL_GPUTexture* candlewick::DepthPass::depthTexture = nullptr

◆ pipeline

SDL_GPUGraphicsPipeline* candlewick::DepthPass::pipeline = nullptr

◆ TRANSFORM_SLOT

Uint32 candlewick::DepthPass::TRANSFORM_SLOT = 0
staticconstexpr

The documentation for this class was generated from the following file: