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 /// <li>HgiDeviceCapabilitiesBitsBindlessBuffers:
44 /// THe device can access GPU buffers using bindless handles</li>
45 /// <li>HgiDeviceCapabilitiesBitsConcurrentDispatch:
46 /// The device can execute commands concurrently</li>
47 /// <li>HgiDeviceCapabilitiesBitsUnifiedMemory:
48 /// The device shares all GPU and CPU memory</li>
49 /// <li>HgiDeviceCapabilitiesBitsBuiltinBarycentrics:
50 /// The device can provide built-in barycentric coordinates</li>
51 /// <li>HgiDeviceCapabilitiesBitsShaderDrawParameters:
52 /// The device can provide additional built-in shader variables corresponding
53 /// to draw command parameters</li>
54 /// <li>HgiDeviceCapabilitiesBitsMultiDrawIndirect:
55 /// The device supports multiple primitive, indirect drawing</li>
56 /// <li>HgiDeviceCapabilitiesBitsBindlessTextures:
57 /// The device can access GPU textures using bindless handles</li>
58 /// <li>HgiDeviceCapabilitiesBitsShaderDoublePrecision:
59 /// The device supports double precision types in shaders</li>
60 /// <li>HgiDeviceCapabilitiesBitsDepthRangeMinusOnetoOne:
61 /// The device's clip space depth ranges from [-1,1]</li>
62 /// <li>HgiDeviceCapabilitiesBitsCppShaderPadding:
63 /// Use CPP padding for shader language structures</li>
64 /// <li>HgiDeviceCapabilitiesBitsConservativeRaster:
65 /// The device supports conservative rasterization</li>
66 /// <li>HgiDeviceCapabilitiesBitsStencilReadback:
67 /// Supports reading back the stencil buffer from GPU to CPU.</li>
68 /// <li>HgiDeviceCapabilitiesBitsCustomDepthRange:
69 /// The device supports setting a custom depth range.</li>
70 /// <li>HgiDeviceCapabilitiesBitsMetalTessellation:
71 /// Supports Metal tessellation shaders</li>
72 /// <li>HgiDeviceCapabilitiesBitsBasePrimitiveOffset:
73 /// The device requires workaround for base primitive offset</li>
74 /// <li>HgiDeviceCapabilitiesBitsPrimitiveIdEmulation:
75 /// The device requires workaround for primitive id</li>
76 /// <li>HgiDeviceCapabilitiesBitsIndirectCommandBuffers:
77 /// Indirect command buffers are supported</li>
78 /// </ul>
79 ///
81 {
100 };
101 
103 
104 /// \enum HgiTextureType
105 ///
106 /// Describes the kind of texture.
107 ///
108 /// <ul>
109 /// <li>HgiTextureType1D:
110 /// A one-dimensional texture.</li>
111 /// <li>HgiTextureType2D:
112 /// A two-dimensional texture.</li>
113 /// <li>HgiTextureType3D:
114 /// A three-dimensional texture.</li>
115 /// <li>HgiTextureType1DArray:
116 /// An array of one-dimensional textures.</li>
117 /// <li>HgiTextureType2DArray:
118 /// An array of two-dimensional textures.</li>
119 /// </ul>
120 ///
122 {
128 
130 };
131 
132 /// \enum HgiTextureUsageBits
133 ///
134 /// Describes how the texture will be used. If a texture has multiple uses you
135 /// can combine multiple bits.
136 ///
137 /// <ul>
138 /// <li>HgiTextureUsageBitsColorTarget:
139 /// The texture is a color attachment rendered into via a render pass.</li>
140 /// <li>HgiTextureUsageBitsDepthTarget:
141 /// The texture is a depth attachment rendered into via a render pass.</li>
142 /// <li>HgiTextureUsageBitsStencilTarget:
143 /// The texture is a stencil attachment rendered into via a render pass.</li>
144 /// <li>HgiTextureUsageBitsShaderRead:
145 /// The texture is sampled from in a shader (sampling)</li>
146 /// <li>HgiTextureUsageBitsShaderWrite:
147 /// The texture is written into from in a shader (image store)
148 /// When a texture is used as HgiBindResourceTypeStorageImage you must
149 /// add this flag (even if you only read from the image).</li>
150 ///
151 /// <li>HgiTextureUsageCustomBitsBegin:
152 /// This bit (and any bit after) can be used to attached custom, backend
153 /// specific bits to the usage bit. </li>
154 /// </ul>
155 ///
157 {
163 
165 };
166 
168 
169 /// \enum HgiSamplerAddressMode
170 ///
171 /// Various modes used during sampling of a texture.
172 ///
174 {
180 
182 };
183 
184 /// \enum HgiSamplerFilter
185 ///
186 /// Sampler filtering modes that determine the pixel value that is returned.
187 ///
188 /// <ul>
189 /// <li>HgiSamplerFilterNearest:
190 /// Returns the value of a single mipmap level.</li>
191 /// <li>HgiSamplerFilterLinear:
192 /// Combines the values of multiple mipmap levels.</li>
193 /// </ul>
194 ///
196 {
199 
201 };
202 
203 /// \enum HgiMipFilter
204 ///
205 /// Sampler filtering modes that determine the pixel value that is returned.
206 ///
207 /// <ul>
208 /// <li>HgiMipFilterNotMipmapped:
209 /// Texture is always sampled at mipmap level 0. (ie. max lod=0)</li>
210 /// <li>HgiMipFilterNearest:
211 /// Returns the value of a single mipmap level.</li>
212 /// <li>HgiMipFilterLinear:
213 /// Linear interpolates the values of up to two mipmap levels.</li>
214 /// </ul>
215 ///
217 {
221 
223 };
224 
225 /// \enum HgiBorderColor
226 ///
227 /// Border color to use for clamped texture values.
228 ///
229 /// <ul>
230 /// <li>HgiBorderColorTransparentBlack</li>
231 /// <li>HgiBorderColorOpaqueBlack</li>
232 /// <li>HgiBorderColorOpaqueWhite</li>
233 /// </ul>
234 ///
236 {
240 
242 };
243 
244 /// \enum HgiSampleCount
245 ///
246 /// Sample count for multi-sampling
247 ///
249 {
255 
257 };
258 
259 /// \enum HgiAttachmentLoadOp
260 ///
261 /// Describes what will happen to the attachment pixel data prior to rendering.
262 ///
263 /// <ul>
264 /// <li>HgiAttachmentLoadOpDontCare:
265 /// All pixels are rendered to. Pixel data in render target starts undefined.</li>
266 /// <li>HgiAttachmentLoadOpClear:
267 /// The attachment pixel data is cleared to a specified color value.</li>
268 /// <li>HgiAttachmentLoadOpLoad:
269 /// Previous pixel data is loaded into attachment prior to rendering.</li>
270 /// </ul>
271 ///
273 {
277 
279 };
280 
281 /// \enum HgiAttachmentStoreOp
282 ///
283 /// Describes what will happen to the attachment pixel data after rendering.
284 ///
285 /// <ul>
286 /// <li>HgiAttachmentStoreOpDontCare:
287 /// Pixel data is undefined after rendering has completed (no store cost)</li>
288 /// <li>HgiAttachmentStoreOpStore:
289 /// The attachment pixel data is stored in memory.</li>
290 /// </ul>
291 ///
293 {
296 
298 };
299 
300 /// \enum HgiBufferUsageBits
301 ///
302 /// Describes the properties and usage of the buffer.
303 ///
304 /// <ul>
305 /// <li>HgiBufferUsageUniform:
306 /// Shader uniform buffer </li>
307 /// <li>HgiBufferUsageIndex32:
308 /// Topology 32 bit indices.</li>
309 /// <li>HgiBufferUsageVertex:
310 /// Vertex attributes.</li>
311 /// <li>HgiBufferUsageStorage:
312 /// Shader storage buffer / Argument buffer.</li>
313 ///
314 /// <li>HgiBufferUsageCustomBitsBegin:
315 /// This bit (and any bit after) can be used to attached custom, backend
316 /// specific bits to the usage bit. </li>
317 /// </ul>
318 ///
320 {
326 
328 };
330 
331 /// \enum HgiShaderStage
332 ///
333 /// Describes the stage a shader function operates in.
334 ///
335 /// <ul>
336 /// <li>HgiShaderStageVertex:
337 /// Vertex Shader.</li>
338 /// <li>HgiShaderStageFragment:
339 /// Fragment Shader.</li>
340 /// <li>HgiShaderStageCompute:
341 /// Compute Shader.</li>
342 /// <li>HgiShaderStageTessellationControl:
343 /// Transforms the control points of the low order surface (patch).
344 /// This runs before the tessellator fixed function stage.</li>
345 /// <li>HgiShaderStageTessellationEval:
346 /// Generates the surface geometry (the points) from the transformed control
347 /// points for every coordinate coming out of the tessellator fixed function
348 /// stage.</li>
349 /// <li>HgiShaderStageGeometry:
350 /// Governs the processing of Primitives.</li>
351 /// <li>HgiShaderStagePostTessellationControl:
352 /// Metal specific stage which computes tess factors
353 /// and modifies user post tess vertex data.</li>
354 /// <li>HgiShaderStagePostTessellationVertex:
355 /// Metal specific stage which performs tessellation and
356 /// vertex processing.</li>
357 /// </ul>
358 ///
360 {
370 };
372 
373 /// \enum HgiBindResourceType
374 ///
375 /// Describes the type of the resource to be bound.
376 ///
377 /// <ul>
378 /// <li>HgiBindResourceTypeSampler:
379 /// Sampler.
380 /// Glsl example: uniform sampler samplerOnly</li>
381 /// <li>HgiBindResourceTypeSampledImage:
382 /// Image for use with sampling ops.
383 /// Glsl example: uniform texture2D textureOnly
384 /// texture(sampler2D(textureOnly, samplerOnly), ...)</li>
385 /// <li>HgiBindResourceTypeCombinedSamplerImage:
386 /// Image and sampler combined into one.
387 /// Glsl example: uniform sampler2D texSmp;
388 /// texture(texSmp, ...)</li>
389 /// <li>HgiBindResourceTypeStorageImage:
390 /// Storage image used for image store/load ops (Unordered Access View).</li>
391 /// <li>HgiBindResourceTypeUniformBuffer:
392 /// Uniform buffer (UBO).</li>
393 /// <li>HgiBindResourceTypeStorageBuffer:
394 /// Shader storage buffer (SSBO).</li>
395 /// <li>HgiBindResourceTypeTessFactors:
396 /// Tessellation factors for Metal tessellation.</li>
397 /// </ul>
398 ///
400 {
408 
410 };
411 
412 /// \enum HgiPolygonMode
413 ///
414 /// Controls polygon mode during rasterization
415 ///
416 /// <ul>
417 /// <li>HgiPolygonModeFill:
418 /// Polygons are filled.</li>
419 /// <li>HgiPolygonModeLine:
420 /// Polygon edges are drawn as line segments.</li>
421 /// <li>HgiPolygonModePoint:
422 /// Polygon vertices are drawn as points.</li>
423 /// </ul>
424 ///
426 {
430 
432 };
433 
434 /// \enum HgiCullMode
435 ///
436 /// Controls primitive (faces) culling.
437 ///
438 /// <ul>
439 /// <li>HgiPolygonModeNone:
440 /// No primitive are discarded.</li>
441 /// <li>HgiPolygonModeFront:
442 /// Front-facing primitive are discarded.</li>
443 /// <li>HgiPolygonModeBack:
444 /// Back-facing primitive are discarded.</li>
445 /// <li>HgiPolygonModeFrontAndBack:
446 /// All primitive are discarded.</li>
447 /// </ul>
448 ///
450 {
455 
457 };
458 
459 /// \enum HgiWinding
460 ///
461 /// Determines the front-facing orientation of a primitive (face).
462 ///
463 /// <ul>
464 /// <li>HgiWindingClockwise:
465 /// Primitives with clockwise vertex-order are front facing.</li>
466 /// <li>HgiWindingCounterClockwise:
467 /// Primitives with counter-clockwise vertex-order are front facing.</li>
468 /// </ul>
469 ///
471 {
474 
476 };
477 
478 
479 /// \enum HgiBlendOp
480 ///
481 /// Blend operations
482 ///
484 {
490 
492 };
493 
494 /// \enum HgiBlendFactor
495 ///
496 /// Blend factors
497 ///
499 {
519 
521 };
522 
523 /// \enum HgiColorMaskBits
524 ///
525 /// Describes whether to permit or restrict writing to color components
526 /// of a color attachment.
527 ///
529 {
530  HgiColorMaskRed = 1 << 0,
534 };
536 
537 /// \enum HgiCompareFunction
538 ///
539 /// Compare functions.
540 ///
542 {
551 
553 };
554 
555 /// \enum HgiStencilOp
556 ///
557 /// Stencil operations.
558 ///
560 {
569 
571 };
572 
573 /// \enum HgiComponentSwizzle
574 ///
575 /// Swizzle for a component.
576 ///
578 {
585 
587 };
588 
589 /// \enum HgiPrimitiveType
590 ///
591 /// What the stream of vertices being rendered represents
592 ///
593 /// <ul>
594 /// <li>HgiPrimitiveTypePointList:
595 /// Rasterize a point at each vertex.</li>
596 /// <li>HgiPrimitiveTypeLineList:
597 /// Rasterize a line between each separate pair of vertices.</li>
598 /// <li>HgiPrimitiveTypeLineStrip:
599 /// Rasterize a line between each pair of adjacent vertices.</li>
600 /// <li>HgiPrimitiveTypeTriangleList:
601 /// Rasterize a triangle for every separate set of three vertices.</li>
602 /// <li>HgiPrimitiveTypePatchList:
603 /// A user-defined number of vertices, which is tessellated into
604 /// points, lines, or triangles.</li>
605 /// <li>HgiPrimitiveTypeLineListWithAdjacency:
606 /// A four-vertex encoding used to draw untriangulated quads.
607 /// Rasterize two triangles for every separate set of four vertices.</li>
608 /// </ul>
609 ///
611 {
618 
620 };
621 
622 /// \enum HgiVertexBufferStepFunction
623 ///
624 /// Describes the rate at which vertex attributes are pulled from buffers.
625 ///
626 /// <ul>
627 /// <li>HgiVertexBufferStepFunctionConstant:
628 /// The same attribute data is used for every vertex.</li>
629 /// <li>HgiVertexBufferStepFunctionPerVertex:
630 /// New attribute data is fetched for each vertex.</li>
631 /// <li>HgiVertexBufferStepFunctionPerInstance:
632 /// New attribute data is fetched for each instance.</li>
633 /// <li>HgiVertexBufferStepFunctionPerPatch:
634 /// New attribute data is fetched for each patch.</li>
635 /// <li>HgiVertexBufferStepFunctionPerPatchControlPoint:
636 /// New attribute data is fetched for each patch control point.</li>
637 /// <li>HgiVertexBufferStepFunctionPerDrawCommand:
638 /// New attribute data is fetched for each draw in a multi-draw command.</li>
639 /// </ul>
640 ///
642 {
649 
651 };
652 
653 /// \enum HgiSubmitWaitType
654 ///
655 /// Describes command submission wait behavior.
656 ///
657 /// <ul>
658 /// <li>HgiSubmitWaitTypeNoWait:
659 /// CPU should not wait for the GPU to finish processing the cmds.</li>
660 /// <li>HgiSubmitWaitTypeWaitUntilCompleted:
661 /// The CPU waits ("blocked") until the GPU has consumed the cmds.</li>
662 /// </ul>
663 ///
665 {
668 };
669 
670 /// \enum HgiMemoryBarrier
671 ///
672 /// Describes what objects the memory barrier affects.
673 ///
674 /// <ul>
675 /// <li>HgiMemoryBarrierNone:
676 /// No barrier (no-op).</li>
677 /// <li>HgiMemoryBarrierAll:
678 /// The barrier affects all memory writes and reads.</li>
679 /// </ul>
680 ///
682 {
685 };
687 
688 /// \enum HgiBindingType
689 ///
690 /// Describes the type of shader resource binding model to use.
691 ///
692 /// <ul>
693 /// <li>HgiBindingTypeValue:
694 /// Shader declares binding as a value.
695 /// Glsl example: buffer { int parameter; };
696 /// Msl example: int parameter;</li>
697 /// <li>HgiBindingTypeUniformValue:
698 /// Shader declares binding as a uniform block value.
699 /// Glsl example: uniform { int parameter; };
700 /// Msl example: int parameter;</li>
701 /// <li>HgiBindingTypeArray:
702 /// Shader declares binding as array value.
703 /// Glsl example: buffer { int parameter[n]; };
704 /// Msl example: int parameter[n];</li>
705 /// <li>HgiBindingTypeUniformArray:
706 /// Shader declares binding as uniform block array value.
707 /// Glsl example: uniform { int parameter[n]; };
708 /// Msl example: int parameter[n];</li>
709 /// <li>HgiBindingTypePointer:
710 /// Shader declares binding as pointer value.
711 /// Glsl example: buffer { int parameter[] };
712 /// Msl example: int *parameter;</li>
713 /// </ul>
714 ///
716 {
722 };
723 
724 /// \enum HgiInterpolationType
725 ///
726 /// Describes the type of parameter interpolation.
727 ///
728 /// <ul>
729 /// <li>HgiInterpolationDefault:
730 /// The shader input will have default interpolation.
731 /// Glsl example: vec2 parameter;
732 /// Msl example: vec2 parameter;</li>
733 /// <li>HgiInterpolationFlat:
734 /// The shader input will have no interpolation.
735 /// Glsl example: flat vec2 parameter;
736 /// Msl example: vec2 parameter[[flat]];</li>
737 /// <li>HgiBindingTypeNoPerspective:
738 /// The shader input will be linearly interpolated in screen-space
739 /// Glsl example: noperspective vec2 parameter;
740 /// Msl example: vec2 parameter[[center_no_perspective]];</li>
741 /// </ul>
742 ///
744 {
748 };
749 
750 /// \enum HgiSamplingType
751 ///
752 /// Describes the type of parameter sampling.
753 ///
754 /// <ul>
755 /// <li>HgiSamplingDefault:
756 /// The shader input will have default sampling.
757 /// Glsl example: vec2 parameter;
758 /// Msl example: vec2 parameter;</li>
759 /// <li>HgiSamplingCentroid:
760 /// The shader input will have centroid sampling.
761 /// Glsl example: centroid vec2 parameter;
762 /// Msl example: vec2 parameter[[centroid_perspective]];</li>
763 /// <li>HgiSamplingSample:
764 /// The shader input will have per-sample sampling.
765 /// Glsl example: sample vec2 parameter;
766 /// Msl example: vec2 parameter[[sample_perspective]];</li>
767 /// </ul>
768 ///
770 {
774 };
775 
776 /// \enum HgiStorageType
777 ///
778 /// Describes the type of parameter storage.
779 ///
780 /// <ul>
781 /// <li>HgiStorageDefault:
782 /// The shader input will have default storage.
783 /// Glsl example: vec2 parameter;</li>
784 /// <li>HgiStoragePatch:
785 /// The shader input will have per-patch storage.
786 /// Glsl example: patch vec2 parameter;</li>
787 /// </ul>
788 ///
790 {
793 };
794 
795 /// \enum HgiShaderTextureType
796 ///
797 /// Describes the type of texture to be used in shader gen.
798 ///
799 /// <ul>
800 /// <li>HgiShaderTextureTypeTexture:
801 /// Indicates a regular texture.</li>
802 /// <li>HgiShaderTextureTypeShadowTexture:
803 /// Indicates a shadow texture.</li>
804 /// <li>HgiShaderTextureTypeArrayTexture:
805 /// Indicates an array texture.</li>
806 /// </ul>
807 ///
809 {
813 };
814 
815 /// \enum HgiComputeDispatch
816 ///
817 /// Specifies the dispatch method for compute encoders.
818 ///
819 /// <ul>
820 /// <li>HgiComputeDispatchSerial:
821 /// Kernels are dispatched serially.</li>
822 /// <li>HgiComputeDispatchConcurrent:
823 /// Kernels are dispatched concurrently, if supported by the API</li>
824 /// </ul>
825 ///
827 {
830 };
831 
833 
834 #endif
HgiSamplerAddressMode
Definition: enums.h:173
HgiStorageType
Definition: enums.h:789
HgiColorMaskBits
Definition: enums.h:528
HgiPolygonMode
Definition: enums.h:425
HgiStencilOp
Definition: enums.h:559
HgiVertexBufferStepFunction
Definition: enums.h:641
HgiCompareFunction
Definition: enums.h:541
HgiAttachmentLoadOp
Definition: enums.h:272
HgiDeviceCapabilitiesBits
Definition: enums.h:80
HgiMipFilter
Definition: enums.h:216
HgiWinding
Definition: enums.h:470
HgiBits HgiDeviceCapabilities
Definition: enums.h:102
HgiBorderColor
Definition: enums.h:235
HgiBits HgiTextureUsage
Definition: enums.h:167
HgiCullMode
Definition: enums.h:449
HgiComponentSwizzle
Definition: enums.h:577
HgiSubmitWaitType
Definition: enums.h:664
HgiAttachmentStoreOp
Definition: enums.h:292
HgiInterpolationType
Definition: enums.h:743
HgiComputeDispatch
Definition: enums.h:826
HgiBindingType
Definition: enums.h:715
HgiBlendFactor
Definition: enums.h:498
HgiMemoryBarrierBits
Definition: enums.h:681
HgiBindResourceType
Definition: enums.h:399
HgiBits HgiMemoryBarrier
Definition: enums.h:686
HgiBlendOp
Definition: enums.h:483
HgiPrimitiveType
Definition: enums.h:610
HgiBufferUsageBits
Definition: enums.h:319
HgiSamplingType
Definition: enums.h:769
HgiTextureUsageBits
Definition: enums.h:156
HgiTextureType
Definition: enums.h:121
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1432
HgiBits HgiBufferUsage
Definition: enums.h:329
HgiShaderStageBits
Definition: enums.h:359
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
HgiBits HgiShaderStage
Definition: enums.h:371
HgiShaderTextureType
Definition: enums.h:808
uint32_t HgiBits
Definition: enums.h:33
HgiSampleCount
Definition: enums.h:248
HgiSamplerFilter
Definition: enums.h:195
HgiBits HgiColorMask
Definition: enums.h:535