Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:44:29

0001 //===-- DXILABI.h - ABI Sensitive Values for DXIL ---------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 // This file contains definitions of various constants and enums that are
0010 // required to remain stable as per the DXIL format's requirements.
0011 //
0012 // Documentation for DXIL can be found in
0013 // https://github.com/Microsoft/DirectXShaderCompiler/blob/main/docs/DXIL.rst.
0014 //
0015 //===----------------------------------------------------------------------===//
0016 
0017 #ifndef LLVM_SUPPORT_DXILABI_H
0018 #define LLVM_SUPPORT_DXILABI_H
0019 
0020 #include <cstdint>
0021 
0022 namespace llvm {
0023 namespace dxil {
0024 
0025 enum class ResourceClass : uint8_t {
0026   SRV = 0,
0027   UAV,
0028   CBuffer,
0029   Sampler,
0030 };
0031 
0032 /// The kind of resource for an SRV or UAV resource. Sometimes referred to as
0033 /// "Shape" in the DXIL docs.
0034 enum class ResourceKind : uint32_t {
0035   Invalid = 0,
0036   Texture1D,
0037   Texture2D,
0038   Texture2DMS,
0039   Texture3D,
0040   TextureCube,
0041   Texture1DArray,
0042   Texture2DArray,
0043   Texture2DMSArray,
0044   TextureCubeArray,
0045   TypedBuffer,
0046   RawBuffer,
0047   StructuredBuffer,
0048   CBuffer,
0049   Sampler,
0050   TBuffer,
0051   RTAccelerationStructure,
0052   FeedbackTexture2D,
0053   FeedbackTexture2DArray,
0054   NumEntries,
0055 };
0056 
0057 /// The element type of an SRV or UAV resource.
0058 enum class ElementType : uint32_t {
0059   Invalid = 0,
0060   I1,
0061   I16,
0062   U16,
0063   I32,
0064   U32,
0065   I64,
0066   U64,
0067   F16,
0068   F32,
0069   F64,
0070   SNormF16,
0071   UNormF16,
0072   SNormF32,
0073   UNormF32,
0074   SNormF64,
0075   UNormF64,
0076   PackedS8x32,
0077   PackedU8x32,
0078 };
0079 
0080 /// Metadata tags for extra resource properties.
0081 enum class ExtPropTags : uint32_t {
0082   ElementType = 0,
0083   StructuredBufferStride = 1,
0084   SamplerFeedbackKind = 2,
0085   Atomic64Use = 3,
0086 };
0087 
0088 enum class SamplerType : uint32_t {
0089   Default = 0,
0090   Comparison = 1,
0091   Mono = 2, // Note: Seems to be unused.
0092 };
0093 
0094 enum class SamplerFeedbackType : uint32_t {
0095   MinMip = 0,
0096   MipRegionUsed = 1,
0097 };
0098 
0099 const unsigned MinWaveSize = 4;
0100 const unsigned MaxWaveSize = 128;
0101 
0102 } // namespace dxil
0103 } // namespace llvm
0104 
0105 #endif // LLVM_SUPPORT_DXILABI_H