|
| 1 | +//===-- DXILABI.cpp - ABI Sensitive Values for DXIL -----------------------===// |
| 2 | +// |
| 3 | +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | +// See https://llvm.org/LICENSE.txt for license information. |
| 5 | +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | +// |
| 7 | +//===----------------------------------------------------------------------===// |
| 8 | +// |
| 9 | +// This file contains definitions of various constants and enums that are |
| 10 | +// required to remain stable as per the DXIL format's requirements. |
| 11 | +// |
| 12 | +// Documentation for DXIL can be found in |
| 13 | +// https://github.com/Microsoft/DirectXShaderCompiler/blob/main/docs/DXIL.rst. |
| 14 | +// |
| 15 | +//===----------------------------------------------------------------------===// |
| 16 | + |
| 17 | +#include "llvm/Support/DXILABI.h" |
| 18 | +#include "llvm/Support/ScopedPrinter.h" |
| 19 | +using namespace llvm; |
| 20 | + |
| 21 | +static const EnumEntry<dxil::ResourceClass> ResourceClassNames[] = { |
| 22 | + {"SRV", llvm::dxil::ResourceClass::SRV}, |
| 23 | + {"UAV", llvm::dxil::ResourceClass::UAV}, |
| 24 | + {"CBV", llvm::dxil::ResourceClass::CBuffer}, |
| 25 | + {"Sampler", llvm::dxil::ResourceClass::Sampler}, |
| 26 | +}; |
| 27 | + |
| 28 | +ArrayRef<EnumEntry<llvm::dxil::ResourceClass>> dxil::getResourceClasses() { |
| 29 | + return ArrayRef(ResourceClassNames); |
| 30 | +} |
| 31 | + |
| 32 | +StringRef dxil::getResourceClassName(dxil::ResourceClass RC) { |
| 33 | + return enumToStringRef(RC, getResourceClasses()); |
| 34 | +} |
0 commit comments