From a94040ac7d4db118b005cded934dd45396aea4cd Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Sat, 3 Sep 2022 22:02:42 +0100 Subject: [PATCH] Add default cases to enum conversions where necessary --- .../gpu/interconnect/maxwell_3d/pipeline_state.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/pipeline_state.cpp b/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/pipeline_state.cpp index 678054ff..071c65e9 100644 --- a/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/pipeline_state.cpp +++ b/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/pipeline_state.cpp @@ -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(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(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(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(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(op)); } }