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 terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 #ifndef PXR_IMAGING_HGI_ENUMS_H
8 #define PXR_IMAGING_HGI_ENUMS_H
9 
10 #include "pxr/pxr.h"
11 #include "pxr/imaging/hgi/api.h"
12 #include <cstdint>
13 
15 
16 using HgiBits = uint32_t;
17 
18 
19 /// \enum HgiDeviceCapabilitiesBits
20 ///
21 /// Describes what capabilities the requested device must have.
22 ///
23 /// <ul>
24 /// <li>HgiDeviceCapabilitiesBitsPresentation:
25 /// The device must be capable of presenting graphics to screen</li>
26 /// <li>HgiDeviceCapabilitiesBitsBindlessBuffers:
27 /// THe device can access GPU buffers using bindless handles</li>
28 /// <li>HgiDeviceCapabilitiesBitsConcurrentDispatch:
29 /// The device can execute commands concurrently</li>
30 /// <li>HgiDeviceCapabilitiesBitsUnifiedMemory:
31 /// The device shares all GPU and CPU memory</li>
32 /// <li>HgiDeviceCapabilitiesBitsBuiltinBarycentrics:
33 /// The device can provide built-in barycentric coordinates</li>
34 /// <li>HgiDeviceCapabilitiesBitsShaderDrawParameters:
35 /// The device can provide additional built-in shader variables corresponding
36 /// to draw command parameters</li>
37 /// <li>HgiDeviceCapabilitiesBitsMultiDrawIndirect:
38 /// The device supports multiple primitive, indirect drawing</li>
39 /// <li>HgiDeviceCapabilitiesBitsBindlessTextures:
40 /// The device can access GPU textures using bindless handles</li>
41 /// <li>HgiDeviceCapabilitiesBitsShaderDoublePrecision:
42 /// The device supports double precision types in shaders</li>
43 /// <li>HgiDeviceCapabilitiesBitsDepthRangeMinusOnetoOne:
44 /// The device's clip space depth ranges from [-1,1]</li>
45 /// <li>HgiDeviceCapabilitiesBitsCppShaderPadding:
46 /// Use CPP padding for shader language structures</li>
47 /// <li>HgiDeviceCapabilitiesBitsConservativeRaster:
48 /// The device supports conservative rasterization</li>
49 /// <li>HgiDeviceCapabilitiesBitsStencilReadback:
50 /// Supports reading back the stencil buffer from GPU to CPU.</li>
51 /// <li>HgiDeviceCapabilitiesBitsCustomDepthRange:
52 /// The device supports setting a custom depth range.</li>
53 /// <li>HgiDeviceCapabilitiesBitsMetalTessellation:
54 /// Supports Metal tessellation shaders</li>
55 /// <li>HgiDeviceCapabilitiesBitsBasePrimitiveOffset:
56 /// The device requires workaround for base primitive offset</li>
57 /// <li>HgiDeviceCapabilitiesBitsPrimitiveIdEmulation:
58 /// The device requires workaround for primitive id</li>
59 /// <li>HgiDeviceCapabilitiesBitsIndirectCommandBuffers:
60 /// Indirect command buffers are supported</li>
61 /// <li>HgiDeviceCapabilitiesBitsRoundPoints:
62 /// Points can be natively rasterized as disks</li>
63 /// </ul>
64 ///
66 {
86 };
87 
89 
90 /// \enum HgiTextureType
91 ///
92 /// Describes the kind of texture.
93 ///
94 /// <ul>
95 /// <li>HgiTextureType1D:
96 /// A one-dimensional texture.</li>
97 /// <li>HgiTextureType2D:
98 /// A two-dimensional texture.</li>
99 /// <li>HgiTextureType3D:
100 /// A three-dimensional texture.</li>
101 /// <li>HgiTextureType1DArray:
102 /// An array of one-dimensional textures.</li>
103 /// <li>HgiTextureType2DArray:
104 /// An array of two-dimensional textures.</li>
105 /// </ul>
106 ///
108 {
114 
116 };
117 
118 /// \enum HgiTextureUsageBits
119 ///
120 /// Describes how the texture will be used. If a texture has multiple uses you
121 /// can combine multiple bits.
122 ///
123 /// <ul>
124 /// <li>HgiTextureUsageBitsColorTarget:
125 /// The texture is a color attachment rendered into via a render pass.</li>
126 /// <li>HgiTextureUsageBitsDepthTarget:
127 /// The texture is a depth attachment rendered into via a render pass.</li>
128 /// <li>HgiTextureUsageBitsStencilTarget:
129 /// The texture is a stencil attachment rendered into via a render pass.</li>
130 /// <li>HgiTextureUsageBitsShaderRead:
131 /// The texture is sampled from in a shader (sampling)</li>
132 /// <li>HgiTextureUsageBitsShaderWrite:
133 /// The texture is written into from in a shader (image store)
134 /// When a texture is used as HgiBindResourceTypeStorageImage you must
135 /// add this flag (even if you only read from the image).</li>
136 ///
137 /// <li>HgiTextureUsageCustomBitsBegin:
138 /// This bit (and any bit after) can be used to attached custom, backend
139 /// specific bits to the usage bit. </li>
140 /// </ul>
141 ///
143 {
149 
151 };
152 
154 
155 /// \enum HgiSamplerAddressMode
156 ///
157 /// Various modes used during sampling of a texture.
158 ///
160 {
166 
168 };
169 
170 /// \enum HgiSamplerFilter
171 ///
172 /// Sampler filtering modes that determine the pixel value that is returned.
173 ///
174 /// <ul>
175 /// <li>HgiSamplerFilterNearest:
176 /// Returns the value of a single mipmap level.</li>
177 /// <li>HgiSamplerFilterLinear:
178 /// Combines the values of multiple mipmap levels.</li>
179 /// </ul>
180 ///
182 {
185 
187 };
188 
189 /// \enum HgiMipFilter
190 ///
191 /// Sampler filtering modes that determine the pixel value that is returned.
192 ///
193 /// <ul>
194 /// <li>HgiMipFilterNotMipmapped:
195 /// Texture is always sampled at mipmap level 0. (ie. max lod=0)</li>
196 /// <li>HgiMipFilterNearest:
197 /// Returns the value of a single mipmap level.</li>
198 /// <li>HgiMipFilterLinear:
199 /// Linear interpolates the values of up to two mipmap levels.</li>
200 /// </ul>
201 ///
203 {
207 
209 };
210 
211 /// \enum HgiBorderColor
212 ///
213 /// Border color to use for clamped texture values.
214 ///
215 /// <ul>
216 /// <li>HgiBorderColorTransparentBlack</li>
217 /// <li>HgiBorderColorOpaqueBlack</li>
218 /// <li>HgiBorderColorOpaqueWhite</li>
219 /// </ul>
220 ///
222 {
226 
228 };
229 
230 /// \enum HgiSampleCount
231 ///
232 /// Sample count for multi-sampling
233 ///
235 {
241 
243 };
244 
245 /// \enum HgiAttachmentLoadOp
246 ///
247 /// Describes what will happen to the attachment pixel data prior to rendering.
248 ///
249 /// <ul>
250 /// <li>HgiAttachmentLoadOpDontCare:
251 /// All pixels are rendered to. Pixel data in render target starts undefined.</li>
252 /// <li>HgiAttachmentLoadOpClear:
253 /// The attachment pixel data is cleared to a specified color value.</li>
254 /// <li>HgiAttachmentLoadOpLoad:
255 /// Previous pixel data is loaded into attachment prior to rendering.</li>
256 /// </ul>
257 ///
259 {
263 
265 };
266 
267 /// \enum HgiAttachmentStoreOp
268 ///
269 /// Describes what will happen to the attachment pixel data after rendering.
270 ///
271 /// <ul>
272 /// <li>HgiAttachmentStoreOpDontCare:
273 /// Pixel data is undefined after rendering has completed (no store cost)</li>
274 /// <li>HgiAttachmentStoreOpStore:
275 /// The attachment pixel data is stored in memory.</li>
276 /// </ul>
277 ///
279 {
282 
284 };
285 
286 /// \enum HgiBufferUsageBits
287 ///
288 /// Describes the properties and usage of the buffer.
289 ///
290 /// <ul>
291 /// <li>HgiBufferUsageUniform:
292 /// Shader uniform buffer </li>
293 /// <li>HgiBufferUsageIndex32:
294 /// Topology 32 bit indices.</li>
295 /// <li>HgiBufferUsageVertex:
296 /// Vertex attributes.</li>
297 /// <li>HgiBufferUsageStorage:
298 /// Shader storage buffer / Argument buffer.</li>
299 ///
300 /// <li>HgiBufferUsageCustomBitsBegin:
301 /// This bit (and any bit after) can be used to attached custom, backend
302 /// specific bits to the usage bit. </li>
303 /// </ul>
304 ///
306 {
312 
314 };
316 
317 /// \enum HgiShaderStage
318 ///
319 /// Describes the stage a shader function operates in.
320 ///
321 /// <ul>
322 /// <li>HgiShaderStageVertex:
323 /// Vertex Shader.</li>
324 /// <li>HgiShaderStageFragment:
325 /// Fragment Shader.</li>
326 /// <li>HgiShaderStageCompute:
327 /// Compute Shader.</li>
328 /// <li>HgiShaderStageTessellationControl:
329 /// Transforms the control points of the low order surface (patch).
330 /// This runs before the tessellator fixed function stage.</li>
331 /// <li>HgiShaderStageTessellationEval:
332 /// Generates the surface geometry (the points) from the transformed control
333 /// points for every coordinate coming out of the tessellator fixed function
334 /// stage.</li>
335 /// <li>HgiShaderStageGeometry:
336 /// Governs the processing of Primitives.</li>
337 /// <li>HgiShaderStagePostTessellationControl:
338 /// Metal specific stage which computes tess factors
339 /// and modifies user post tess vertex data.</li>
340 /// <li>HgiShaderStagePostTessellationVertex:
341 /// Metal specific stage which performs tessellation and
342 /// vertex processing.</li>
343 /// </ul>
344 ///
346 {
356 };
358 
359 /// \enum HgiBindResourceType
360 ///
361 /// Describes the type of the resource to be bound.
362 ///
363 /// <ul>
364 /// <li>HgiBindResourceTypeSampler:
365 /// Sampler.
366 /// Glsl example: uniform sampler samplerOnly</li>
367 /// <li>HgiBindResourceTypeSampledImage:
368 /// Image for use with sampling ops.
369 /// Glsl example: uniform texture2D textureOnly
370 /// texture(sampler2D(textureOnly, samplerOnly), ...)</li>
371 /// <li>HgiBindResourceTypeCombinedSamplerImage:
372 /// Image and sampler combined into one.
373 /// Glsl example: uniform sampler2D texSmp;
374 /// texture(texSmp, ...)</li>
375 /// <li>HgiBindResourceTypeStorageImage:
376 /// Storage image used for image store/load ops (Unordered Access View).</li>
377 /// <li>HgiBindResourceTypeUniformBuffer:
378 /// Uniform buffer (UBO).</li>
379 /// <li>HgiBindResourceTypeStorageBuffer:
380 /// Shader storage buffer (SSBO).</li>
381 /// <li>HgiBindResourceTypeTessFactors:
382 /// Tessellation factors for Metal tessellation.</li>
383 /// </ul>
384 ///
386 {
394 
396 };
397 
398 /// \enum HgiPolygonMode
399 ///
400 /// Controls polygon mode during rasterization
401 ///
402 /// <ul>
403 /// <li>HgiPolygonModeFill:
404 /// Polygons are filled.</li>
405 /// <li>HgiPolygonModeLine:
406 /// Polygon edges are drawn as line segments.</li>
407 /// <li>HgiPolygonModePoint:
408 /// Polygon vertices are drawn as points.</li>
409 /// </ul>
410 ///
412 {
416 
418 };
419 
420 /// \enum HgiCullMode
421 ///
422 /// Controls primitive (faces) culling.
423 ///
424 /// <ul>
425 /// <li>HgiPolygonModeNone:
426 /// No primitive are discarded.</li>
427 /// <li>HgiPolygonModeFront:
428 /// Front-facing primitive are discarded.</li>
429 /// <li>HgiPolygonModeBack:
430 /// Back-facing primitive are discarded.</li>
431 /// <li>HgiPolygonModeFrontAndBack:
432 /// All primitive are discarded.</li>
433 /// </ul>
434 ///
436 {
441 
443 };
444 
445 /// \enum HgiWinding
446 ///
447 /// Determines the front-facing orientation of a primitive (face).
448 ///
449 /// <ul>
450 /// <li>HgiWindingClockwise:
451 /// Primitives with clockwise vertex-order are front facing.</li>
452 /// <li>HgiWindingCounterClockwise:
453 /// Primitives with counter-clockwise vertex-order are front facing.</li>
454 /// </ul>
455 ///
457 {
460 
462 };
463 
464 
465 /// \enum HgiBlendOp
466 ///
467 /// Blend operations
468 ///
470 {
476 
478 };
479 
480 /// \enum HgiBlendFactor
481 ///
482 /// Blend factors
483 ///
485 {
505 
507 };
508 
509 /// \enum HgiColorMaskBits
510 ///
511 /// Describes whether to permit or restrict writing to color components
512 /// of a color attachment.
513 ///
515 {
516  HgiColorMaskRed = 1 << 0,
520 };
522 
523 /// \enum HgiCompareFunction
524 ///
525 /// Compare functions.
526 ///
528 {
537 
539 };
540 
541 /// \enum HgiStencilOp
542 ///
543 /// Stencil operations.
544 ///
546 {
555 
557 };
558 
559 /// \enum HgiComponentSwizzle
560 ///
561 /// Swizzle for a component.
562 ///
564 {
571 
573 };
574 
575 /// \enum HgiPrimitiveType
576 ///
577 /// What the stream of vertices being rendered represents
578 ///
579 /// <ul>
580 /// <li>HgiPrimitiveTypePointList:
581 /// Rasterize a point at each vertex.</li>
582 /// <li>HgiPrimitiveTypeLineList:
583 /// Rasterize a line between each separate pair of vertices.</li>
584 /// <li>HgiPrimitiveTypeLineStrip:
585 /// Rasterize a line between each pair of adjacent vertices.</li>
586 /// <li>HgiPrimitiveTypeTriangleList:
587 /// Rasterize a triangle for every separate set of three vertices.</li>
588 /// <li>HgiPrimitiveTypePatchList:
589 /// A user-defined number of vertices, which is tessellated into
590 /// points, lines, or triangles.</li>
591 /// <li>HgiPrimitiveTypeLineListWithAdjacency:
592 /// A four-vertex encoding used to draw untriangulated quads.
593 /// Rasterize two triangles for every separate set of four vertices.</li>
594 /// </ul>
595 ///
597 {
604 
606 };
607 
608 /// \enum HgiVertexBufferStepFunction
609 ///
610 /// Describes the rate at which vertex attributes are pulled from buffers.
611 ///
612 /// <ul>
613 /// <li>HgiVertexBufferStepFunctionConstant:
614 /// The same attribute data is used for every vertex.</li>
615 /// <li>HgiVertexBufferStepFunctionPerVertex:
616 /// New attribute data is fetched for each vertex.</li>
617 /// <li>HgiVertexBufferStepFunctionPerInstance:
618 /// New attribute data is fetched for each instance.</li>
619 /// <li>HgiVertexBufferStepFunctionPerPatch:
620 /// New attribute data is fetched for each patch.</li>
621 /// <li>HgiVertexBufferStepFunctionPerPatchControlPoint:
622 /// New attribute data is fetched for each patch control point.</li>
623 /// <li>HgiVertexBufferStepFunctionPerDrawCommand:
624 /// New attribute data is fetched for each draw in a multi-draw command.</li>
625 /// </ul>
626 ///
628 {
635 
637 };
638 
639 /// \enum HgiSubmitWaitType
640 ///
641 /// Describes command submission wait behavior.
642 ///
643 /// <ul>
644 /// <li>HgiSubmitWaitTypeNoWait:
645 /// CPU should not wait for the GPU to finish processing the cmds.</li>
646 /// <li>HgiSubmitWaitTypeWaitUntilCompleted:
647 /// The CPU waits ("blocked") until the GPU has consumed the cmds.</li>
648 /// </ul>
649 ///
651 {
654 };
655 
656 /// \enum HgiMemoryBarrier
657 ///
658 /// Describes what objects the memory barrier affects.
659 ///
660 /// <ul>
661 /// <li>HgiMemoryBarrierNone:
662 /// No barrier (no-op).</li>
663 /// <li>HgiMemoryBarrierAll:
664 /// The barrier affects all memory writes and reads.</li>
665 /// </ul>
666 ///
668 {
671 };
673 
674 /// \enum HgiBindingType
675 ///
676 /// Describes the type of shader resource binding model to use.
677 ///
678 /// <ul>
679 /// <li>HgiBindingTypeValue:
680 /// Shader declares binding as a value.
681 /// Glsl example: buffer { int parameter; };
682 /// Msl example: int parameter;</li>
683 /// <li>HgiBindingTypeUniformValue:
684 /// Shader declares binding as a uniform block value.
685 /// Glsl example: uniform { int parameter; };
686 /// Msl example: int parameter;</li>
687 /// <li>HgiBindingTypeArray:
688 /// Shader declares binding as array value.
689 /// Glsl example: buffer { int parameter[n]; };
690 /// Msl example: int parameter[n];</li>
691 /// <li>HgiBindingTypeUniformArray:
692 /// Shader declares binding as uniform block array value.
693 /// Glsl example: uniform { int parameter[n]; };
694 /// Msl example: int parameter[n];</li>
695 /// <li>HgiBindingTypePointer:
696 /// Shader declares binding as pointer value.
697 /// Glsl example: buffer { int parameter[] };
698 /// Msl example: int *parameter;</li>
699 /// </ul>
700 ///
702 {
708 };
709 
710 /// \enum HgiInterpolationType
711 ///
712 /// Describes the type of parameter interpolation.
713 ///
714 /// <ul>
715 /// <li>HgiInterpolationDefault:
716 /// The shader input will have default interpolation.
717 /// Glsl example: vec2 parameter;
718 /// Msl example: vec2 parameter;</li>
719 /// <li>HgiInterpolationFlat:
720 /// The shader input will have no interpolation.
721 /// Glsl example: flat vec2 parameter;
722 /// Msl example: vec2 parameter[[flat]];</li>
723 /// <li>HgiBindingTypeNoPerspective:
724 /// The shader input will be linearly interpolated in screen-space
725 /// Glsl example: noperspective vec2 parameter;
726 /// Msl example: vec2 parameter[[center_no_perspective]];</li>
727 /// </ul>
728 ///
730 {
734 };
735 
736 /// \enum HgiSamplingType
737 ///
738 /// Describes the type of parameter sampling.
739 ///
740 /// <ul>
741 /// <li>HgiSamplingDefault:
742 /// The shader input will have default sampling.
743 /// Glsl example: vec2 parameter;
744 /// Msl example: vec2 parameter;</li>
745 /// <li>HgiSamplingCentroid:
746 /// The shader input will have centroid sampling.
747 /// Glsl example: centroid vec2 parameter;
748 /// Msl example: vec2 parameter[[centroid_perspective]];</li>
749 /// <li>HgiSamplingSample:
750 /// The shader input will have per-sample sampling.
751 /// Glsl example: sample vec2 parameter;
752 /// Msl example: vec2 parameter[[sample_perspective]];</li>
753 /// </ul>
754 ///
756 {
760 };
761 
762 /// \enum HgiStorageType
763 ///
764 /// Describes the type of parameter storage.
765 ///
766 /// <ul>
767 /// <li>HgiStorageDefault:
768 /// The shader input will have default storage.
769 /// Glsl example: vec2 parameter;</li>
770 /// <li>HgiStoragePatch:
771 /// The shader input will have per-patch storage.
772 /// Glsl example: patch vec2 parameter;</li>
773 /// </ul>
774 ///
776 {
779 };
780 
781 /// \enum HgiShaderTextureType
782 ///
783 /// Describes the type of texture to be used in shader gen.
784 ///
785 /// <ul>
786 /// <li>HgiShaderTextureTypeTexture:
787 /// Indicates a regular texture.</li>
788 /// <li>HgiShaderTextureTypeShadowTexture:
789 /// Indicates a shadow texture.</li>
790 /// <li>HgiShaderTextureTypeArrayTexture:
791 /// Indicates an array texture.</li>
792 /// </ul>
793 ///
795 {
799 };
800 
801 /// \enum HgiComputeDispatch
802 ///
803 /// Specifies the dispatch method for compute encoders.
804 ///
805 /// <ul>
806 /// <li>HgiComputeDispatchSerial:
807 /// Kernels are dispatched serially.</li>
808 /// <li>HgiComputeDispatchConcurrent:
809 /// Kernels are dispatched concurrently, if supported by the API</li>
810 /// </ul>
811 ///
813 {
816 };
817 
819 
820 #endif
HgiSamplerAddressMode
Definition: enums.h:159
HgiStorageType
Definition: enums.h:775
HgiColorMaskBits
Definition: enums.h:514
HgiPolygonMode
Definition: enums.h:411
HgiStencilOp
Definition: enums.h:545
HgiVertexBufferStepFunction
Definition: enums.h:627
HgiCompareFunction
Definition: enums.h:527
HgiAttachmentLoadOp
Definition: enums.h:258
HgiDeviceCapabilitiesBits
Definition: enums.h:65
HgiMipFilter
Definition: enums.h:202
HgiWinding
Definition: enums.h:456
HgiBits HgiDeviceCapabilities
Definition: enums.h:88
HgiBorderColor
Definition: enums.h:221
HgiBits HgiTextureUsage
Definition: enums.h:153
HgiCullMode
Definition: enums.h:435
HgiComponentSwizzle
Definition: enums.h:563
HgiSubmitWaitType
Definition: enums.h:650
HgiAttachmentStoreOp
Definition: enums.h:278
HgiInterpolationType
Definition: enums.h:729
HgiComputeDispatch
Definition: enums.h:812
HgiBindingType
Definition: enums.h:701
HgiBlendFactor
Definition: enums.h:484
HgiMemoryBarrierBits
Definition: enums.h:667
HgiBindResourceType
Definition: enums.h:385
HgiBits HgiMemoryBarrier
Definition: enums.h:672
HgiBlendOp
Definition: enums.h:469
HgiPrimitiveType
Definition: enums.h:596
HgiBufferUsageBits
Definition: enums.h:305
HgiSamplingType
Definition: enums.h:755
HgiTextureUsageBits
Definition: enums.h:142
HgiTextureType
Definition: enums.h:107
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
HgiBits HgiBufferUsage
Definition: enums.h:315
HgiShaderStageBits
Definition: enums.h:345
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HgiBits HgiShaderStage
Definition: enums.h:357
HgiShaderTextureType
Definition: enums.h:794
uint32_t HgiBits
Definition: enums.h:16
HgiSampleCount
Definition: enums.h:234
HgiSamplerFilter
Definition: enums.h:181
HgiBits HgiColorMask
Definition: enums.h:521