[llvm] [DXIL] Add constraint specification and backend implementation of DXIL Ops (PR #97593)
Damyan Pepper via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 12 14:00:39 PDT 2024
================
@@ -221,6 +161,45 @@ static Type *getTypeFromParameterKind(ParameterKind Kind, Type *OverloadTy) {
return nullptr;
}
+static ShaderKind getShaderKindEnum(Triple::EnvironmentType EnvType) {
+ switch (EnvType) {
+ case Triple::Pixel:
+ return ShaderKind::pixel;
+ case Triple::Vertex:
+ return ShaderKind::vertex;
+ case Triple::Geometry:
+ return ShaderKind::geometry;
+ case Triple::Hull:
+ return ShaderKind::hull;
+ case Triple::Domain:
+ return ShaderKind::domain;
+ case Triple::Compute:
+ return ShaderKind::compute;
+ case Triple::Library:
+ return ShaderKind::library;
+ case Triple::RayGeneration:
+ return ShaderKind::raygeneration;
+ case Triple::Intersection:
+ return ShaderKind::intersection;
+ case Triple::AnyHit:
+ return ShaderKind::anyhit;
+ case Triple::ClosestHit:
+ return ShaderKind::closesthit;
+ case Triple::Miss:
+ return ShaderKind::miss;
+ case Triple::Callable:
+ return ShaderKind::callable;
+ case Triple::Mesh:
+ return ShaderKind::mesh;
+ case Triple::Amplification:
+ return ShaderKind::amplification;
+ default:
+ break;
+ }
+ llvm_unreachable(
----------------
damyanp wrote:
Should this be a diagnostic? I notice in the place that this function is called, UnknownEnvironment will cause a diagnostic.
https://github.com/llvm/llvm-project/pull/97593
More information about the llvm-commits
mailing list