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 {
87 };
88 
90 
91 /// \enum HgiTextureType
92 ///
93 /// Describes the kind of texture.
94 ///
95 /// <ul>
96 /// <li>HgiTextureType1D:
97 /// A one-dimensional texture.</li>
98 /// <li>HgiTextureType2D:
99 /// A two-dimensional texture.</li>
100 /// <li>HgiTextureType3D:
101 /// A three-dimensional texture.</li>
102 /// <li>HgiTextureTypeCubemap:
103 /// A cubemap texture.</li>
104 /// <li>HgiTextureType1DArray:
105 /// An array of one-dimensional textures.</li>
106 /// <li>HgiTextureType2DArray:
107 /// An array of two-dimensional textures.</li>
108 /// </ul>
109 ///
111 {
118 
120 };
121 
122 /// \enum HgiTextureUsageBits
123 ///
124 /// Describes how the texture will be used. If a texture has multiple uses you
125 /// can combine multiple bits.
126 ///
127 /// <ul>
128 /// <li>HgiTextureUsageBitsColorTarget:
129 /// The texture is a color attachment rendered into via a render pass.</li>
130 /// <li>HgiTextureUsageBitsDepthTarget:
131 /// The texture is a depth attachment rendered into via a render pass.</li>
132 /// <li>HgiTextureUsageBitsStencilTarget:
133 /// The texture is a stencil attachment rendered into via a render pass.</li>
134 /// <li>HgiTextureUsageBitsShaderRead:
135 /// The texture is sampled from in a shader (sampling)</li>
136 /// <li>HgiTextureUsageBitsShaderWrite:
137 /// The texture is written into from in a shader (image store)
138 /// When a texture is used as HgiBindResourceTypeStorageImage you must
139 /// add this flag (even if you only read from the image).</li>
140 ///
141 /// <li>HgiTextureUsageCustomBitsBegin:
142 /// This bit (and any bit after) can be used to attached custom, backend
143 /// specific bits to the usage bit. </li>
144 /// </ul>
145 ///
147 {
153 
155 };
156 
158 
159 /// \enum HgiSamplerAddressMode
160 ///
161 /// Various modes used during sampling of a texture.
162 ///
164 {
170 
172 };
173 
174 /// \enum HgiSamplerFilter
175 ///
176 /// Sampler filtering modes that determine the pixel value that is returned.
177 ///
178 /// <ul>
179 /// <li>HgiSamplerFilterNearest:
180 /// Returns the value of a single mipmap level.</li>
181 /// <li>HgiSamplerFilterLinear:
182 /// Combines the values of multiple mipmap levels.</li>
183 /// </ul>
184 ///
186 {
189 
191 };
192 
193 /// \enum HgiMipFilter
194 ///
195 /// Sampler filtering modes that determine the pixel value that is returned.
196 ///
197 /// <ul>
198 /// <li>HgiMipFilterNotMipmapped:
199 /// Texture is always sampled at mipmap level 0. (ie. max lod=0)</li>
200 /// <li>HgiMipFilterNearest:
201 /// Returns the value of a single mipmap level.</li>
202 /// <li>HgiMipFilterLinear:
203 /// Linear interpolates the values of up to two mipmap levels.</li>
204 /// </ul>
205 ///
207 {
211 
213 };
214 
215 /// \enum HgiBorderColor
216 ///
217 /// Border color to use for clamped texture values.
218 ///
219 /// <ul>
220 /// <li>HgiBorderColorTransparentBlack</li>
221 /// <li>HgiBorderColorOpaqueBlack</li>
222 /// <li>HgiBorderColorOpaqueWhite</li>
223 /// </ul>
224 ///
226 {
230 
232 };
233 
234 /// \enum HgiSampleCount
235 ///
236 /// Sample count for multi-sampling
237 ///
239 {
245 
247 };
248 
249 /// \enum HgiAttachmentLoadOp
250 ///
251 /// Describes what will happen to the attachment pixel data prior to rendering.
252 ///
253 /// <ul>
254 /// <li>HgiAttachmentLoadOpDontCare:
255 /// All pixels are rendered to. Pixel data in render target starts undefined.</li>
256 /// <li>HgiAttachmentLoadOpClear:
257 /// The attachment pixel data is cleared to a specified color value.</li>
258 /// <li>HgiAttachmentLoadOpLoad:
259 /// Previous pixel data is loaded into attachment prior to rendering.</li>
260 /// </ul>
261 ///
263 {
267 
269 };
270 
271 /// \enum HgiAttachmentStoreOp
272 ///
273 /// Describes what will happen to the attachment pixel data after rendering.
274 ///
275 /// <ul>
276 /// <li>HgiAttachmentStoreOpDontCare:
277 /// Pixel data is undefined after rendering has completed (no store cost)</li>
278 /// <li>HgiAttachmentStoreOpStore:
279 /// The attachment pixel data is stored in memory.</li>
280 /// </ul>
281 ///
283 {
286 
288 };
289 
290 /// \enum HgiBufferUsageBits
291 ///
292 /// Describes the properties and usage of the buffer.
293 ///
294 /// <ul>
295 /// <li>HgiBufferUsageUniform:
296 /// Shader uniform buffer </li>
297 /// <li>HgiBufferUsageIndex32:
298 /// Topology 32 bit indices.</li>
299 /// <li>HgiBufferUsageVertex:
300 /// Vertex attributes.</li>
301 /// <li>HgiBufferUsageStorage:
302 /// Shader storage buffer / Argument buffer.</li>
303 /// <li>HgiBufferUsageUpload:
304 /// Buffer will be used to upload data.</li>
305 ///
306 /// <li>HgiBufferUsageCustomBitsBegin:
307 /// This bit (and any bit after) can be used to attached custom, backend
308 /// specific bits to the usage bit. </li>
309 /// </ul>
310 ///
312 {
319 
321 };
323 
324 /// \enum HgiShaderStage
325 ///
326 /// Describes the stage a shader function operates in.
327 ///
328 /// <ul>
329 /// <li>HgiShaderStageVertex:
330 /// Vertex Shader.</li>
331 /// <li>HgiShaderStageFragment:
332 /// Fragment Shader.</li>
333 /// <li>HgiShaderStageCompute:
334 /// Compute Shader.</li>
335 /// <li>HgiShaderStageTessellationControl:
336 /// Transforms the control points of the low order surface (patch).
337 /// This runs before the tessellator fixed function stage.</li>
338 /// <li>HgiShaderStageTessellationEval:
339 /// Generates the surface geometry (the points) from the transformed control
340 /// points for every coordinate coming out of the tessellator fixed function
341 /// stage.</li>
342 /// <li>HgiShaderStageGeometry:
343 /// Governs the processing of Primitives.</li>
344 /// <li>HgiShaderStagePostTessellationControl:
345 /// Metal specific stage which computes tess factors
346 /// and modifies user post tess vertex data.</li>
347 /// <li>HgiShaderStagePostTessellationVertex:
348 /// Metal specific stage which performs tessellation and
349 /// vertex processing.</li>
350 /// </ul>
351 ///
353 {
363 };
365 
366 /// \enum HgiBindResourceType
367 ///
368 /// Describes the type of the resource to be bound.
369 ///
370 /// <ul>
371 /// <li>HgiBindResourceTypeSampler:
372 /// Sampler.
373 /// Glsl example: uniform sampler samplerOnly</li>
374 /// <li>HgiBindResourceTypeSampledImage:
375 /// Image for use with sampling ops.
376 /// Glsl example: uniform texture2D textureOnly
377 /// texture(sampler2D(textureOnly, samplerOnly), ...)</li>
378 /// <li>HgiBindResourceTypeCombinedSamplerImage:
379 /// Image and sampler combined into one.
380 /// Glsl example: uniform sampler2D texSmp;
381 /// texture(texSmp, ...)</li>
382 /// <li>HgiBindResourceTypeStorageImage:
383 /// Storage image used for image store/load ops (Unordered Access View).</li>
384 /// <li>HgiBindResourceTypeUniformBuffer:
385 /// Uniform buffer (UBO).</li>
386 /// <li>HgiBindResourceTypeStorageBuffer:
387 /// Shader storage buffer (SSBO).</li>
388 /// <li>HgiBindResourceTypeTessFactors:
389 /// Tessellation factors for Metal tessellation.</li>
390 /// </ul>
391 ///
393 {
401 
403 };
404 
405 /// \enum HgiPolygonMode
406 ///
407 /// Controls polygon mode during rasterization
408 ///
409 /// <ul>
410 /// <li>HgiPolygonModeFill:
411 /// Polygons are filled.</li>
412 /// <li>HgiPolygonModeLine:
413 /// Polygon edges are drawn as line segments.</li>
414 /// <li>HgiPolygonModePoint:
415 /// Polygon vertices are drawn as points.</li>
416 /// </ul>
417 ///
419 {
423 
425 };
426 
427 /// \enum HgiCullMode
428 ///
429 /// Controls primitive (faces) culling.
430 ///
431 /// <ul>
432 /// <li>HgiPolygonModeNone:
433 /// No primitive are discarded.</li>
434 /// <li>HgiPolygonModeFront:
435 /// Front-facing primitive are discarded.</li>
436 /// <li>HgiPolygonModeBack:
437 /// Back-facing primitive are discarded.</li>
438 /// <li>HgiPolygonModeFrontAndBack:
439 /// All primitive are discarded.</li>
440 /// </ul>
441 ///
443 {
448 
450 };
451 
452 /// \enum HgiWinding
453 ///
454 /// Determines the front-facing orientation of a primitive (face).
455 ///
456 /// <ul>
457 /// <li>HgiWindingClockwise:
458 /// Primitives with clockwise vertex-order are front facing.</li>
459 /// <li>HgiWindingCounterClockwise:
460 /// Primitives with counter-clockwise vertex-order are front facing.</li>
461 /// </ul>
462 ///
464 {
467 
469 };
470 
471 
472 /// \enum HgiBlendOp
473 ///
474 /// Blend operations
475 ///
477 {
483 
485 };
486 
487 /// \enum HgiBlendFactor
488 ///
489 /// Blend factors
490 ///
492 {
512 
514 };
515 
516 /// \enum HgiColorMaskBits
517 ///
518 /// Describes whether to permit or restrict writing to color components
519 /// of a color attachment.
520 ///
522 {
523  HgiColorMaskRed = 1 << 0,
527 };
529 
530 /// \enum HgiCompareFunction
531 ///
532 /// Compare functions.
533 ///
535 {
544 
546 };
547 
548 /// \enum HgiStencilOp
549 ///
550 /// Stencil operations.
551 ///
553 {
562 
564 };
565 
566 /// \enum HgiComponentSwizzle
567 ///
568 /// Swizzle for a component.
569 ///
571 {
578 
580 };
581 
582 /// \enum HgiPrimitiveType
583 ///
584 /// What the stream of vertices being rendered represents
585 ///
586 /// <ul>
587 /// <li>HgiPrimitiveTypePointList:
588 /// Rasterize a point at each vertex.</li>
589 /// <li>HgiPrimitiveTypeLineList:
590 /// Rasterize a line between each separate pair of vertices.</li>
591 /// <li>HgiPrimitiveTypeLineStrip:
592 /// Rasterize a line between each pair of adjacent vertices.</li>
593 /// <li>HgiPrimitiveTypeTriangleList:
594 /// Rasterize a triangle for every separate set of three vertices.</li>
595 /// <li>HgiPrimitiveTypePatchList:
596 /// A user-defined number of vertices, which is tessellated into
597 /// points, lines, or triangles.</li>
598 /// <li>HgiPrimitiveTypeLineListWithAdjacency:
599 /// A four-vertex encoding used to draw untriangulated quads.
600 /// Rasterize two triangles for every separate set of four vertices.</li>
601 /// </ul>
602 ///
604 {
611 
613 };
614 
615 /// \enum HgiVertexBufferStepFunction
616 ///
617 /// Describes the rate at which vertex attributes are pulled from buffers.
618 ///
619 /// <ul>
620 /// <li>HgiVertexBufferStepFunctionConstant:
621 /// The same attribute data is used for every vertex.</li>
622 /// <li>HgiVertexBufferStepFunctionPerVertex:
623 /// New attribute data is fetched for each vertex.</li>
624 /// <li>HgiVertexBufferStepFunctionPerInstance:
625 /// New attribute data is fetched for each instance.</li>
626 /// <li>HgiVertexBufferStepFunctionPerPatch:
627 /// New attribute data is fetched for each patch.</li>
628 /// <li>HgiVertexBufferStepFunctionPerPatchControlPoint:
629 /// New attribute data is fetched for each patch control point.</li>
630 /// <li>HgiVertexBufferStepFunctionPerDrawCommand:
631 /// New attribute data is fetched for each draw in a multi-draw command.</li>
632 /// </ul>
633 ///
635 {
642 
644 };
645 
646 /// \enum HgiSubmitWaitType
647 ///
648 /// Describes command submission wait behavior.
649 ///
650 /// <ul>
651 /// <li>HgiSubmitWaitTypeNoWait:
652 /// CPU should not wait for the GPU to finish processing the cmds.</li>
653 /// <li>HgiSubmitWaitTypeWaitUntilCompleted:
654 /// The CPU waits ("blocked") until the GPU has consumed the cmds.</li>
655 /// </ul>
656 ///
658 {
661 };
662 
663 /// \enum HgiMemoryBarrier
664 ///
665 /// Describes what objects the memory barrier affects.
666 ///
667 /// <ul>
668 /// <li>HgiMemoryBarrierNone:
669 /// No barrier (no-op).</li>
670 /// <li>HgiMemoryBarrierAll:
671 /// The barrier affects all memory writes and reads.</li>
672 /// </ul>
673 ///
675 {
678 };
680 
681 /// \enum HgiBindingType
682 ///
683 /// Describes the type of shader resource binding model to use.
684 ///
685 /// <ul>
686 /// <li>HgiBindingTypeValue:
687 /// Shader declares binding as a value.
688 /// Glsl example: buffer { int parameter; };
689 /// Msl example: int parameter;</li>
690 /// <li>HgiBindingTypeUniformValue:
691 /// Shader declares binding as a uniform block value.
692 /// Glsl example: uniform { int parameter; };
693 /// Msl example: int parameter;</li>
694 /// <li>HgiBindingTypeArray:
695 /// Shader declares binding as array value.
696 /// Glsl example: buffer { int parameter[n]; };
697 /// Msl example: int parameter[n];</li>
698 /// <li>HgiBindingTypeUniformArray:
699 /// Shader declares binding as uniform block array value.
700 /// Glsl example: uniform { int parameter[n]; };
701 /// Msl example: int parameter[n];</li>
702 /// <li>HgiBindingTypePointer:
703 /// Shader declares binding as pointer value.
704 /// Glsl example: buffer { int parameter[] };
705 /// Msl example: int *parameter;</li>
706 /// </ul>
707 ///
709 {
715 };
716 
717 /// \enum HgiInterpolationType
718 ///
719 /// Describes the type of parameter interpolation.
720 ///
721 /// <ul>
722 /// <li>HgiInterpolationDefault:
723 /// The shader input will have default interpolation.
724 /// Glsl example: vec2 parameter;
725 /// Msl example: vec2 parameter;</li>
726 /// <li>HgiInterpolationFlat:
727 /// The shader input will have no interpolation.
728 /// Glsl example: flat vec2 parameter;
729 /// Msl example: vec2 parameter[[flat]];</li>
730 /// <li>HgiBindingTypeNoPerspective:
731 /// The shader input will be linearly interpolated in screen-space
732 /// Glsl example: noperspective vec2 parameter;
733 /// Msl example: vec2 parameter[[center_no_perspective]];</li>
734 /// </ul>
735 ///
737 {
741 };
742 
743 /// \enum HgiSamplingType
744 ///
745 /// Describes the type of parameter sampling.
746 ///
747 /// <ul>
748 /// <li>HgiSamplingDefault:
749 /// The shader input will have default sampling.
750 /// Glsl example: vec2 parameter;
751 /// Msl example: vec2 parameter;</li>
752 /// <li>HgiSamplingCentroid:
753 /// The shader input will have centroid sampling.
754 /// Glsl example: centroid vec2 parameter;
755 /// Msl example: vec2 parameter[[centroid_perspective]];</li>
756 /// <li>HgiSamplingSample:
757 /// The shader input will have per-sample sampling.
758 /// Glsl example: sample vec2 parameter;
759 /// Msl example: vec2 parameter[[sample_perspective]];</li>
760 /// </ul>
761 ///
763 {
767 };
768 
769 /// \enum HgiStorageType
770 ///
771 /// Describes the type of parameter storage.
772 ///
773 /// <ul>
774 /// <li>HgiStorageDefault:
775 /// The shader input will have default storage.
776 /// Glsl example: vec2 parameter;</li>
777 /// <li>HgiStoragePatch:
778 /// The shader input will have per-patch storage.
779 /// Glsl example: patch vec2 parameter;</li>
780 /// </ul>
781 ///
783 {
786 };
787 
788 /// \enum HgiShaderTextureType
789 ///
790 /// Describes the type of texture to be used in shader gen.
791 ///
792 /// <ul>
793 /// <li>HgiShaderTextureTypeTexture:
794 /// Indicates a regular texture.</li>
795 /// <li>HgiShaderTextureTypeShadowTexture:
796 /// Indicates a shadow texture.</li>
797 /// <li>HgiShaderTextureTypeArrayTexture:
798 /// Indicates an array texture.</li>
799 /// <li>HgiShaderTextureTypeCubemapTexture:
800 /// Indicates a cubemap texture.</li>
801 /// </ul>
802 ///
804 {
809 };
810 
811 /// \enum HgiComputeDispatch
812 ///
813 /// Specifies the dispatch method for compute encoders.
814 ///
815 /// <ul>
816 /// <li>HgiComputeDispatchSerial:
817 /// Kernels are dispatched serially.</li>
818 /// <li>HgiComputeDispatchConcurrent:
819 /// Kernels are dispatched concurrently, if supported by the API</li>
820 /// </ul>
821 ///
823 {
826 };
827 
829 
830 #endif
HgiSamplerAddressMode
Definition: enums.h:163
HgiStorageType
Definition: enums.h:782
HgiColorMaskBits
Definition: enums.h:521
HgiPolygonMode
Definition: enums.h:418
HgiStencilOp
Definition: enums.h:552
HgiVertexBufferStepFunction
Definition: enums.h:634
HgiCompareFunction
Definition: enums.h:534
HgiAttachmentLoadOp
Definition: enums.h:262
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
HgiDeviceCapabilitiesBits
Definition: enums.h:65
HgiMipFilter
Definition: enums.h:206
HgiWinding
Definition: enums.h:463
HgiBits HgiDeviceCapabilities
Definition: enums.h:89
HgiBorderColor
Definition: enums.h:225
HgiBits HgiTextureUsage
Definition: enums.h:157
HgiCullMode
Definition: enums.h:442
HgiComponentSwizzle
Definition: enums.h:570
HgiSubmitWaitType
Definition: enums.h:657
HgiAttachmentStoreOp
Definition: enums.h:282
HgiInterpolationType
Definition: enums.h:736
HgiComputeDispatch
Definition: enums.h:822
HgiBindingType
Definition: enums.h:708
HgiBlendFactor
Definition: enums.h:491
HgiMemoryBarrierBits
Definition: enums.h:674
HgiBindResourceType
Definition: enums.h:392
HgiBits HgiMemoryBarrier
Definition: enums.h:679
HgiBlendOp
Definition: enums.h:476
HgiPrimitiveType
Definition: enums.h:603
HgiBufferUsageBits
Definition: enums.h:311
HgiSamplingType
Definition: enums.h:762
HgiTextureUsageBits
Definition: enums.h:146
HgiTextureType
Definition: enums.h:110
HgiBits HgiBufferUsage
Definition: enums.h:322
HgiShaderStageBits
Definition: enums.h:352
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HgiBits HgiShaderStage
Definition: enums.h:364
HgiShaderTextureType
Definition: enums.h:803
uint32_t HgiBits
Definition: enums.h:16
HgiSampleCount
Definition: enums.h:238
HgiSamplerFilter
Definition: enums.h:185
HgiBits HgiColorMask
Definition: enums.h:528