Plasma Engine  2.0
Loading...
Searching...
No Matches
Enumerations.h
1#pragma once
2
3#include <RendererFoundation/RendererFoundationDLL.h>
4
9{
10 using StorageType = plUInt8;
11 enum Enum : plUInt8
12 {
13 Unknown = 0,
16
19 // Read-only struct. Set directly via plGALCommandEncoder::SetPushConstants. HLSL: Use macro BEGIN_PUSH_CONSTANTS, END_PUSH_CONSTANTS, GET_PUSH_CONSTANT
20 PushConstants,
21
24
33
37
44
46
47 // #TODO_SHADER: Future work:
48 // Not supported: PL does not support AppendStructuredBuffer, ConsumeStructuredBuffer yet so while the shader can be compiled, nothing can be bound to these resources. On Vulkan, will probably need yet another type to distinguish the data from the count resource (uav_counter_binding).
49 // Not supported: tbuffer, TextureBuffer, these map to CBV on DX11 and to eStorageBuffer on Vulkan, requiring to use a constantBufferView or a UAV. Thus, it bleeds platform implementation details.
50 // Not supported: (Vulkan) VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, frame-buffer local read-only image view. Required for render passes on mobile.
51 // Not supported: (Vulkan) VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK,Vulkan 1.3 addition, surpasses push-constants but not widely supported yet. May be able to abstract this via PushConstants and custom shader compiler / GAL implementations.
52 // Not supported: (Vulkan) VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR, Vulkan extension for raytracing.
53
54 Default = Unknown
55 };
56};
57
61{
62 using StorageType = plUInt8;
63 static constexpr int ENUM_COUNT = 4;
64 enum Enum : plUInt8
65 {
66 Sampler = PL_BIT(0), //< Sampler (plGALSamplerStateHandle).
67 ConstantBuffer = PL_BIT(1), //< Constant Buffer (plGALBufferHandle)
68 TextureSRV = PL_BIT(2), //< Shader Resource Views (plGALTextureResourceViewHandle).
69 BufferSRV = PL_BIT(3), //< Shader Resource Views (plGALBufferResourceViewHandle).
70 TextureUAV = PL_BIT(4), //< Unordered Access Views (plGALTextureUnorderedAccessViewHandle).
71 BufferUAV = PL_BIT(5), //< Unordered Access Views (plGALBufferUnorderedAccessViewHandle).
72 Default = 0
73 };
74
75 struct Bits
76 {
77 StorageType Sampler : 1;
78 StorageType ConstantBuffer : 1;
79 StorageType TextureSRV : 1;
80 StorageType BufferSRV : 1;
81 StorageType TextureUAV : 1;
82 StorageType BufferUAV : 1;
83 };
84
85 static plBitflags<plGALShaderResourceCategory> MakeFromShaderDescriptorType(plGALShaderResourceType::Enum type);
86};
87
88PL_DECLARE_FLAGS_OPERATORS(plGALShaderResourceCategory);
89
92{
93 using StorageType = plUInt8;
94 enum Enum : plUInt8
95 {
96 Unknown = 0,
97 Texture1D = 1,
98 Texture1DArray = 2,
99 Texture2D = 3,
100 Texture2DArray = 4,
101 Texture2DMS = 5,
102 Texture2DMSArray = 6,
103 Texture3D = 7,
104 TextureCube = 8,
105 TextureCubeArray = 9,
106
107 Default = Unknown
108 };
109
110 static bool IsArray(plGALShaderTextureType::Enum format);
111};
112
116{
117 using StorageType = plUInt8;
118
119 enum Enum
120 {
121 Immediate,
122 VSync,
123 ENUM_COUNT,
124 Default = VSync
125 };
126};
127
131{
132 using StorageType = plUInt8;
133
134 enum Enum : plUInt8
135 {
136 Position,
137 Normal,
138 Tangent,
139 Color0,
140 Color1,
141 Color2,
142 Color3,
143 Color4,
144 Color5,
145 Color6,
146 Color7,
147 TexCoord0,
148 TexCoord1,
149 TexCoord2,
150 TexCoord3,
151 TexCoord4,
152 TexCoord5,
153 TexCoord6,
154 TexCoord7,
155 TexCoord8,
156 TexCoord9,
157
158 BiTangent,
159 BoneIndices0,
160 BoneIndices1,
161 BoneWeights0,
162 BoneWeights1,
163
164 ENUM_COUNT,
165 Default = Position
166 };
167};
168
172{
173 using StorageType = plUInt16;
174
175 enum Enum
176 {
177 VertexBuffer = PL_BIT(0),
178 IndexBuffer = PL_BIT(1),
179 ConstantBuffer = PL_BIT(2),
180 TexelBuffer = PL_BIT(3),
181 StructuredBuffer = PL_BIT(4),
182 ByteAddressBuffer = PL_BIT(5),
183
184 ShaderResource = PL_BIT(6),
185 UnorderedAccess = PL_BIT(7),
186 DrawIndirect = PL_BIT(8),
187
188 Default = 0
189 };
190
191 struct Bits
192 {
193 StorageType VertexBuffer : 1;
194 StorageType IndexBuffer : 1;
195 StorageType ConstantBuffer : 1;
196 StorageType TexelBuffer : 1;
197 StorageType StructuredBuffer : 1;
198 StorageType ByteAddressBuffer : 1;
199 StorageType ShaderResource : 1;
200 StorageType UnorderedAccess : 1;
201 StorageType DrawIndirect : 1;
202 };
203};
204PL_DECLARE_FLAGS_OPERATORS(plGALBufferUsageFlags);
205
208{
209 using StorageType = plUInt8;
210
211 enum Enum
212 {
217
218 Default = NumSamplesPassed
219 };
220};
221
224{
225 using StorageType = plUInt8;
226
227 enum Enum : plUInt8
228 {
232 Default = None
233 };
234};
235
236#include <RendererFoundation/Descriptors/Implementation/Enumerations_inl.h>
The plBitflags class allows you to work with type-safe bitflags.
Definition Bitflags.h:82
Definition Enumerations.h:192
Defines for what purpose a buffer can be used for.
Definition Enumerations.h:172
Enum
Definition Enumerations.h:176
@ DrawIndirect
Can be used in an indirect draw call.
Definition Enumerations.h:186
@ UnorderedAccess
Can be used for plGALShaderResourceType in the UAV section.
Definition Enumerations.h:185
@ ConstantBuffer
Can be used as a constant buffer. Can't be combined with any of the other *Buffer flags.
Definition Enumerations.h:179
@ TexelBuffer
Can be used as a texel buffer.
Definition Enumerations.h:180
@ IndexBuffer
Can be used as an index buffer.
Definition Enumerations.h:178
@ StructuredBuffer
plGALShaderResourceType::StructuredBuffer
Definition Enumerations.h:181
@ ByteAddressBuffer
plGALShaderResourceType::ByteAddressBuffer (RAW)
Definition Enumerations.h:182
@ VertexBuffer
Can be used as a vertex buffer.
Definition Enumerations.h:177
@ ShaderResource
Can be used for plGALShaderResourceType in the SRV section.
Definition Enumerations.h:184
Defines a swap chain's present mode.
Definition Enumerations.h:116
Type of GPU->CPU query.
Definition Enumerations.h:208
Enum
Definition Enumerations.h:212
@ AnySamplesPassed
Boolean version of NumSamplesPassed. Any number bigger than 0 equals true.
Definition Enumerations.h:216
@ NumSamplesPassed
Number of samples that passed the depth and stencil test between begin and end (on a context).
Definition Enumerations.h:214
Definition Enumerations.h:76
General category of the shader resource (plShaderResourceBinding). Note that these are flags because ...
Definition Enumerations.h:61
The type of a shader resource (plShaderResourceBinding). Shader resources need to be bound to a shade...
Definition Enumerations.h:9
Enum
Definition Enumerations.h:12
@ TextureRW
Read-write texture view. When set, plGALShaderTextureType is also set. HLSL: RWTexture*.
Definition Enumerations.h:39
@ StructuredBufferRW
Read-write array of structs. HLSL: RWStructuredBuffer<T>, RWByteAddressBuffer, AppendStructuredBuffer...
Definition Enumerations.h:43
@ ConstantBuffer
Read-only struct (plGALBufferHandle). HLSL: cbuffer, ConstantBuffer.
Definition Enumerations.h:18
@ StructuredBuffer
Read-only array of structs. HLSL: StructuredBuffer<T>, ByteAddressBuffer.
Definition Enumerations.h:32
@ Sampler
Texture sampler (plGALSamplerStateHandle). HLSL: SamplerState, SamplerComparisonState.
Definition Enumerations.h:15
@ Texture
Read-only texture view. When set, plGALShaderTextureType is also set. HLSL: Texture*.
Definition Enumerations.h:26
@ TextureAndSampler
Read-only texture view with attached sampler. When set, plGALShaderTextureType is also set....
Definition Enumerations.h:28
@ TexelBuffer
Read-only texel buffer. It's like a 1D texture. HLSL: Buffer.
Definition Enumerations.h:30
@ TexelBufferRW
Read-write texel buffer. It's like a 1D texture. HLSL: RWBuffer.
Definition Enumerations.h:41
The texture type of the shader resource (plShaderResourceBinding).
Definition Enumerations.h:92
Type of the shared texture (INTERNAL)
Definition Enumerations.h:224
Enum
Definition Enumerations.h:228
@ Exported
Allocation owned by this process.
Definition Enumerations.h:230
@ Imported
Allocation owned by a different process.
Definition Enumerations.h:231
@ None
Not shared.
Definition Enumerations.h:229
Defines the usage semantic of a vertex attribute.
Definition Enumerations.h:131