forked from llvm/offload-test-suite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDXFeatures.cpp
More file actions
64 lines (54 loc) · 2.25 KB
/
Copy pathDXFeatures.cpp
File metadata and controls
64 lines (54 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//===- DX/DXFeatures.cpp - DirectX Device API -----------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
//
//===----------------------------------------------------------------------===//
#include "DXFeatures.h"
#include "llvm/ADT/Enum.h"
using namespace offloadtest;
using namespace offloadtest::directx;
using namespace llvm;
#define SHADER_MODEL_ENUM(NewCase, Str, Value) {{#Str}, NewCase},
static constexpr EnumStringDef<directx::ShaderModel> ShaderModelDefs[]{
#include "DXFeatures.def"
};
static constexpr auto ShaderModelNames = BUILD_ENUM_STRINGS(ShaderModelDefs);
#define ROOT_SIGNATURE_ENUM(NewCase, Str, Value) {{#Str}, NewCase},
static constexpr EnumStringDef<directx::RootSignature> RootSignatureDefs[]{
#include "DXFeatures.def"
};
static constexpr auto RootSignatureNames =
BUILD_ENUM_STRINGS(RootSignatureDefs);
#define MESH_SHADER_TIER_ENUM(NewCase, Str, Value) {{#Str}, NewCase},
static constexpr EnumStringDef<directx::MeshShaderTier> MeshShaderTierDefs[]{
#include "DXFeatures.def"
};
static constexpr auto MeshShaderTierNames =
BUILD_ENUM_STRINGS(MeshShaderTierDefs);
#define RAYTRACING_TIER_ENUM(NewCase, Str, Value) {{#Str}, NewCase},
static constexpr EnumStringDef<directx::RaytracingTier> RaytracingTierDefs[]{
#include "DXFeatures.def"
};
static constexpr auto RaytracingTierNames =
BUILD_ENUM_STRINGS(RaytracingTierDefs);
std::string CapabilityPrinter<directx::ShaderModel>::toString(
const directx::ShaderModel &V) {
return EnumStrings(ShaderModelNames).toString(V).str();
}
std::string CapabilityPrinter<directx::RootSignature>::toString(
const directx::RootSignature &V) {
return EnumStrings(RootSignatureNames).toString(V).str();
}
std::string CapabilityPrinter<directx::MeshShaderTier>::toString(
const directx::MeshShaderTier &V) {
return EnumStrings(MeshShaderTierNames).toString(V).str();
}
std::string CapabilityPrinter<directx::RaytracingTier>::toString(
const directx::RaytracingTier &V) {
return EnumStrings(RaytracingTierNames).toString(V).str();
}