Add default cases to enum conversions where necessary

This commit is contained in:
Billy Laws 2022-09-03 22:02:42 +01:00
parent 6e55d4dcf4
commit a94040ac7d

View File

@ -491,6 +491,8 @@ namespace skyline::gpu::interconnect::maxwell3d {
return vk::PolygonMode::eLine;
case engine::PolygonMode::Point:
return vk::PolygonMode::ePoint;
default:
throw exception("Invalid polygon mode: 0x{:X}", static_cast<u32>(mode));
}
}
@ -502,10 +504,11 @@ namespace skyline::gpu::interconnect::maxwell3d {
return vk::CullModeFlagBits::eBack;
case engine::CullFace::FrontAndBack:
return vk::CullModeFlagBits::eFrontAndBack;
default:
throw exception("Invalid cull mode: 0x{:X}", static_cast<u32>(cullMode));
}
}
bool ConvertDepthBiasEnable(engine::PolyOffset polyOffset, engine::PolygonMode polygonMode) {
switch (polygonMode) {
case engine::PolygonMode::Point:
@ -514,6 +517,8 @@ namespace skyline::gpu::interconnect::maxwell3d {
return polyOffset.lineEnable;
case engine::PolygonMode::Fill:
return polyOffset.fillEnable;
default:
throw exception("Invalid polygon mode: 0x{:X}", static_cast<u32>(polygonMode));
}
}
@ -575,6 +580,8 @@ namespace skyline::gpu::interconnect::maxwell3d {
case engine::CompareFunc::D3DAlways:
case engine::CompareFunc::OglAlways:
return vk::CompareOp::eAlways;
default:
throw exception("Invalid compare func: 0x{:X}", static_cast<u32>(func));
}
}
@ -604,6 +611,8 @@ namespace skyline::gpu::interconnect::maxwell3d {
case engine::StencilOps::Op::D3DDecr:
case engine::StencilOps::Op::OglDecr:
return vk::StencilOp::eDecrementAndWrap;
default:
throw exception("Invalid stencil operation: 0x{:X}", static_cast<u32>(op));
}
}