candlewick 0.1.0
A renderer
Loading...
Searching...
No Matches
DepthViz.h
Go to the documentation of this file.
1#pragma once
2
3#include "../Core.h"
4#include <SDL3/SDL_gpu.h>
5#include "../Camera.h"
6
7namespace candlewick {
8
17 SDL_GPUTexture *depthTexture;
18 SDL_GPUSampler *sampler;
19 SDL_GPUGraphicsPipeline *pipeline;
20
21 static DepthDebugPass create(const Renderer &renderer,
22 SDL_GPUTexture *depthTexture);
23
24 void release(SDL_GPUDevice *device);
25};
26
27inline void DepthDebugPass::release(SDL_GPUDevice *device) {
28 if (sampler) {
29 SDL_ReleaseGPUSampler(device, sampler);
30 sampler = NULL;
31 }
32 if (pipeline) {
33 SDL_ReleaseGPUGraphicsPipeline(device, pipeline);
34 pipeline = NULL;
35 }
36}
37
38void renderDepthDebug(const Renderer &renderer, CommandBuffer &cmdBuf,
39 const DepthDebugPass &pass,
40 const DepthDebugPass::Options &opts);
41
42} // namespace candlewick
Definition CommandBuffer.h:17
Definition Camera.h:8
CameraProjection
Definition Camera.h:16
@ PERSPECTIVE
Definition Camera.h:16
void renderDepthDebug(const Renderer &renderer, CommandBuffer &cmdBuf, const DepthDebugPass &pass, const DepthDebugPass::Options &opts)
Definition DepthViz.h:11
float far
Definition DepthViz.h:14
VizStyle mode
Definition DepthViz.h:12
CameraProjection cam_proj
Definition DepthViz.h:15
float near
Definition DepthViz.h:13
Definition DepthViz.h:9
SDL_GPUTexture * depthTexture
Definition DepthViz.h:17
SDL_GPUSampler * sampler
Definition DepthViz.h:18
VizStyle
Definition DepthViz.h:10
@ VIZ_GRAYSCALE
Definition DepthViz.h:10
@ VIZ_HEATMAP
Definition DepthViz.h:10
void release(SDL_GPUDevice *device)
Definition DepthViz.h:27
static DepthDebugPass create(const Renderer &renderer, SDL_GPUTexture *depthTexture)
SDL_GPUGraphicsPipeline * pipeline
Definition DepthViz.h:19
The Renderer class provides a rendering context for a graphical application.
Definition Renderer.h:20