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 /// </ul>
75 ///
77 {
94 };
95 
97 
98 /// \enum HgiTextureType
99 ///
100 /// Describes the kind of texture.
101 ///
102 /// <ul>
103 /// <li>HgiTextureType1D:
104 /// A one-dimensional texture.</li>
105 /// <li>HgiTextureType2D:
106 /// A two-dimensional texture.</li>
107 /// <li>HgiTextureType3D:
108 /// A three-dimensional texture.</li>
109 /// <li>HgiTextureType1DArray:
110 /// An array of one-dimensional textures.</li>
111 /// <li>HgiTextureType2DArray:
112 /// An array of two-dimensional textures.</li>
113 /// </ul>
114 ///
116 {
122 
124 };
125 
126 /// \enum HgiTextureUsageBits
127 ///
128 /// Describes how the texture will be used. If a texture has multiple uses you
129 /// can combine multiple bits.
130 ///
131 /// <ul>
132 /// <li>HgiTextureUsageBitsColorTarget:
133 /// The texture is a color attachment rendered into via a render pass.</li>
134 /// <li>HgiTextureUsageBitsDepthTarget:
135 /// The texture is a depth attachment rendered into via a render pass.</li>
136 /// <li>HgiTextureUsageBitsStencilTarget:
137 /// The texture is a stencil attachment rendered into via a render pass.</li>
138 /// <li>HgiTextureUsageBitsShaderRead:
139 /// The texture is sampled from in a shader (sampling)</li>
140 /// <li>HgiTextureUsageBitsShaderWrite:
141 /// The texture is written into from in a shader (image store)
142 /// When a texture is used as HgiBindResourceTypeStorageImage you must
143 /// add this flag (even if you only read from the image).</li>
144 ///
145 /// <li>HgiTextureUsageCustomBitsBegin:
146 /// This bit (and any bit after) can be used to attached custom, backend
147 /// specific bits to the usage bit. </li>
148 /// </ul>
149 ///
151 {
157 
159 };
160 
162 
163 /// \enum HgiSamplerAddressMode
164 ///
165 /// Various modes used during sampling of a texture.
166 ///
168 {
174 
176 };
177 
178 /// \enum HgiSamplerFilter
179 ///
180 /// Sampler filtering modes that determine the pixel value that is returned.
181 ///
182 /// <ul>
183 /// <li>HgiSamplerFilterNearest:
184 /// Returns the value of a single mipmap level.</li>
185 /// <li>HgiSamplerFilterLinear:
186 /// Combines the values of multiple mipmap levels.</li>
187 /// </ul>
188 ///
190 {
193 
195 };
196 
197 /// \enum HgiMipFilter
198 ///
199 /// Sampler filtering modes that determine the pixel value that is returned.
200 ///
201 /// <ul>
202 /// <li>HgiMipFilterNotMipmapped:
203 /// Texture is always sampled at mipmap level 0. (ie. max lod=0)</li>
204 /// <li>HgiMipFilterNearest:
205 /// Returns the value of a single mipmap level.</li>
206 /// <li>HgiMipFilterLinear:
207 /// Linear interpolates the values of up to two mipmap levels.</li>
208 /// </ul>
209 ///
211 {
215 
217 };
218 
219 /// \enum HgiBorderColor
220 ///
221 /// Border color to use for clamped texture values.
222 ///
223 /// <ul>
224 /// <li>HgiBorderColorTransparentBlack</li>
225 /// <li>HgiBorderColorOpaqueBlack</li>
226 /// <li>HgiBorderColorOpaqueWhite</li>
227 /// </ul>
228 ///
230 {
234 
236 };
237 
238 /// \enum HgiSampleCount
239 ///
240 /// Sample count for multi-sampling
241 ///
243 {
249 
251 };
252 
253 /// \enum HgiAttachmentLoadOp
254 ///
255 /// Describes what will happen to the attachment pixel data prior to rendering.
256 ///
257 /// <ul>
258 /// <li>HgiAttachmentLoadOpDontCare:
259 /// All pixels are rendered to. Pixel data in render target starts undefined.</li>
260 /// <li>HgiAttachmentLoadOpClear:
261 /// The attachment pixel data is cleared to a specified color value.</li>
262 /// <li>HgiAttachmentLoadOpLoad:
263 /// Previous pixel data is loaded into attachment prior to rendering.</li>
264 /// </ul>
265 ///
267 {
271 
273 };
274 
275 /// \enum HgiAttachmentStoreOp
276 ///
277 /// Describes what will happen to the attachment pixel data after rendering.
278 ///
279 /// <ul>
280 /// <li>HgiAttachmentStoreOpDontCare:
281 /// Pixel data is undefined after rendering has completed (no store cost)</li>
282 /// <li>HgiAttachmentStoreOpStore:
283 /// The attachment pixel data is stored in memory.</li>
284 /// </ul>
285 ///
287 {
290 
292 };
293 
294 /// \enum HgiBufferUsageBits
295 ///
296 /// Describes the properties and usage of the buffer.
297 ///
298 /// <ul>
299 /// <li>HgiBufferUsageUniform:
300 /// Shader uniform buffer </li>
301 /// <li>HgiBufferUsageIndex32:
302 /// Topology 32 bit indices.</li>
303 /// <li>HgiBufferUsageVertex:
304 /// Vertex attributes.</li>
305 /// <li>HgiBufferUsageStorage:
306 /// Shader storage buffer / Argument buffer.</li>
307 ///
308 /// <li>HgiBufferUsageCustomBitsBegin:
309 /// This bit (and any bit after) can be used to attached custom, backend
310 /// specific bits to the usage bit. </li>
311 /// </ul>
312 ///
314 {
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 /// </ul>
389 ///
391 {
398 
400 };
401 
402 /// \enum HgiPolygonMode
403 ///
404 /// Controls polygon mode during rasterization
405 ///
406 /// <ul>
407 /// <li>HgiPolygonModeFill:
408 /// Polygons are filled.</li>
409 /// <li>HgiPolygonModeLine:
410 /// Polygon edges are drawn as line segments.</li>
411 /// <li>HgiPolygonModePoint:
412 /// Polygon vertices are drawn as points.</li>
413 /// </ul>
414 ///
416 {
420 
422 };
423 
424 /// \enum HgiCullMode
425 ///
426 /// Controls primitive (faces) culling.
427 ///
428 /// <ul>
429 /// <li>HgiPolygonModeNone:
430 /// No primitive are discarded.</li>
431 /// <li>HgiPolygonModeFront:
432 /// Front-facing primitive are discarded.</li>
433 /// <li>HgiPolygonModeBack:
434 /// Back-facing primitive are discarded.</li>
435 /// <li>HgiPolygonModeFrontAndBack:
436 /// All primitive are discarded.</li>
437 /// </ul>
438 ///
440 {
445 
447 };
448 
449 /// \enum HgiWinding
450 ///
451 /// Determines the front-facing orientation of a primitive (face).
452 ///
453 /// <ul>
454 /// <li>HgiWindingClockwise:
455 /// Primitives with clockwise vertex-order are front facing.</li>
456 /// <li>HgiWindingCounterClockwise:
457 /// Primitives with counter-clockwise vertex-order are front facing.</li>
458 /// </ul>
459 ///
461 {
464 
466 };
467 
468 
469 /// \enum HgiBlendOp
470 ///
471 /// Blend operations
472 ///
474 {
480 
482 };
483 
484 /// \enum HgiBlendFactor
485 ///
486 /// Blend factors
487 ///
489 {
509 
511 };
512 
513 /// \enum HgiColorMaskBits
514 ///
515 /// Describes whether to permit or restrict writing to color components
516 /// of a color attachment.
517 ///
519 {
520  HgiColorMaskRed = 1 << 0,
524 };
526 
527 /// \enum HgiCompareFunction
528 ///
529 /// Compare functions.
530 ///
532 {
541 
543 };
544 
545 /// \enum HgiStencilOp
546 ///
547 /// Stencil operations.
548 ///
550 {
559 
561 };
562 
563 /// \enum HgiComponentSwizzle
564 ///
565 /// Swizzle for a component.
566 ///
568 {
575 
577 };
578 
579 /// \enum HgiPrimitiveType
580 ///
581 /// What the stream of vertices being rendered represents
582 ///
583 /// <ul>
584 /// <li>HgiPrimitiveTypePointList:
585 /// Rasterize a point at each vertex.</li>
586 /// <li>HgiPrimitiveTypeLineList:
587 /// Rasterize a line between each separate pair of vertices.</li>
588 /// <li>HgiPrimitiveTypeLineStrip:
589 /// Rasterize a line between each pair of adjacent vertices.</li>
590 /// <li>HgiPrimitiveTypeTriangleList:
591 /// Rasterize a triangle for every separate set of three vertices.</li>
592 /// <li>HgiPrimitiveTypePatchList:
593 /// A user-defined number of vertices, which is tessellated into
594 /// points, lines, or triangles.</li>
595 /// <li>HgiPrimitiveTypeLineListWithAdjacency:
596 /// A four-vertex encoding used to draw untriangulated quads.
597 /// Rasterize two triangles for every separate set of four vertices.</li>
598 /// </ul>
599 ///
601 {
608 
610 };
611 
612 /// \enum HgiVertexBufferStepFunction
613 ///
614 /// Describes the rate at which vertex attributes are pulled from buffers.
615 ///
616 /// <ul>
617 /// <li>HgiVertexBufferStepFunctionConstant:
618 /// The same attribute data is used for every vertex.</li>
619 /// <li>HgiVertexBufferStepFunctionPerVertex:
620 /// New attribute data is fetched for each vertex.</li>
621 /// <li>HgiVertexBufferStepFunctionPerInstance:
622 /// New attribute data is fetched for each instance.</li>
623 /// <li>HgiVertexBufferStepFunctionPerPatch:
624 /// New attribute data is fetched for each patch.</li>
625 /// <li>HgiVertexBufferStepFunctionPerPatchControlPoint:
626 /// New attribute data is fetched for each patch control point.</li>
627 /// <li>HgiVertexBufferStepFunctionPerDrawCommand:
628 /// New attribute data is fetched for each draw in a multi-draw command.</li>
629 /// </ul>
630 ///
632 {
639 
641 };
642 
643 /// \enum HgiSubmitWaitType
644 ///
645 /// Describes command submission wait behavior.
646 ///
647 /// <ul>
648 /// <li>HgiSubmitWaitTypeNoWait:
649 /// CPU should not wait for the GPU to finish processing the cmds.</li>
650 /// <li>HgiSubmitWaitTypeWaitUntilCompleted:
651 /// The CPU waits ("blocked") until the GPU has consumed the cmds.</li>
652 /// </ul>
653 ///
655 {
658 };
659 
660 /// \enum HgiMemoryBarrier
661 ///
662 /// Describes what objects the memory barrier affects.
663 ///
664 /// <ul>
665 /// <li>HgiMemoryBarrierNone:
666 /// No barrier (no-op).</li>
667 /// <li>HgiMemoryBarrierAll:
668 /// The barrier affects all memory writes and reads.</li>
669 /// </ul>
670 ///
672 {
675 };
677 
678 /// \enum HgiBindingType
679 ///
680 /// Describes the type of shader resource binding model to use.
681 ///
682 /// <ul>
683 /// <li>HgiBindingTypeValue:
684 /// Shader declares binding as a value.
685 /// Glsl example: buffer { int parameter; };
686 /// Msl example: int parameter;</li>
687 /// <li>HgiBindingTypeUniformValue:
688 /// Shader declares binding as a uniform block value.
689 /// Glsl example: uniform { int parameter; };
690 /// Msl example: int parameter;</li>
691 /// <li>HgiBindingTypeArray:
692 /// Shader declares binding as array value.
693 /// Glsl example: buffer { int parameter[n]; };
694 /// Msl example: int parameter[n];</li>
695 /// <li>HgiBindingTypeUniformArray:
696 /// Shader declares binding as uniform block array value.
697 /// Glsl example: uniform { int parameter[n]; };
698 /// Msl example: int parameter[n];</li>
699 /// <li>HgiBindingTypePointer:
700 /// Shader declares binding as pointer value.
701 /// Glsl example: buffer { int parameter[] };
702 /// Msl example: int *parameter;</li>
703 /// </ul>
704 ///
706 {
712 };
713 
714 /// \enum HgiInterpolationType
715 ///
716 /// Describes the type of shader resource binding model to use.
717 ///
718 /// <ul>
719 /// <li>HgiInterpolationDefault:
720 /// The shader input will have default interpolation.
721 /// Glsl example: vec2 parameter;
722 /// Msl example: vec2 parameter;</li>
723 /// <li>HgiInterpolationFlat:
724 /// The shader input will have no interpolation.
725 /// Glsl example: flat vec2 parameter;
726 /// Msl example: vec2 parameter[[flat]];</li>
727 /// <li>HgiBindingTypeNoPerspective:
728 /// The shader input will be linearly interpolated in screen-space
729 /// Glsl example: noperspective vec2 parameter;
730 /// Msl example: vec2 parameter[[center_no_perspective]];</li>
731 /// </ul>
732 ///
734 {
738 };
739 
740 /// \enum HgiShaderTextureType
741 ///
742 /// Describes the type of texture to be used in shader gen.
743 ///
744 /// <ul>
745 /// <li>HgiShaderTextureTypeTexture:
746 /// Indicates a regular texture.</li>
747 /// <li>HgiShaderTextureTypeShadowTexture:
748 /// Indicates a shadow texture.</li>
749 /// <li>HgiShaderTextureTypeArrayTexture:
750 /// Indicates an array texture.</li>
751 /// </ul>
752 ///
754 {
758 };
759 
761 
762 #endif
HgiSamplerAddressMode
Definition: enums.h:167
HgiColorMaskBits
Definition: enums.h:518
HgiPolygonMode
Definition: enums.h:415
HgiStencilOp
Definition: enums.h:549
HgiVertexBufferStepFunction
Definition: enums.h:631
HgiCompareFunction
Definition: enums.h:531
HgiAttachmentLoadOp
Definition: enums.h:266
HgiDeviceCapabilitiesBits
Definition: enums.h:76
HgiMipFilter
Definition: enums.h:210
HgiWinding
Definition: enums.h:460
HgiBits HgiDeviceCapabilities
Definition: enums.h:96
HgiBorderColor
Definition: enums.h:229
HgiBits HgiTextureUsage
Definition: enums.h:161
HgiCullMode
Definition: enums.h:439
HgiComponentSwizzle
Definition: enums.h:567
HgiSubmitWaitType
Definition: enums.h:654
HgiAttachmentStoreOp
Definition: enums.h:286
HgiInterpolationType
Definition: enums.h:733
HgiBindingType
Definition: enums.h:705
HgiBlendFactor
Definition: enums.h:488
HgiMemoryBarrierBits
Definition: enums.h:671
HgiBindResourceType
Definition: enums.h:390
HgiBits HgiMemoryBarrier
Definition: enums.h:676
HgiBlendOp
Definition: enums.h:473
HgiPrimitiveType
Definition: enums.h:600
HgiBufferUsageBits
Definition: enums.h:313
HgiTextureUsageBits
Definition: enums.h:150
HgiTextureType
Definition: enums.h:115
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1394
HgiBits HgiBufferUsage
Definition: enums.h:322
HgiShaderStageBits
Definition: enums.h:352
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
HgiBits HgiShaderStage
Definition: enums.h:364
HgiShaderTextureType
Definition: enums.h:753
uint32_t HgiBits
Definition: enums.h:33
HgiSampleCount
Definition: enums.h:242
HgiSamplerFilter
Definition: enums.h:189
HgiBits HgiColorMask
Definition: enums.h:525