Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit d413cc5

Browse files
authored
Add unreachable for vulkan switches (#37324)
1 parent 0933ca4 commit d413cc5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

impeller/renderer/backend/vulkan/formats_vk.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ constexpr vk::Format ToVKImageFormat(PixelFormat format) {
155155
case PixelFormat::kR8G8UNormInt:
156156
return vk::Format::eR8G8Unorm;
157157
}
158+
159+
FML_UNREACHABLE();
158160
}
159161

160162
constexpr PixelFormat ToPixelFormat(vk::Format format) {
@@ -254,6 +256,8 @@ constexpr vk::ShaderStageFlags ToVkShaderStage(ShaderStage stage) {
254256
case ShaderStage::kVertex:
255257
return vk::ShaderStageFlagBits::eVertex;
256258
}
259+
260+
FML_UNREACHABLE();
257261
}
258262

259263
constexpr vk::DescriptorSetLayoutBinding ToVKDescriptorSetLayoutBinding(
@@ -284,6 +288,8 @@ constexpr vk::AttachmentLoadOp ToVKAttachmentLoadOp(LoadAction load_action) {
284288
case LoadAction::kDontCare:
285289
return vk::AttachmentLoadOp::eDontCare;
286290
}
291+
292+
FML_UNREACHABLE();
287293
}
288294

289295
constexpr vk::AttachmentStoreOp ToVKAttachmentStoreOp(
@@ -298,6 +304,8 @@ constexpr vk::AttachmentStoreOp ToVKAttachmentStoreOp(
298304
// TODO (kaushikiska): vulkan doesn't support multisample resolve.
299305
return vk::AttachmentStoreOp::eDontCare;
300306
}
307+
308+
FML_UNREACHABLE();
301309
}
302310

303311
constexpr vk::IndexType ToVKIndexType(IndexType index_type) {
@@ -309,6 +317,8 @@ constexpr vk::IndexType ToVKIndexType(IndexType index_type) {
309317
case IndexType::kUnknown:
310318
return vk::IndexType::eUint32;
311319
}
320+
321+
FML_UNREACHABLE();
312322
}
313323

314324
constexpr vk::PrimitiveTopology ToVKPrimitiveTopology(PrimitiveType primitive) {
@@ -324,6 +334,8 @@ constexpr vk::PrimitiveTopology ToVKPrimitiveTopology(PrimitiveType primitive) {
324334
case PrimitiveType::kPoint:
325335
return vk::PrimitiveTopology::ePointList;
326336
}
337+
338+
FML_UNREACHABLE();
327339
}
328340

329341
} // namespace impeller

0 commit comments

Comments
 (0)