candlewick
0.10.0
A tiny cross-platform renderer based on SDL3
Loading...
Searching...
No Matches
DepthViz.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
../GraphicsPipeline.h
"
4
#include "
../Camera.h
"
5
#include <SDL3/SDL_gpu.h>
6
7
namespace
candlewick
{
8
9
struct
DepthDebugPass
{
10
enum
VizStyle
:
int
{
VIZ_GRAYSCALE
,
VIZ_HEATMAP
};
11
struct
Options
{
12
VizStyle
mode
;
13
float
near
;
14
float
far
;
15
CameraProjection
cam_proj
=
CameraProjection::PERSPECTIVE
;
16
};
17
SDL_GPUTexture *
depthTexture
;
18
SDL_GPUSampler *
sampler
;
19
GraphicsPipeline
pipeline
{
NoInit
};
20
21
static
DepthDebugPass
create
(
const
RenderContext
&renderer,
22
SDL_GPUTexture *
depthTexture
);
23
24
void
release
(SDL_GPUDevice *device);
25
};
26
27
inline
void
DepthDebugPass::release
(SDL_GPUDevice *device) {
28
if
(
sampler
) {
29
SDL_ReleaseGPUSampler(device,
sampler
);
30
sampler
= NULL;
31
}
32
pipeline
.release();
33
}
34
35
void
renderDepthDebug
(
const
RenderContext
&renderer,
CommandBuffer
&cmdBuf,
36
const
DepthDebugPass
&pass,
37
const
DepthDebugPass::Options
&opts);
38
39
}
// namespace candlewick
Camera.h
GraphicsPipeline.h
candlewick::CommandBuffer
Definition
CommandBuffer.h:16
candlewick::GraphicsPipeline
Class representing a graphics pipeline.
Definition
GraphicsPipeline.h:15
candlewick
Definition
Camera.h:8
candlewick::CameraProjection
CameraProjection
Definition
Camera.h:16
candlewick::CameraProjection::PERSPECTIVE
@ PERSPECTIVE
Definition
Camera.h:16
candlewick::renderDepthDebug
void renderDepthDebug(const RenderContext &renderer, CommandBuffer &cmdBuf, const DepthDebugPass &pass, const DepthDebugPass::Options &opts)
candlewick::NoInit
constexpr NoInitT NoInit
Definition
Tags.h:9
candlewick::DepthDebugPass::Options
Definition
DepthViz.h:11
candlewick::DepthDebugPass::Options::far
float far
Definition
DepthViz.h:14
candlewick::DepthDebugPass::Options::mode
VizStyle mode
Definition
DepthViz.h:12
candlewick::DepthDebugPass::Options::cam_proj
CameraProjection cam_proj
Definition
DepthViz.h:15
candlewick::DepthDebugPass::Options::near
float near
Definition
DepthViz.h:13
candlewick::DepthDebugPass
Definition
DepthViz.h:9
candlewick::DepthDebugPass::depthTexture
SDL_GPUTexture * depthTexture
Definition
DepthViz.h:17
candlewick::DepthDebugPass::sampler
SDL_GPUSampler * sampler
Definition
DepthViz.h:18
candlewick::DepthDebugPass::VizStyle
VizStyle
Definition
DepthViz.h:10
candlewick::DepthDebugPass::VIZ_GRAYSCALE
@ VIZ_GRAYSCALE
Definition
DepthViz.h:10
candlewick::DepthDebugPass::VIZ_HEATMAP
@ VIZ_HEATMAP
Definition
DepthViz.h:10
candlewick::DepthDebugPass::release
void release(SDL_GPUDevice *device)
Definition
DepthViz.h:27
candlewick::DepthDebugPass::create
static DepthDebugPass create(const RenderContext &renderer, SDL_GPUTexture *depthTexture)
candlewick::DepthDebugPass::pipeline
GraphicsPipeline pipeline
Definition
DepthViz.h:19
candlewick::RenderContext
The RenderContext class provides a rendering context for a graphical application.
Definition
RenderContext.h:36
src
candlewick
core
debug
DepthViz.h
Generated by
1.13.2