Skip to content

Commit

Permalink
Add unreachable for vulkan switches (flutter#37324)
Browse files Browse the repository at this point in the history
  • Loading branch information
iskakaushik authored Nov 4, 2022
1 parent 0933ca4 commit d413cc5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions impeller/renderer/backend/vulkan/formats_vk.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ constexpr vk::Format ToVKImageFormat(PixelFormat format) {
case PixelFormat::kR8G8UNormInt:
return vk::Format::eR8G8Unorm;
}

FML_UNREACHABLE();
}

constexpr PixelFormat ToPixelFormat(vk::Format format) {
Expand Down Expand Up @@ -254,6 +256,8 @@ constexpr vk::ShaderStageFlags ToVkShaderStage(ShaderStage stage) {
case ShaderStage::kVertex:
return vk::ShaderStageFlagBits::eVertex;
}

FML_UNREACHABLE();
}

constexpr vk::DescriptorSetLayoutBinding ToVKDescriptorSetLayoutBinding(
Expand Down Expand Up @@ -284,6 +288,8 @@ constexpr vk::AttachmentLoadOp ToVKAttachmentLoadOp(LoadAction load_action) {
case LoadAction::kDontCare:
return vk::AttachmentLoadOp::eDontCare;
}

FML_UNREACHABLE();
}

constexpr vk::AttachmentStoreOp ToVKAttachmentStoreOp(
Expand All @@ -298,6 +304,8 @@ constexpr vk::AttachmentStoreOp ToVKAttachmentStoreOp(
// TODO (kaushikiska): vulkan doesn't support multisample resolve.
return vk::AttachmentStoreOp::eDontCare;
}

FML_UNREACHABLE();
}

constexpr vk::IndexType ToVKIndexType(IndexType index_type) {
Expand All @@ -309,6 +317,8 @@ constexpr vk::IndexType ToVKIndexType(IndexType index_type) {
case IndexType::kUnknown:
return vk::IndexType::eUint32;
}

FML_UNREACHABLE();
}

constexpr vk::PrimitiveTopology ToVKPrimitiveTopology(PrimitiveType primitive) {
Expand All @@ -324,6 +334,8 @@ constexpr vk::PrimitiveTopology ToVKPrimitiveTopology(PrimitiveType primitive) {
case PrimitiveType::kPoint:
return vk::PrimitiveTopology::ePointList;
}

FML_UNREACHABLE();
}

} // namespace impeller

0 comments on commit d413cc5

Please sign in to comment.