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 {
325 
327 };
329 
330 /// \enum HgiShaderStage
331 ///
332 /// Describes the stage a shader function operates in.
333 ///
334 /// <ul>
335 /// <li>HgiShaderStageVertex:
336 /// Vertex Shader.</li>
337 /// <li>HgiShaderStageFragment:
338 /// Fragment Shader.</li>
339 /// <li>HgiShaderStageCompute:
340 /// Compute Shader.</li>
341 /// <li>HgiShaderStageTessellationControl:
342 /// Transforms the control points of the low order surface (patch).
343 /// This runs before the tessellator fixed function stage.</li>
344 /// <li>HgiShaderStageTessellationEval:
345 /// Generates the surface geometry (the points) from the transformed control
346 /// points for every coordinate coming out of the tessellator fixed function
347 /// stage.</li>
348 /// <li>HgiShaderStageGeometry:
349 /// Governs the processing of Primitives.</li>
350 /// <li>HgiShaderStagePostTessellationControl:
351 /// Metal specific stage which computes tess factors
352 /// and modifies user post tess vertex data.</li>
353 /// <li>HgiShaderStagePostTessellationVertex:
354 /// Metal specific stage which performs tessellation and
355 /// vertex processing.</li>
356 /// </ul>
357 ///
359 {
369 };
371 
372 /// \enum HgiBindResourceType
373 ///
374 /// Describes the type of the resource to be bound.
375 ///
376 /// <ul>
377 /// <li>HgiBindResourceTypeSampler:
378 /// Sampler.
379 /// Glsl example: uniform sampler samplerOnly</li>
380 /// <li>HgiBindResourceTypeSampledImage:
381 /// Image for use with sampling ops.
382 /// Glsl example: uniform texture2D textureOnly
383 /// texture(sampler2D(textureOnly, samplerOnly), ...)</li>
384 /// <li>HgiBindResourceTypeCombinedSamplerImage:
385 /// Image and sampler combined into one.
386 /// Glsl example: uniform sampler2D texSmp;
387 /// texture(texSmp, ...)</li>
388 /// <li>HgiBindResourceTypeStorageImage:
389 /// Storage image used for image store/load ops (Unordered Access View).</li>
390 /// <li>HgiBindResourceTypeUniformBuffer:
391 /// Uniform buffer (UBO).</li>
392 /// <li>HgiBindResourceTypeStorageBuffer:
393 /// Shader storage buffer (SSBO).</li>
394 /// <li>HgiBindResourceTypeTessFactors:
395 /// Tessellation factors for Metal tessellation.</li>
396 /// </ul>
397 ///
399 {
407 
409 };
410 
411 /// \enum HgiPolygonMode
412 ///
413 /// Controls polygon mode during rasterization
414 ///
415 /// <ul>
416 /// <li>HgiPolygonModeFill:
417 /// Polygons are filled.</li>
418 /// <li>HgiPolygonModeLine:
419 /// Polygon edges are drawn as line segments.</li>
420 /// <li>HgiPolygonModePoint:
421 /// Polygon vertices are drawn as points.</li>
422 /// </ul>
423 ///
425 {
429 
431 };
432 
433 /// \enum HgiCullMode
434 ///
435 /// Controls primitive (faces) culling.
436 ///
437 /// <ul>
438 /// <li>HgiPolygonModeNone:
439 /// No primitive are discarded.</li>
440 /// <li>HgiPolygonModeFront:
441 /// Front-facing primitive are discarded.</li>
442 /// <li>HgiPolygonModeBack:
443 /// Back-facing primitive are discarded.</li>
444 /// <li>HgiPolygonModeFrontAndBack:
445 /// All primitive are discarded.</li>
446 /// </ul>
447 ///
449 {
454 
456 };
457 
458 /// \enum HgiWinding
459 ///
460 /// Determines the front-facing orientation of a primitive (face).
461 ///
462 /// <ul>
463 /// <li>HgiWindingClockwise:
464 /// Primitives with clockwise vertex-order are front facing.</li>
465 /// <li>HgiWindingCounterClockwise:
466 /// Primitives with counter-clockwise vertex-order are front facing.</li>
467 /// </ul>
468 ///
470 {
473 
475 };
476 
477 
478 /// \enum HgiBlendOp
479 ///
480 /// Blend operations
481 ///
483 {
489 
491 };
492 
493 /// \enum HgiBlendFactor
494 ///
495 /// Blend factors
496 ///
498 {
518 
520 };
521 
522 /// \enum HgiColorMaskBits
523 ///
524 /// Describes whether to permit or restrict writing to color components
525 /// of a color attachment.
526 ///
528 {
529  HgiColorMaskRed = 1 << 0,
533 };
535 
536 /// \enum HgiCompareFunction
537 ///
538 /// Compare functions.
539 ///
541 {
550 
552 };
553 
554 /// \enum HgiStencilOp
555 ///
556 /// Stencil operations.
557 ///
559 {
568 
570 };
571 
572 /// \enum HgiComponentSwizzle
573 ///
574 /// Swizzle for a component.
575 ///
577 {
584 
586 };
587 
588 /// \enum HgiPrimitiveType
589 ///
590 /// What the stream of vertices being rendered represents
591 ///
592 /// <ul>
593 /// <li>HgiPrimitiveTypePointList:
594 /// Rasterize a point at each vertex.</li>
595 /// <li>HgiPrimitiveTypeLineList:
596 /// Rasterize a line between each separate pair of vertices.</li>
597 /// <li>HgiPrimitiveTypeLineStrip:
598 /// Rasterize a line between each pair of adjacent vertices.</li>
599 /// <li>HgiPrimitiveTypeTriangleList:
600 /// Rasterize a triangle for every separate set of three vertices.</li>
601 /// <li>HgiPrimitiveTypePatchList:
602 /// A user-defined number of vertices, which is tessellated into
603 /// points, lines, or triangles.</li>
604 /// <li>HgiPrimitiveTypeLineListWithAdjacency:
605 /// A four-vertex encoding used to draw untriangulated quads.
606 /// Rasterize two triangles for every separate set of four vertices.</li>
607 /// </ul>
608 ///
610 {
617 
619 };
620 
621 /// \enum HgiVertexBufferStepFunction
622 ///
623 /// Describes the rate at which vertex attributes are pulled from buffers.
624 ///
625 /// <ul>
626 /// <li>HgiVertexBufferStepFunctionConstant:
627 /// The same attribute data is used for every vertex.</li>
628 /// <li>HgiVertexBufferStepFunctionPerVertex:
629 /// New attribute data is fetched for each vertex.</li>
630 /// <li>HgiVertexBufferStepFunctionPerInstance:
631 /// New attribute data is fetched for each instance.</li>
632 /// <li>HgiVertexBufferStepFunctionPerPatch:
633 /// New attribute data is fetched for each patch.</li>
634 /// <li>HgiVertexBufferStepFunctionPerPatchControlPoint:
635 /// New attribute data is fetched for each patch control point.</li>
636 /// <li>HgiVertexBufferStepFunctionPerDrawCommand:
637 /// New attribute data is fetched for each draw in a multi-draw command.</li>
638 /// </ul>
639 ///
641 {
648 
650 };
651 
652 /// \enum HgiSubmitWaitType
653 ///
654 /// Describes command submission wait behavior.
655 ///
656 /// <ul>
657 /// <li>HgiSubmitWaitTypeNoWait:
658 /// CPU should not wait for the GPU to finish processing the cmds.</li>
659 /// <li>HgiSubmitWaitTypeWaitUntilCompleted:
660 /// The CPU waits ("blocked") until the GPU has consumed the cmds.</li>
661 /// </ul>
662 ///
664 {
667 };
668 
669 /// \enum HgiMemoryBarrier
670 ///
671 /// Describes what objects the memory barrier affects.
672 ///
673 /// <ul>
674 /// <li>HgiMemoryBarrierNone:
675 /// No barrier (no-op).</li>
676 /// <li>HgiMemoryBarrierAll:
677 /// The barrier affects all memory writes and reads.</li>
678 /// </ul>
679 ///
681 {
684 };
686 
687 /// \enum HgiBindingType
688 ///
689 /// Describes the type of shader resource binding model to use.
690 ///
691 /// <ul>
692 /// <li>HgiBindingTypeValue:
693 /// Shader declares binding as a value.
694 /// Glsl example: buffer { int parameter; };
695 /// Msl example: int parameter;</li>
696 /// <li>HgiBindingTypeUniformValue:
697 /// Shader declares binding as a uniform block value.
698 /// Glsl example: uniform { int parameter; };
699 /// Msl example: int parameter;</li>
700 /// <li>HgiBindingTypeArray:
701 /// Shader declares binding as array value.
702 /// Glsl example: buffer { int parameter[n]; };
703 /// Msl example: int parameter[n];</li>
704 /// <li>HgiBindingTypeUniformArray:
705 /// Shader declares binding as uniform block array value.
706 /// Glsl example: uniform { int parameter[n]; };
707 /// Msl example: int parameter[n];</li>
708 /// <li>HgiBindingTypePointer:
709 /// Shader declares binding as pointer value.
710 /// Glsl example: buffer { int parameter[] };
711 /// Msl example: int *parameter;</li>
712 /// </ul>
713 ///
715 {
721 };
722 
723 /// \enum HgiInterpolationType
724 ///
725 /// Describes the type of parameter interpolation.
726 ///
727 /// <ul>
728 /// <li>HgiInterpolationDefault:
729 /// The shader input will have default interpolation.
730 /// Glsl example: vec2 parameter;
731 /// Msl example: vec2 parameter;</li>
732 /// <li>HgiInterpolationFlat:
733 /// The shader input will have no interpolation.
734 /// Glsl example: flat vec2 parameter;
735 /// Msl example: vec2 parameter[[flat]];</li>
736 /// <li>HgiBindingTypeNoPerspective:
737 /// The shader input will be linearly interpolated in screen-space
738 /// Glsl example: noperspective vec2 parameter;
739 /// Msl example: vec2 parameter[[center_no_perspective]];</li>
740 /// </ul>
741 ///
743 {
747 };
748 
749 /// \enum HgiSamplingType
750 ///
751 /// Describes the type of parameter sampling.
752 ///
753 /// <ul>
754 /// <li>HgiSamplingDefault:
755 /// The shader input will have default sampling.
756 /// Glsl example: vec2 parameter;
757 /// Msl example: vec2 parameter;</li>
758 /// <li>HgiSamplingCentroid:
759 /// The shader input will have centroid sampling.
760 /// Glsl example: centroid vec2 parameter;
761 /// Msl example: vec2 parameter[[centroid_perspective]];</li>
762 /// <li>HgiSamplingSample:
763 /// The shader input will have per-sample sampling.
764 /// Glsl example: sample vec2 parameter;
765 /// Msl example: vec2 parameter[[sample_perspective]];</li>
766 /// </ul>
767 ///
769 {
773 };
774 
775 /// \enum HgiStorageType
776 ///
777 /// Describes the type of parameter storage.
778 ///
779 /// <ul>
780 /// <li>HgiStorageDefault:
781 /// The shader input will have default storage.
782 /// Glsl example: vec2 parameter;</li>
783 /// <li>HgiStoragePatch:
784 /// The shader input will have per-patch storage.
785 /// Glsl example: patch vec2 parameter;</li>
786 /// </ul>
787 ///
789 {
792 };
793 
794 /// \enum HgiShaderTextureType
795 ///
796 /// Describes the type of texture to be used in shader gen.
797 ///
798 /// <ul>
799 /// <li>HgiShaderTextureTypeTexture:
800 /// Indicates a regular texture.</li>
801 /// <li>HgiShaderTextureTypeShadowTexture:
802 /// Indicates a shadow texture.</li>
803 /// <li>HgiShaderTextureTypeArrayTexture:
804 /// Indicates an array texture.</li>
805 /// </ul>
806 ///
808 {
812 };
813 
814 /// \enum HgiComputeDispatch
815 ///
816 /// Specifies the dispatch method for compute encoders.
817 ///
818 /// <ul>
819 /// <li>HgiComputeDispatchSerial:
820 /// Kernels are dispatched serially.</li>
821 /// <li>HgiComputeDispatchConcurrent:
822 /// Kernels are dispatched concurrently, if supported by the API</li>
823 /// </ul>
824 ///
826 {
829 };
830 
832 
833 #endif
HgiSamplerAddressMode
Definition: enums.h:173
HgiStorageType
Definition: enums.h:788
HgiColorMaskBits
Definition: enums.h:527
HgiPolygonMode
Definition: enums.h:424
HgiStencilOp
Definition: enums.h:558
HgiVertexBufferStepFunction
Definition: enums.h:640
HgiCompareFunction
Definition: enums.h:540
HgiAttachmentLoadOp
Definition: enums.h:272
HgiDeviceCapabilitiesBits
Definition: enums.h:80
HgiMipFilter
Definition: enums.h:216
HgiWinding
Definition: enums.h:469
HgiBits HgiDeviceCapabilities
Definition: enums.h:102
HgiBorderColor
Definition: enums.h:235
HgiBits HgiTextureUsage
Definition: enums.h:167
HgiCullMode
Definition: enums.h:448
HgiComponentSwizzle
Definition: enums.h:576
HgiSubmitWaitType
Definition: enums.h:663
HgiAttachmentStoreOp
Definition: enums.h:292
HgiInterpolationType
Definition: enums.h:742
HgiComputeDispatch
Definition: enums.h:825
HgiBindingType
Definition: enums.h:714
HgiBlendFactor
Definition: enums.h:497
HgiMemoryBarrierBits
Definition: enums.h:680
HgiBindResourceType
Definition: enums.h:398
HgiBits HgiMemoryBarrier
Definition: enums.h:685
HgiBlendOp
Definition: enums.h:482
HgiPrimitiveType
Definition: enums.h:609
HgiBufferUsageBits
Definition: enums.h:319
HgiSamplingType
Definition: enums.h:768
HgiTextureUsageBits
Definition: enums.h:156
HgiTextureType
Definition: enums.h:121
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1441
HgiBits HgiBufferUsage
Definition: enums.h:328
HgiShaderStageBits
Definition: enums.h:358
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
HgiBits HgiShaderStage
Definition: enums.h:370
HgiShaderTextureType
Definition: enums.h:807
uint32_t HgiBits
Definition: enums.h:33
HgiSampleCount
Definition: enums.h:248
HgiSamplerFilter
Definition: enums.h:195
HgiBits HgiColorMask
Definition: enums.h:534