34 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8//9// This file contains definitions of various constants and enums that are10// required to remain stable as per the DXIL format's requirements.11//12// Documentation for DXIL can be found in13// https://github.com/Microsoft/DirectXShaderCompiler/blob/main/docs/DXIL.rst.14//15//===----------------------------------------------------------------------===//16 17#include "llvm/Support/DXILABI.h"18#include "llvm/Support/ErrorHandling.h"19using namespace llvm;20 21StringRef dxil::getResourceClassName(dxil::ResourceClass RC) {22 switch (RC) {23 case dxil::ResourceClass::SRV:24 return "SRV";25 case dxil::ResourceClass::UAV:26 return "UAV";27 case dxil::ResourceClass::CBuffer:28 return "CBV";29 case dxil::ResourceClass::Sampler:30 return "Sampler";31 }32 llvm_unreachable("Invalid ResourceClass enum value");33}34