NFC: Fix switch with missing default case in DxilShaderModel.cpp (#6288)
This missing default case statement would cause build break when compiling with additional warning settings, such as /W4 /WX in VC++. Fixes #6287.
This commit is contained in:
Родитель
30f45bcf0f
Коммит
627e400dea
|
@ -230,6 +230,9 @@ enum class ShaderKind {
|
||||||
Last_1_8 = Node,
|
Last_1_8 = Node,
|
||||||
LastValid = Last_1_8,
|
LastValid = Last_1_8,
|
||||||
};
|
};
|
||||||
|
static_assert((unsigned)DXIL::ShaderKind::LastValid + 1 ==
|
||||||
|
(unsigned)DXIL::ShaderKind::Invalid,
|
||||||
|
"otherwise, enum needs updating.");
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
// Python lines need to be not formatted.
|
// Python lines need to be not formatted.
|
||||||
|
|
|
@ -504,9 +504,23 @@ bool ShaderModel::AllowDerivatives(DXIL::ShaderKind sk) const {
|
||||||
case DXIL::ShaderKind::Amplification:
|
case DXIL::ShaderKind::Amplification:
|
||||||
case DXIL::ShaderKind::Mesh:
|
case DXIL::ShaderKind::Mesh:
|
||||||
return IsSM66Plus();
|
return IsSM66Plus();
|
||||||
}
|
case DXIL::ShaderKind::Vertex:
|
||||||
|
case DXIL::ShaderKind::Geometry:
|
||||||
|
case DXIL::ShaderKind::Hull:
|
||||||
|
case DXIL::ShaderKind::Domain:
|
||||||
|
case DXIL::ShaderKind::RayGeneration:
|
||||||
|
case DXIL::ShaderKind::Intersection:
|
||||||
|
case DXIL::ShaderKind::AnyHit:
|
||||||
|
case DXIL::ShaderKind::ClosestHit:
|
||||||
|
case DXIL::ShaderKind::Miss:
|
||||||
|
case DXIL::ShaderKind::Callable:
|
||||||
|
case DXIL::ShaderKind::Invalid:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
static_assert(DXIL::ShaderKind::LastValid == DXIL::ShaderKind::Node,
|
||||||
|
"otherwise, switch needs to be updated.");
|
||||||
|
llvm_unreachable("unknown ShaderKind");
|
||||||
|
}
|
||||||
|
|
||||||
typedef ShaderModel SM;
|
typedef ShaderModel SM;
|
||||||
typedef Semantic SE;
|
typedef Semantic SE;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче