enums.h
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 
14 PXR_NAMESPACE_OPEN_SCOPE
15 
16 using HgiBits = uint32_t;
17 
18 
68 enum HgiDeviceCapabilitiesBits : HgiBits
69 {
70  HgiDeviceCapabilitiesBitsPresentation = 1 << 0,
71  HgiDeviceCapabilitiesBitsBindlessBuffers = 1 << 1,
72  HgiDeviceCapabilitiesBitsConcurrentDispatch = 1 << 2,
73  HgiDeviceCapabilitiesBitsUnifiedMemory = 1 << 3,
74  HgiDeviceCapabilitiesBitsBuiltinBarycentrics = 1 << 4,
75  HgiDeviceCapabilitiesBitsShaderDrawParameters = 1 << 5,
76  HgiDeviceCapabilitiesBitsMultiDrawIndirect = 1 << 6,
77  HgiDeviceCapabilitiesBitsBindlessTextures = 1 << 7,
78  HgiDeviceCapabilitiesBitsShaderDoublePrecision = 1 << 8,
79  HgiDeviceCapabilitiesBitsDepthRangeMinusOnetoOne = 1 << 9,
80  HgiDeviceCapabilitiesBitsCppShaderPadding = 1 << 10,
81  HgiDeviceCapabilitiesBitsConservativeRaster = 1 << 11,
82  HgiDeviceCapabilitiesBitsStencilReadback = 1 << 12,
83  HgiDeviceCapabilitiesBitsCustomDepthRange = 1 << 13,
84  HgiDeviceCapabilitiesBitsMetalTessellation = 1 << 14,
85  HgiDeviceCapabilitiesBitsBasePrimitiveOffset = 1 << 15,
86  HgiDeviceCapabilitiesBitsPrimitiveIdEmulation = 1 << 16,
87  HgiDeviceCapabilitiesBitsIndirectCommandBuffers = 1 << 17,
88  HgiDeviceCapabilitiesBitsRoundPoints = 1 << 18,
89  HgiDeviceCapabilitiesBitsSingleSlotResourceArrays = 1 << 19,
90  HgiDeviceCapabilitiesForceEarlyFragmentTest = 1 << 20,
91 };
92 
93 using HgiDeviceCapabilities = HgiBits;
94 
114 enum HgiTextureType
115 {
116  HgiTextureType1D = 0,
117  HgiTextureType2D,
118  HgiTextureType3D,
119  HgiTextureTypeCubemap,
120  HgiTextureType1DArray,
121  HgiTextureType2DArray,
122 
123  HgiTextureTypeCount
124 };
125 
150 enum HgiTextureUsageBits : HgiBits
151 {
152  HgiTextureUsageBitsColorTarget = 1 << 0,
153  HgiTextureUsageBitsDepthTarget = 1 << 1,
154  HgiTextureUsageBitsStencilTarget = 1 << 2,
155  HgiTextureUsageBitsShaderRead = 1 << 3,
156  HgiTextureUsageBitsShaderWrite = 1 << 4,
157 
158  HgiTextureUsageCustomBitsBegin = 1 << 5,
159 };
160 
161 using HgiTextureUsage = HgiBits;
162 
167 enum HgiSamplerAddressMode
168 {
169  HgiSamplerAddressModeClampToEdge = 0,
170  HgiSamplerAddressModeMirrorClampToEdge,
171  HgiSamplerAddressModeRepeat,
172  HgiSamplerAddressModeMirrorRepeat,
173  HgiSamplerAddressModeClampToBorderColor,
174 
175  HgiSamplerAddressModeCount
176 };
177 
189 enum HgiSamplerFilter
190 {
191  HgiSamplerFilterNearest = 0,
192  HgiSamplerFilterLinear = 1,
193 
194  HgiSamplerFilterCount
195 };
196 
210 enum HgiMipFilter
211 {
212  HgiMipFilterNotMipmapped = 0,
213  HgiMipFilterNearest = 1,
214  HgiMipFilterLinear = 2,
215 
216  HgiMipFilterCount
217 };
218 
229 enum HgiBorderColor
230 {
231  HgiBorderColorTransparentBlack = 0,
232  HgiBorderColorOpaqueBlack = 1,
233  HgiBorderColorOpaqueWhite = 2,
234 
235  HgiBorderColorCount
236 };
237 
242 enum HgiSampleCount
243 {
244  HgiSampleCount1 = 1,
245  HgiSampleCount2 = 2,
246  HgiSampleCount4 = 4,
247  HgiSampleCount8 = 8,
248  HgiSampleCount16 = 16,
249 
250  HgiSampleCountEnd
251 };
252 
266 enum HgiAttachmentLoadOp
267 {
268  HgiAttachmentLoadOpDontCare = 0,
269  HgiAttachmentLoadOpClear,
270  HgiAttachmentLoadOpLoad,
271 
272  HgiAttachmentLoadOpCount
273 };
274 
286 enum HgiAttachmentStoreOp
287 {
288  HgiAttachmentStoreOpDontCare = 0,
289  HgiAttachmentStoreOpStore,
290 
291  HgiAttachmentStoreOpCount
292 };
293 
315 enum HgiBufferUsageBits : HgiBits
316 {
317  HgiBufferUsageUniform = 1 << 0,
318  HgiBufferUsageIndex32 = 1 << 1,
319  HgiBufferUsageVertex = 1 << 2,
320  HgiBufferUsageStorage = 1 << 3,
321  HgiBufferUsageIndirect = 1 << 4,
322  HgiBufferUsageUpload = 1 << 5,
323 
324  HgiBufferUsageCustomBitsBegin = 1 << 6,
325 };
326 using HgiBufferUsage = HgiBits;
327 
356 enum HgiShaderStageBits : HgiBits
357 {
358  HgiShaderStageVertex = 1 << 0,
359  HgiShaderStageFragment = 1 << 1,
360  HgiShaderStageCompute = 1 << 2,
361  HgiShaderStageTessellationControl = 1 << 3,
362  HgiShaderStageTessellationEval = 1 << 4,
363  HgiShaderStageGeometry = 1 << 5,
364  HgiShaderStagePostTessellationControl = 1 << 6,
365  HgiShaderStagePostTessellationVertex = 1 << 7,
366  HgiShaderStageCustomBitsBegin = 1 << 8,
367  HgiShaderStageAllGraphics = HgiShaderStageVertex
368  | HgiShaderStageFragment
369  | HgiShaderStageTessellationControl
370  | HgiShaderStageTessellationEval
371  | HgiShaderStageGeometry
372  | HgiShaderStagePostTessellationControl
373  | HgiShaderStagePostTessellationVertex,
374  HgiShaderStageAll = 0xFFFFFFFF
375 
376 };
377 using HgiShaderStage = HgiBits;
378 
405 enum HgiBindResourceType
406 {
407  HgiBindResourceTypeSampler = 0,
408  HgiBindResourceTypeSampledImage,
409  HgiBindResourceTypeCombinedSamplerImage,
410  HgiBindResourceTypeStorageImage,
411  HgiBindResourceTypeUniformBuffer,
412  HgiBindResourceTypeStorageBuffer,
413  HgiBindResourceTypeTessFactors,
414 
415  HgiBindResourceTypeCount
416 };
417 
431 enum HgiPolygonMode
432 {
433  HgiPolygonModeFill = 0,
434  HgiPolygonModeLine,
435  HgiPolygonModePoint,
436 
437  HgiPolygonModeCount
438 };
439 
455 enum HgiCullMode
456 {
457  HgiCullModeNone = 0,
458  HgiCullModeFront,
459  HgiCullModeBack,
460  HgiCullModeFrontAndBack,
461 
462  HgiCullModeCount
463 };
464 
476 enum HgiWinding
477 {
478  HgiWindingClockwise = 0,
479  HgiWindingCounterClockwise,
480 
481  HgiWindingCount
482 };
483 
484 
489 enum HgiBlendOp
490 {
491  HgiBlendOpAdd = 0,
492  HgiBlendOpSubtract,
493  HgiBlendOpReverseSubtract,
494  HgiBlendOpMin,
495  HgiBlendOpMax,
496 
497  HgiBlendOpCount
498 };
499 
504 enum HgiBlendFactor
505 {
506  HgiBlendFactorZero = 0,
507  HgiBlendFactorOne,
508  HgiBlendFactorSrcColor,
509  HgiBlendFactorOneMinusSrcColor,
510  HgiBlendFactorDstColor,
511  HgiBlendFactorOneMinusDstColor,
512  HgiBlendFactorSrcAlpha,
513  HgiBlendFactorOneMinusSrcAlpha,
514  HgiBlendFactorDstAlpha,
515  HgiBlendFactorOneMinusDstAlpha,
516  HgiBlendFactorConstantColor,
517  HgiBlendFactorOneMinusConstantColor,
518  HgiBlendFactorConstantAlpha,
519  HgiBlendFactorOneMinusConstantAlpha,
520  HgiBlendFactorSrcAlphaSaturate,
521  HgiBlendFactorSrc1Color,
522  HgiBlendFactorOneMinusSrc1Color,
523  HgiBlendFactorSrc1Alpha,
524  HgiBlendFactorOneMinusSrc1Alpha,
525 
526  HgiBlendFactorCount
527 };
528 
534 enum HgiColorMaskBits : HgiBits
535 {
536  HgiColorMaskRed = 1 << 0,
537  HgiColorMaskGreen = 1 << 1,
538  HgiColorMaskBlue = 1 << 2,
539  HgiColorMaskAlpha = 1 << 3,
540 };
541 using HgiColorMask = HgiBits;
542 
547 enum HgiCompareFunction
548 {
549  HgiCompareFunctionNever = 0,
550  HgiCompareFunctionLess,
551  HgiCompareFunctionEqual,
552  HgiCompareFunctionLEqual,
553  HgiCompareFunctionGreater,
554  HgiCompareFunctionNotEqual,
555  HgiCompareFunctionGEqual,
556  HgiCompareFunctionAlways,
557 
558  HgiCompareFunctionCount
559 };
560 
565 enum HgiStencilOp
566 {
567  HgiStencilOpKeep = 0,
568  HgiStencilOpZero,
569  HgiStencilOpReplace,
570  HgiStencilOpIncrementClamp,
571  HgiStencilOpDecrementClamp,
572  HgiStencilOpInvert,
573  HgiStencilOpIncrementWrap,
574  HgiStencilOpDecrementWrap,
575 
576  HgiStencilOpCount
577 };
578 
583 enum HgiComponentSwizzle
584 {
585  HgiComponentSwizzleZero = 0,
586  HgiComponentSwizzleOne,
587  HgiComponentSwizzleR,
588  HgiComponentSwizzleG,
589  HgiComponentSwizzleB,
590  HgiComponentSwizzleA,
591 
592  HgiComponentSwizzleCount
593 };
594 
616 enum HgiPrimitiveType
617 {
618  HgiPrimitiveTypePointList = 0,
619  HgiPrimitiveTypeLineList,
620  HgiPrimitiveTypeLineStrip,
621  HgiPrimitiveTypeTriangleList,
622  HgiPrimitiveTypePatchList,
623  HgiPrimitiveTypeLineListWithAdjacency,
624 
625  HgiPrimitiveTypeCount
626 };
627 
647 enum HgiVertexBufferStepFunction
648 {
649  HgiVertexBufferStepFunctionConstant = 0,
650  HgiVertexBufferStepFunctionPerVertex,
651  HgiVertexBufferStepFunctionPerInstance,
652  HgiVertexBufferStepFunctionPerPatch,
653  HgiVertexBufferStepFunctionPerPatchControlPoint,
654  HgiVertexBufferStepFunctionPerDrawCommand,
655 
656  HgiVertexBufferStepFunctionCount
657 };
658 
670 enum HgiSubmitWaitType
671 {
672  HgiSubmitWaitTypeNoWait = 0,
673  HgiSubmitWaitTypeWaitUntilCompleted,
674 };
675 
687 enum HgiMemoryBarrierBits
688 {
689  HgiMemoryBarrierNone = 0,
690  HgiMemoryBarrierAll = 1 << 0
691 };
692 using HgiMemoryBarrier = HgiBits;
693 
721 enum HgiBindingType
722 {
723  HgiBindingTypeValue = 0,
724  HgiBindingTypeUniformValue,
725  HgiBindingTypeArray,
726  HgiBindingTypeUniformArray,
727  HgiBindingTypePointer,
728 };
729 
749 enum HgiInterpolationType
750 {
751  HgiInterpolationDefault = 0,
752  HgiInterpolationFlat,
753  HgiInterpolationNoPerspective,
754 };
755 
775 enum HgiSamplingType
776 {
777  HgiSamplingDefault = 0,
778  HgiSamplingCentroid,
779  HgiSamplingSample,
780 };
781 
795 enum HgiStorageType
796 {
797  HgiStorageDefault = 0,
798  HgiStoragePatch,
799 };
800 
816 enum HgiShaderTextureType
817 {
818  HgiShaderTextureTypeTexture = 0,
819  HgiShaderTextureTypeShadowTexture,
820  HgiShaderTextureTypeArrayTexture,
821  HgiShaderTextureTypeCubemapTexture
822 };
823 
835 enum HgiComputeDispatch
836 {
837  HgiComputeDispatchSerial = 0,
838  HgiComputeDispatchConcurrent
839 };
840 
841 PXR_NAMESPACE_CLOSE_SCOPE
842 
843 #endif