HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
enums.h
Go to the documentation of this file.
1 //
2 // Copyright 2019 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 #ifndef PXR_IMAGING_HGI_ENUMS_H
25 #define PXR_IMAGING_HGI_ENUMS_H
26 
27 #include "pxr/pxr.h"
28 #include "pxr/imaging/hgi/api.h"
29 #include <cstdint>
30 
32 
33 using HgiBits = uint32_t;
34 
35 
36 /// \enum HgiDeviceCapabilitiesBits
37 ///
38 /// Describes what capabilities the requested device must have.
39 ///
40 /// <ul>
41 /// <li>HgiDeviceCapabilitiesBitsPresentation:
42 /// The device must be capable of presenting graphics to screen</li>
43 /// </ul>
44 ///
46 {
48 };
49 
51 
52 /// \enum HgiTextureType
53 ///
54 /// Describes the kind of texture.
55 ///
56 /// <ul>
57 /// <li>HgiTextureType1D:
58 /// A one-dimensional texture.</li>
59 /// <li>HgiTextureType2D:
60 /// A two-dimensional texture.</li>
61 /// <li>HgiTextureType3D:
62 /// A three-dimensional texture.</li>
63 /// <li>HgiTextureType1DArray:
64 /// An array of one-dimensional textures.</li>
65 /// <li>HgiTextureType2DArray:
66 /// An array of two-dimensional textures.</li>
67 /// </ul>
68 ///
70 {
76 
78 };
79 
80 /// \enum HgiTextureUsageBits
81 ///
82 /// Describes how the texture will be used. If a texture has multiple uses you
83 /// can combine multiple bits.
84 ///
85 /// <ul>
86 /// <li>HgiTextureUsageBitsColorTarget:
87 /// The texture is a color attachment rendered into via a render pass.</li>
88 /// <li>HgiTextureUsageBitsDepthTarget:
89 /// The texture is a depth attachment rendered into via a render pass.</li>
90 /// <li>HgiTextureUsageBitsStencilTarget:
91 /// The texture is a stencil attachment rendered into via a render pass.</li>
92 /// <li>HgiTextureUsageBitsShaderRead:
93 /// The texture is sampled from in a shader (sampling)</li>
94 /// <li>HgiTextureUsageBitsShaderWrite:
95 /// The texture is written into from in a shader (image store)
96 /// When a texture is used as HgiBindResourceTypeStorageImage you must
97 /// add this flag (even if you only read from the image).</li>
98 ///
99 /// <li>HgiTextureUsageCustomBitsBegin:
100 /// This bit (and any bit after) can be used to attached custom, backend
101 /// specific bits to the usage bit. </li>
102 /// </ul>
103 ///
105 {
111 
113 };
114 
116 
117 /// \enum HgiSamplerAddressMode
118 ///
119 /// Various modes used during sampling of a texture.
120 ///
122 {
128 
130 };
131 
132 /// \enum HgiSamplerFilter
133 ///
134 /// Sampler filtering modes that determine the pixel value that is returned.
135 ///
136 /// <ul>
137 /// <li>HgiSamplerFilterNearest:
138 /// Returns the value of a single mipmap level.</li>
139 /// <li>HgiSamplerFilterLinear:
140 /// Combines the values of multiple mipmap levels.</li>
141 /// </ul>
142 ///
144 {
147 
149 };
150 
151 /// \enum HgiMipFilter
152 ///
153 /// Sampler filtering modes that determine the pixel value that is returned.
154 ///
155 /// <ul>
156 /// <li>HgiMipFilterNotMipmapped:
157 /// Texture is always sampled at mipmap level 0. (ie. max lod=0)</li>
158 /// <li>HgiMipFilterNearest:
159 /// Returns the value of a single mipmap level.</li>
160 /// <li>HgiMipFilterLinear:
161 /// Linear interpolates the values of up to two mipmap levels.</li>
162 /// </ul>
163 ///
165 {
169 
171 };
172 
173 /// \enum HgiSampleCount
174 ///
175 /// Sample count for multi-sampling
176 ///
178 {
184 
186 };
187 
188 /// \enum HgiAttachmentLoadOp
189 ///
190 /// Describes what will happen to the attachment pixel data prior to rendering.
191 ///
192 /// <ul>
193 /// <li>HgiAttachmentLoadOpDontCare:
194 /// All pixels are rendered to. Pixel data in render target starts undefined.</li>
195 /// <li>HgiAttachmentLoadOpClear:
196 /// The attachment pixel data is cleared to a specified color value.</li>
197 /// <li>HgiAttachmentLoadOpLoad:
198 /// Previous pixel data is loaded into attachment prior to rendering.</li>
199 /// </ul>
200 ///
202 {
206 
208 };
209 
210 /// \enum HgiAttachmentStoreOp
211 ///
212 /// Describes what will happen to the attachment pixel data after rendering.
213 ///
214 /// <ul>
215 /// <li>HgiAttachmentStoreOpDontCare:
216 /// Pixel data is undefined after rendering has completed (no store cost)</li>
217 /// <li>HgiAttachmentStoreOpStore:
218 /// The attachment pixel data is stored in memory.</li>
219 /// </ul>
220 ///
222 {
225 
227 };
228 
229 /// \enum HgiBufferUsageBits
230 ///
231 /// Describes the properties and usage of the buffer.
232 ///
233 /// <ul>
234 /// <li>HgiBufferUsageUniform:
235 /// Shader uniform buffer </li>
236 /// <li>HgiBufferUsageIndex32:
237 /// Topology 32 bit indices.</li>
238 /// <li>HgiBufferUsageVertex:
239 /// Vertex attributes.</li>
240 /// <li>HgiBufferUsageStorage:
241 /// Shader storage buffer / Argument buffer.</li>
242 ///
243 /// <li>HgiBufferUsageCustomBitsBegin:
244 /// This bit (and any bit after) can be used to attached custom, backend
245 /// specific bits to the usage bit. </li>
246 /// </ul>
247 ///
249 {
254 
256 };
258 
259 /// \enum HgiShaderStage
260 ///
261 /// Describes the stage a shader function operates in.
262 ///
263 /// <ul>
264 /// <li>HgiShaderStageVertex:
265 /// Vertex Shader.</li>
266 /// <li>HgiShaderStageFragment:
267 /// Fragment Shader.</li>
268 /// <li>HgiShaderStageCompute:
269 /// Compute Shader.</li>
270 /// <li>HgiShaderStageTessellationControl:
271 /// Transforms the control points of the low order surface (patch).
272 /// This runs before the tessellator fixed function stage.</li>
273 /// <li>HgiShaderStageTessellationEval:
274 /// Generates the surface geometry (the points) from the transformed control
275 /// points for every coordinate coming out of the tessellator fixed function
276 /// stage. </li>
277 /// <li>HgiShaderStageGeometry:
278 /// Governs the processing of Primitives.</li>
279 /// </ul>
280 ///
282 {
289 
291 };
293 
294 /// \enum HgiBindResourceType
295 ///
296 /// Describes the type of the resource to be bound.
297 ///
298 /// <ul>
299 /// <li>HgiBindResourceTypeSampler:
300 /// Sampler.
301 /// Glsl example: uniform sampler samplerOnly</li>
302 /// <li>HgiBindResourceTypeSampledImage:
303 /// Image for use with sampling ops.
304 /// Glsl example: uniform texture2D textureOnly
305 /// texture(sampler2D(textureOnly, samplerOnly), ...)</li>
306 /// <li>HgiBindResourceTypeCombinedSamplerImage:
307 /// Image and sampler combined into one.
308 /// Glsl example: uniform sampler2D texSmp;
309 /// texture(texSmp, ...)</li>
310 /// <li>HgiBindResourceTypeStorageImage:
311 /// Storage image used for image store/load ops (Unordered Access View).</li>
312 /// <li>HgiBindResourceTypeUniformBuffer:
313 /// Uniform buffer (UBO).</li>
314 /// <li>HgiBindResourceTypeStorageBuffer:
315 /// Shader storage buffer (SSBO).</li>
316 /// </ul>
317 ///
319 {
326 
328 };
329 
330 /// \enum HgiPolygonMode
331 ///
332 /// Controls polygon mode during rasterization
333 ///
334 /// <ul>
335 /// <li>HgiPolygonModeFill:
336 /// Polygons are filled.</li>
337 /// <li>HgiPolygonModeLine:
338 /// Polygon edges are drawn as line segments.</li>
339 /// <li>HgiPolygonModePoint:
340 /// Polygon vertices are drawn as points.</li>
341 /// </ul>
342 ///
344 {
348 
350 };
351 
352 /// \enum HgiCullMode
353 ///
354 /// Controls primitive (faces) culling.
355 ///
356 /// <ul>
357 /// <li>HgiPolygonModeNone:
358 /// No primitive are discarded.</li>
359 /// <li>HgiPolygonModeFront:
360 /// Front-facing primitive are discarded.</li>
361 /// <li>HgiPolygonModeBack:
362 /// Back-facing primitive are discarded.</li>
363 /// <li>HgiPolygonModeFrontAndBack:
364 /// All primitive are discarded.</li>
365 /// </ul>
366 ///
368 {
373 
375 };
376 
377 /// \enum HgiWinding
378 ///
379 /// Determines the front-facing orientation of a primitive (face).
380 ///
381 /// <ul>
382 /// <li>HgiWindingClockwise:
383 /// Primitives with clockwise vertex-order are front facing.</li>
384 /// <li>HgiWindingCounterClockwise:
385 /// Primitives with counter-clockwise vertex-order are front facing.</li>
386 /// </ul>
387 ///
389 {
392 
394 };
395 
396 
397 /// \enum HgiBlendOp
398 ///
399 /// Blend operations
400 ///
402 {
408 
410 };
411 
412 /// \enum HgiBlendFactor
413 ///
414 /// Blend factors
415 ///
417 {
437 
439 };
440 
441 
442 /// \enum HgiCompareFunction
443 ///
444 /// Compare functions.
445 ///
447 {
456 
458 };
459 
460 /// \enum HgiComponentSwizzle
461 ///
462 /// Swizzle for a component.
463 ///
465 {
472 
474 };
475 
476 /// \enum HgiPrimitiveType
477 ///
478 /// What the stream of vertices being rendered represents
479 ///
480 /// <ul>
481 /// <li>HgiPrimitiveTypePointList:
482 /// Rasterize a point at each vertex.</li>
483 /// <li>HgiPrimitiveTypeLineList:
484 /// Rasterize a line between each separate pair of vertices.</li>
485 /// <li>HgiPrimitiveTypeLineStrip:
486 /// Rasterize a line between each pair of adjacent vertices.</li>
487 /// <li>HgiPrimitiveTypeTriangleList:
488 /// Rasterize a triangle for every separate set of three vertices.</li>
489 /// <li>HgiPrimitiveTypePatchList:
490 /// A user-defined number of vertices, which is tessellated into
491 /// points, lines, or triangles.</li>
492 /// </ul>
493 ///
495 {
501 
503 };
504 
505 /// \enum HgiSubmitWaitType
506 ///
507 /// Describes command submission wait behavior.
508 ///
509 /// <ul>
510 /// <li>HgiSubmitWaitTypeNoWait:
511 /// CPU should not wait for the GPU to finish processing the cmds.</li>
512 /// <li>HgiSubmitWaitTypeWaitUntilCompleted:
513 /// The CPU waits ("blocked") until the GPU has consumed the cmds.</li>
514 /// </ul>
515 ///
517 {
520 };
521 
522 /// \enum HgiMemoryBarrier
523 ///
524 /// Describes what objects the memory barrier affects.
525 ///
526 /// <ul>
527 /// <li>HgiMemoryBarrierNone:
528 /// No barrier (no-op).</li>
529 /// <li>HgiMemoryBarrierAll:
530 /// The barrier affects all memory writes and reads.</li>
531 /// </ul>
532 ///
534 {
537 };
539 
541 
542 #endif
HgiSamplerAddressMode
Definition: enums.h:121
HgiPolygonMode
Definition: enums.h:343
HgiCompareFunction
Definition: enums.h:446
HgiAttachmentLoadOp
Definition: enums.h:201
HgiDeviceCapabilitiesBits
Definition: enums.h:45
HgiMipFilter
Definition: enums.h:164
HgiWinding
Definition: enums.h:388
HgiBits HgiDeviceCapabilities
Definition: enums.h:50
HgiBits HgiTextureUsage
Definition: enums.h:115
HgiCullMode
Definition: enums.h:367
HgiComponentSwizzle
Definition: enums.h:464
HgiSubmitWaitType
Definition: enums.h:516
HgiAttachmentStoreOp
Definition: enums.h:221
HgiBlendFactor
Definition: enums.h:416
HgiMemoryBarrierBits
Definition: enums.h:533
HgiBindResourceType
Definition: enums.h:318
HgiBits HgiMemoryBarrier
Definition: enums.h:538
HgiBlendOp
Definition: enums.h:401
HgiPrimitiveType
Definition: enums.h:494
HgiBufferUsageBits
Definition: enums.h:248
HgiTextureUsageBits
Definition: enums.h:104
HgiTextureType
Definition: enums.h:69
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1375
HgiBits HgiBufferUsage
Definition: enums.h:257
HgiShaderStageBits
Definition: enums.h:281
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
HgiBits HgiShaderStage
Definition: enums.h:292
uint32_t HgiBits
Definition: enums.h:33
HgiSampleCount
Definition: enums.h:177
HgiSamplerFilter
Definition: enums.h:143