Avara3D 0.2.0
C++ API reference
PipelineDesc.h
1//
2// PipelineDesc.h
3// avara3d
4//
5// Created by Morgan Davis on 12/23/25.
6// Copyright © 2026 Morgan K Davis. All rights reserved.
7//
8
9#ifndef AVARA3D_RENDER_PIPELINEDESC_H
10#define AVARA3D_RENDER_PIPELINEDESC_H
11
12#include <cstdint>
13#include <cstddef>
14
15#include "a3d/mesh/VertexLayout.h"
16#include "a3d/visual/material/Material.h"
17
18namespace a3d {
19
20 // [Internal Types]
21
22 using PipelineId = uint32_t;
23 static constexpr PipelineId INVALID_PIPELINE_ID = 0xFFFFFFFFu;
24
25 enum class DepthFunc : uint8_t {
26 Less,
27 Lequal,
28 Equal,
29 Greater,
30 Gequal,
31 Notequal,
32 Always,
33 Never
34 };
35
36 enum class ShaderKind : uint8_t {
37 Skybox,
38 Ground,
39 Default,
40 Wireframe,
41 Lines
42 };
43
44 enum class PassKind : uint8_t {
45 // note: this is RENDER ORDER
46 Background = 0,
47 Ground = 1,
48 MainOpaque = 2,
49 MainMask = 3,
50 MainTransparent = 4,
51 Wireframe = 5,
52 Lines = 6
53 };
54
55 struct PipelineDesc {
56 // *** MUST update PipelineDescHash() when this struct changes ***
57 PassKind passKind = PassKind::MainOpaque;
58 ShaderKind shaderKind = ShaderKind::Default;
59 VertexLayout vertexLayoutKey = VertexLayout::None;
62 bool doubleSided = false;
63 bool depthTest = true;
64 bool depthWrite = true; // Main = true, Wire = false
65 DepthFunc depthFunc = DepthFunc::Less;
66 bool polygonOffset = false; // Main = false, Wire = true
67
68 bool operator==(const PipelineDesc&) const = default;
69 };
70
71 // [Internal Functions]
72
73 struct PipelineDescHash { // for unordered_map
74 size_t operator()(const PipelineDesc& desc) const noexcept;
75 };
76
77}
78
79#endif // AVARA3D_RENDER_PIPELINEDESC_H
FillMode
Selects polygon rasterization mode.
Definition: Material.h:51
@ Fill
Rasterize filled polygons.
BlendFunction
Selects the blending function used for transparent materials.
Definition: Material.h:68
@ Disabled
Do not explicitly enable blending.