cvkg_render_gpu/passes/
tonemap.rs1use crate::kvasir::node::{ExecutionContext, KvasirNode};
2use crate::kvasir::nodes::{PassId, RES_SCENE};
3
4pub struct ToneMapNode {
8 pub inputs: Vec<crate::kvasir::resource::ResourceId>,
9 pub outputs: Vec<crate::kvasir::resource::ResourceId>,
10 pub target_view: Option<wgpu::TextureView>,
11}
12
13impl ToneMapNode {
14 pub fn new() -> Self {
15 Self {
16 inputs: vec![RES_SCENE],
17 outputs: vec![RES_SCENE],
18 target_view: None,
19 }
20 }
21}
22
23impl Default for ToneMapNode {
24 fn default() -> Self {
25 Self::new()
26 }
27}
28
29impl KvasirNode for ToneMapNode {
30 fn label(&self) -> &'static str {
31 "ToneMap"
32 }
33
34 fn inputs(&self) -> &[crate::kvasir::resource::ResourceId] {
35 &self.inputs
36 }
37
38 fn outputs(&self) -> &[crate::kvasir::resource::ResourceId] {
39 &self.outputs
40 }
41
42 fn pass_id(&self) -> PassId {
43 PassId::PostProcess {
44 pipeline_id: 0x544F4E45, }
46 }
47
48 fn execute(&self, _ctx: &mut ExecutionContext) {
49 tracing::trace!("[Kvasir] ToneMap: pass executed (pipeline in end_frame)");
52 }
53}