Fix all GCC 10 warnings
Change-Id: Ibabab265e734a4a421a38ab586e7e11905fa5da1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64740
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
diff --git a/generator/templates/dawn_native/wgpu_structs.cpp b/generator/templates/dawn_native/wgpu_structs.cpp
index 83f24ee..642cb13 100644
--- a/generator/templates/dawn_native/wgpu_structs.cpp
+++ b/generator/templates/dawn_native/wgpu_structs.cpp
@@ -14,6 +14,11 @@
#include "dawn_native/wgpu_structs_autogen.h"
+#ifdef __GNUC__
+// error: 'offsetof' within non-standard-layout type 'wgpu::XXX' is conditionally-supported
+#pragma GCC diagnostic ignored "-Winvalid-offsetof"
+#endif
+
namespace dawn_native {
static_assert(sizeof(ChainedStruct) == sizeof(WGPUChainedStruct),
diff --git a/generator/templates/dawn_wire/WireCmd.cpp b/generator/templates/dawn_wire/WireCmd.cpp
index c9dc5e2..4b9bd9b 100644
--- a/generator/templates/dawn_wire/WireCmd.cpp
+++ b/generator/templates/dawn_wire/WireCmd.cpp
@@ -23,6 +23,11 @@
#include <cstring>
#include <limits>
+#ifdef __GNUC__
+// error: 'offsetof' within non-standard-layout type 'wgpu::XXX' is conditionally-supported
+#pragma GCC diagnostic ignored "-Winvalid-offsetof"
+#endif
+
//* Helper macros so that the main [de]serialization functions can be written in a generic manner.
//* Outputs an rvalue that's the number of elements a pointer member points to.
diff --git a/generator/templates/webgpu_cpp.cpp b/generator/templates/webgpu_cpp.cpp
index 7f5dd59..43a534c 100644
--- a/generator/templates/webgpu_cpp.cpp
+++ b/generator/templates/webgpu_cpp.cpp
@@ -17,6 +17,11 @@
#include "webgpu/webgpu_cpp.h"
{% endif %}
+#ifdef __GNUC__
+// error: 'offsetof' within non-standard-layout type 'wgpu::XXX' is conditionally-supported
+#pragma GCC diagnostic ignored "-Winvalid-offsetof"
+#endif
+
namespace wgpu {
{% for type in by_category["enum"] %}
{% set CppType = as_cppType(type.name) %}
diff --git a/src/dawn_native/BindGroupLayout.cpp b/src/dawn_native/BindGroupLayout.cpp
index 84f4050..34c8482 100644
--- a/src/dawn_native/BindGroupLayout.cpp
+++ b/src/dawn_native/BindGroupLayout.cpp
@@ -56,8 +56,9 @@
return {};
case wgpu::TextureViewDimension::Undefined:
- UNREACHABLE();
+ break;
}
+ UNREACHABLE();
}
} // anonymous namespace
@@ -179,7 +180,6 @@
namespace {
-
bool operator!=(const BindingInfo& a, const BindingInfo& b) {
if (a.visibility != b.visibility || a.bindingType != b.bindingType) {
return true;
@@ -203,6 +203,7 @@
case BindingInfoType::ExternalTexture:
return false;
}
+ UNREACHABLE();
}
bool IsBufferBinding(const BindGroupLayoutEntry& binding) {
diff --git a/src/dawn_native/Buffer.cpp b/src/dawn_native/Buffer.cpp
index bd70648..8b90173 100644
--- a/src/dawn_native/Buffer.cpp
+++ b/src/dawn_native/Buffer.cpp
@@ -267,6 +267,7 @@
case BufferState::Unmapped:
return {};
}
+ UNREACHABLE();
}
void BufferBase::CallMapCallback(MapRequestID mapID, WGPUBufferMapAsyncStatus status) {
@@ -549,6 +550,7 @@
case BufferState::Destroyed:
return false;
}
+ UNREACHABLE();
}
MaybeError BufferBase::ValidateUnmap() const {
@@ -566,6 +568,7 @@
case BufferState::Destroyed:
return DAWN_VALIDATION_ERROR("Buffer is destroyed");
}
+ UNREACHABLE();
}
MaybeError BufferBase::ValidateDestroy() const {
diff --git a/src/dawn_native/CommandValidation.cpp b/src/dawn_native/CommandValidation.cpp
index 93f4278..70cd082 100644
--- a/src/dawn_native/CommandValidation.cpp
+++ b/src/dawn_native/CommandValidation.cpp
@@ -359,8 +359,9 @@
return Aspect::Stencil;
case wgpu::TextureAspect::Plane0Only:
case wgpu::TextureAspect::Plane1Only:
- UNREACHABLE();
+ break;
}
+ UNREACHABLE();
}
MaybeError ValidateLinearToDepthStencilCopyRestrictions(const ImageCopyTexture& dst) {
diff --git a/src/dawn_native/DawnNative.cpp b/src/dawn_native/DawnNative.cpp
index 172ece93..06c21c3 100644
--- a/src/dawn_native/DawnNative.cpp
+++ b/src/dawn_native/DawnNative.cpp
@@ -77,8 +77,9 @@
case wgpu::BackendType::D3D11:
case wgpu::BackendType::WebGPU:
- UNREACHABLE();
+ break;
}
+ UNREACHABLE();
}
DeviceType Adapter::GetDeviceType() const {
@@ -92,6 +93,7 @@
case wgpu::AdapterType::Unknown:
return DeviceType::Unknown;
}
+ UNREACHABLE();
}
const PCIInfo& Adapter::GetPCIInfo() const {
diff --git a/src/dawn_native/ErrorScope.cpp b/src/dawn_native/ErrorScope.cpp
index 01c88ed..d021de1 100644
--- a/src/dawn_native/ErrorScope.cpp
+++ b/src/dawn_native/ErrorScope.cpp
@@ -29,6 +29,7 @@
case wgpu::ErrorFilter::OutOfMemory:
return wgpu::ErrorType::OutOfMemory;
}
+ UNREACHABLE();
}
} // namespace
diff --git a/src/dawn_native/Format.cpp b/src/dawn_native/Format.cpp
index 68bd87f..f61c630 100644
--- a/src/dawn_native/Format.cpp
+++ b/src/dawn_native/Format.cpp
@@ -37,6 +37,7 @@
case wgpu::TextureComponentType::DepthComparison:
return SampleTypeBit::Depth;
}
+ UNREACHABLE();
}
SampleTypeBit SampleTypeToSampleTypeBit(wgpu::TextureSampleType sampleType) {
diff --git a/src/dawn_native/RenderPipeline.cpp b/src/dawn_native/RenderPipeline.cpp
index 7bdfd0a..79b8002 100644
--- a/src/dawn_native/RenderPipeline.cpp
+++ b/src/dawn_native/RenderPipeline.cpp
@@ -372,8 +372,9 @@
case wgpu::IndexFormat::Uint32:
return sizeof(uint32_t);
case wgpu::IndexFormat::Undefined:
- UNREACHABLE();
+ break;
}
+ UNREACHABLE();
}
bool IsStripPrimitiveTopology(wgpu::PrimitiveTopology primitiveTopology) {
diff --git a/src/dawn_native/ShaderModule.cpp b/src/dawn_native/ShaderModule.cpp
index d4f1152..56f61e0 100644
--- a/src/dawn_native/ShaderModule.cpp
+++ b/src/dawn_native/ShaderModule.cpp
@@ -117,6 +117,7 @@
case wgpu::VertexStepMode::Instance:
return tint::transform::VertexStepMode::kInstance;
}
+ UNREACHABLE();
}
ResultOrError<SingleShaderStage> TintPipelineStageToShaderStage(
@@ -129,8 +130,9 @@
case tint::ast::PipelineStage::kCompute:
return SingleShaderStage::Compute;
case tint::ast::PipelineStage::kNone:
- UNREACHABLE();
+ break;
}
+ UNREACHABLE();
}
BindingInfoType TintResourceTypeToBindingInfoType(
@@ -236,6 +238,7 @@
case tint::inspector::ResourceBinding::ImageFormat::kNone:
return wgpu::TextureFormat::Undefined;
}
+ UNREACHABLE();
}
wgpu::TextureViewDimension TintTextureDimensionToTextureViewDimension(
@@ -256,6 +259,7 @@
case tint::inspector::ResourceBinding::TextureDimension::kNone:
return wgpu::TextureViewDimension::Undefined;
}
+ UNREACHABLE();
}
SampleTypeBit TintSampledKindToSampleTypeBit(
@@ -270,6 +274,7 @@
case tint::inspector::ResourceBinding::SampledKind::kUnknown:
return SampleTypeBit::None;
}
+ UNREACHABLE();
}
ResultOrError<wgpu::TextureComponentType> TintComponentTypeToTextureComponentType(
@@ -285,6 +290,7 @@
return DAWN_VALIDATION_ERROR(
"Attempted to convert 'Unknown' component type from Tint");
}
+ UNREACHABLE();
}
ResultOrError<VertexFormatBaseType> TintComponentTypeToVertexFormatBaseType(
@@ -300,6 +306,7 @@
return DAWN_VALIDATION_ERROR(
"Attempted to convert 'Unknown' component type from Tint");
}
+ UNREACHABLE();
}
ResultOrError<wgpu::BufferBindingType> TintResourceTypeToBufferBindingType(
@@ -314,6 +321,7 @@
default:
return DAWN_VALIDATION_ERROR("Attempted to convert non-buffer resource type");
}
+ UNREACHABLE();
}
ResultOrError<wgpu::StorageTextureAccess> TintResourceTypeToStorageTextureAccess(
@@ -325,6 +333,7 @@
return DAWN_VALIDATION_ERROR(
"Attempted to convert non-storage texture resource type");
}
+ UNREACHABLE();
}
ResultOrError<InterStageComponentType> TintComponentTypeToInterStageComponentType(
@@ -340,6 +349,7 @@
return DAWN_VALIDATION_ERROR(
"Attempted to convert 'Unknown' component type from Tint");
}
+ UNREACHABLE();
}
ResultOrError<uint32_t> TintCompositionTypeToInterStageComponentCount(
@@ -357,6 +367,7 @@
return DAWN_VALIDATION_ERROR(
"Attempt to convert 'Unknown' composition type from Tint");
}
+ UNREACHABLE();
}
ResultOrError<InterpolationType> TintInterpolationTypeToInterpolationType(
@@ -372,6 +383,7 @@
return DAWN_VALIDATION_ERROR(
"Attempted to convert 'Unknown' interpolation type from Tint");
}
+ UNREACHABLE();
}
ResultOrError<InterpolationSampling> TintInterpolationSamplingToInterpolationSamplingType(
@@ -389,6 +401,7 @@
return DAWN_VALIDATION_ERROR(
"Attempted to convert 'Unknown' interpolation sampling type from Tint");
}
+ UNREACHABLE();
}
ResultOrError<tint::Program> ParseWGSL(const tint::Source::File* file,
diff --git a/src/dawn_native/Subresource.cpp b/src/dawn_native/Subresource.cpp
index 99b42cb..ff0bd53 100644
--- a/src/dawn_native/Subresource.cpp
+++ b/src/dawn_native/Subresource.cpp
@@ -59,6 +59,7 @@
case wgpu::TextureAspect::Plane1Only:
return format.aspects & Aspect::Plane1;
}
+ UNREACHABLE();
}
uint8_t GetAspectIndex(Aspect aspect) {
diff --git a/src/dawn_native/Texture.cpp b/src/dawn_native/Texture.cpp
index 0194772..e5c18c7 100644
--- a/src/dawn_native/Texture.cpp
+++ b/src/dawn_native/Texture.cpp
@@ -62,8 +62,9 @@
case wgpu::TextureViewDimension::e1D:
case wgpu::TextureViewDimension::Undefined:
- UNREACHABLE();
+ break;
}
+ UNREACHABLE();
}
// TODO(crbug.com/dawn/814): Implement for 1D texture.
@@ -83,8 +84,9 @@
case wgpu::TextureViewDimension::e1D:
case wgpu::TextureViewDimension::Undefined:
- UNREACHABLE();
+ break;
}
+ UNREACHABLE();
}
bool IsTextureSizeValidForTextureViewDimension(
@@ -101,8 +103,9 @@
case wgpu::TextureViewDimension::e1D:
case wgpu::TextureViewDimension::Undefined:
- UNREACHABLE();
+ break;
}
+ UNREACHABLE();
}
MaybeError ValidateSampleCount(const TextureDescriptor* descriptor,
diff --git a/src/dawn_native/opengl/CommandBufferGL.cpp b/src/dawn_native/opengl/CommandBufferGL.cpp
index f4bb61f..788eb9e 100644
--- a/src/dawn_native/opengl/CommandBufferGL.cpp
+++ b/src/dawn_native/opengl/CommandBufferGL.cpp
@@ -45,8 +45,9 @@
case wgpu::IndexFormat::Uint32:
return GL_UNSIGNED_INT;
case wgpu::IndexFormat::Undefined:
- UNREACHABLE();
+ break;
}
+ UNREACHABLE();
}
GLenum VertexFormatType(wgpu::VertexFormat format) {
diff --git a/src/dawn_native/opengl/PipelineGL.cpp b/src/dawn_native/opengl/PipelineGL.cpp
index 4541e65..8ec9d61 100644
--- a/src/dawn_native/opengl/PipelineGL.cpp
+++ b/src/dawn_native/opengl/PipelineGL.cpp
@@ -40,6 +40,7 @@
case SingleShaderStage::Compute:
return GL_COMPUTE_SHADER;
}
+ UNREACHABLE();
}
} // namespace
diff --git a/src/dawn_native/opengl/RenderPipelineGL.cpp b/src/dawn_native/opengl/RenderPipelineGL.cpp
index 45d9986..d5d8409 100644
--- a/src/dawn_native/opengl/RenderPipelineGL.cpp
+++ b/src/dawn_native/opengl/RenderPipelineGL.cpp
@@ -36,6 +36,7 @@
case wgpu::PrimitiveTopology::TriangleStrip:
return GL_TRIANGLE_STRIP;
}
+ UNREACHABLE();
}
void ApplyFrontFaceAndCulling(const OpenGLFunctions& gl,
@@ -85,6 +86,7 @@
case wgpu::BlendFactor::OneMinusConstant:
return alpha ? GL_ONE_MINUS_CONSTANT_ALPHA : GL_ONE_MINUS_CONSTANT_COLOR;
}
+ UNREACHABLE();
}
GLenum GLBlendMode(wgpu::BlendOperation operation) {
@@ -100,6 +102,7 @@
case wgpu::BlendOperation::Max:
return GL_MAX;
}
+ UNREACHABLE();
}
void ApplyColorState(const OpenGLFunctions& gl,
@@ -166,6 +169,7 @@
case wgpu::StencilOperation::DecrementWrap:
return GL_DECR_WRAP;
}
+ UNREACHABLE();
}
void ApplyDepthStencilState(const OpenGLFunctions& gl,
diff --git a/src/dawn_native/opengl/SamplerGL.cpp b/src/dawn_native/opengl/SamplerGL.cpp
index 32aa56f..81fdd46 100644
--- a/src/dawn_native/opengl/SamplerGL.cpp
+++ b/src/dawn_native/opengl/SamplerGL.cpp
@@ -28,6 +28,7 @@
case wgpu::FilterMode::Linear:
return GL_LINEAR;
}
+ UNREACHABLE();
}
GLenum MinFilterMode(wgpu::FilterMode minFilter, wgpu::FilterMode mipMapFilter) {
@@ -47,6 +48,7 @@
return GL_LINEAR_MIPMAP_LINEAR;
}
}
+ UNREACHABLE();
}
GLenum WrapMode(wgpu::AddressMode mode) {
@@ -58,6 +60,7 @@
case wgpu::AddressMode::ClampToEdge:
return GL_CLAMP_TO_EDGE;
}
+ UNREACHABLE();
}
} // namespace
diff --git a/src/dawn_native/opengl/SpirvUtils.cpp b/src/dawn_native/opengl/SpirvUtils.cpp
index a274300..6ce41ca 100644
--- a/src/dawn_native/opengl/SpirvUtils.cpp
+++ b/src/dawn_native/opengl/SpirvUtils.cpp
@@ -25,6 +25,7 @@
case SingleShaderStage::Compute:
return spv::ExecutionModelGLCompute;
}
+ UNREACHABLE();
}
SingleShaderStage ExecutionModelToShaderStage(spv::ExecutionModel model) {
diff --git a/src/dawn_native/opengl/TextureGL.cpp b/src/dawn_native/opengl/TextureGL.cpp
index 1f40f96..f8f76bf 100644
--- a/src/dawn_native/opengl/TextureGL.cpp
+++ b/src/dawn_native/opengl/TextureGL.cpp
@@ -44,8 +44,9 @@
return GL_TEXTURE_3D;
case wgpu::TextureDimension::e1D:
- UNREACHABLE();
+ break;
}
+ UNREACHABLE();
}
GLenum TargetForTextureViewDimension(wgpu::TextureViewDimension dimension,
@@ -69,8 +70,9 @@
case wgpu::TextureViewDimension::e1D:
case wgpu::TextureViewDimension::Undefined:
- UNREACHABLE();
+ break;
}
+ UNREACHABLE();
}
GLuint GenTexture(const OpenGLFunctions& gl) {
diff --git a/src/dawn_native/opengl/UtilsGL.cpp b/src/dawn_native/opengl/UtilsGL.cpp
index 804df66..413336b 100644
--- a/src/dawn_native/opengl/UtilsGL.cpp
+++ b/src/dawn_native/opengl/UtilsGL.cpp
@@ -38,8 +38,9 @@
return GL_ALWAYS;
case wgpu::CompareFunction::Undefined:
- UNREACHABLE();
+ break;
}
+ UNREACHABLE();
}
GLint GetStencilMaskFromStencilFormat(wgpu::TextureFormat depthStencilFormat) {
diff --git a/src/dawn_native/vulkan/BindGroupLayoutVk.cpp b/src/dawn_native/vulkan/BindGroupLayoutVk.cpp
index 53e636c..b464758 100644
--- a/src/dawn_native/vulkan/BindGroupLayoutVk.cpp
+++ b/src/dawn_native/vulkan/BindGroupLayoutVk.cpp
@@ -73,6 +73,7 @@
case BindingInfoType::StorageTexture:
return VK_DESCRIPTOR_TYPE_STORAGE_IMAGE;
}
+ UNREACHABLE();
}
// static
diff --git a/src/dawn_native/vulkan/CommandBufferVk.cpp b/src/dawn_native/vulkan/CommandBufferVk.cpp
index 36f6a39..a987a84 100644
--- a/src/dawn_native/vulkan/CommandBufferVk.cpp
+++ b/src/dawn_native/vulkan/CommandBufferVk.cpp
@@ -49,8 +49,9 @@
case wgpu::IndexFormat::Uint32:
return VK_INDEX_TYPE_UINT32;
case wgpu::IndexFormat::Undefined:
- UNREACHABLE();
+ break;
}
+ UNREACHABLE();
}
bool HasSameTextureCopyExtent(const TextureCopy& srcCopy,
diff --git a/src/dawn_native/vulkan/QuerySetVk.cpp b/src/dawn_native/vulkan/QuerySetVk.cpp
index fe24980..ba60c3d 100644
--- a/src/dawn_native/vulkan/QuerySetVk.cpp
+++ b/src/dawn_native/vulkan/QuerySetVk.cpp
@@ -31,6 +31,7 @@
case wgpu::QueryType::Timestamp:
return VK_QUERY_TYPE_TIMESTAMP;
}
+ UNREACHABLE();
}
VkQueryPipelineStatisticFlags VulkanQueryPipelineStatisticFlags(
diff --git a/src/dawn_native/vulkan/RenderPassCache.cpp b/src/dawn_native/vulkan/RenderPassCache.cpp
index 1bafac2..ed2bc42 100644
--- a/src/dawn_native/vulkan/RenderPassCache.cpp
+++ b/src/dawn_native/vulkan/RenderPassCache.cpp
@@ -30,6 +30,7 @@
case wgpu::LoadOp::Clear:
return VK_ATTACHMENT_LOAD_OP_CLEAR;
}
+ UNREACHABLE();
}
} // anonymous namespace
diff --git a/src/dawn_native/vulkan/RenderPipelineVk.cpp b/src/dawn_native/vulkan/RenderPipelineVk.cpp
index 2ece1f2..7276cc4 100644
--- a/src/dawn_native/vulkan/RenderPipelineVk.cpp
+++ b/src/dawn_native/vulkan/RenderPipelineVk.cpp
@@ -34,6 +34,7 @@
case wgpu::VertexStepMode::Instance:
return VK_VERTEX_INPUT_RATE_INSTANCE;
}
+ UNREACHABLE();
}
VkFormat VulkanVertexFormat(wgpu::VertexFormat format) {
@@ -116,6 +117,7 @@
case wgpu::PrimitiveTopology::TriangleStrip:
return VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP;
}
+ UNREACHABLE();
}
bool ShouldEnablePrimitiveRestart(wgpu::PrimitiveTopology topology) {
@@ -130,6 +132,7 @@
case wgpu::PrimitiveTopology::TriangleStrip:
return true;
}
+ UNREACHABLE();
}
VkFrontFace VulkanFrontFace(wgpu::FrontFace face) {
@@ -139,6 +142,7 @@
case wgpu::FrontFace::CW:
return VK_FRONT_FACE_CLOCKWISE;
}
+ UNREACHABLE();
}
VkCullModeFlagBits VulkanCullMode(wgpu::CullMode mode) {
@@ -150,6 +154,7 @@
case wgpu::CullMode::Back:
return VK_CULL_MODE_BACK_BIT;
}
+ UNREACHABLE();
}
VkBlendFactor VulkanBlendFactor(wgpu::BlendFactor factor) {
@@ -181,6 +186,7 @@
case wgpu::BlendFactor::OneMinusConstant:
return VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR;
}
+ UNREACHABLE();
}
VkBlendOp VulkanBlendOperation(wgpu::BlendOperation operation) {
@@ -196,6 +202,7 @@
case wgpu::BlendOperation::Max:
return VK_BLEND_OP_MAX;
}
+ UNREACHABLE();
}
VkColorComponentFlags VulkanColorWriteMask(wgpu::ColorWriteMask mask,
@@ -267,6 +274,7 @@
case wgpu::StencilOperation::DecrementWrap:
return VK_STENCIL_OP_DECREMENT_AND_WRAP;
}
+ UNREACHABLE();
}
VkPipelineDepthStencilStateCreateInfo ComputeDepthStencilDesc(
diff --git a/src/dawn_native/vulkan/SamplerVk.cpp b/src/dawn_native/vulkan/SamplerVk.cpp
index c5e852b..c056515 100644
--- a/src/dawn_native/vulkan/SamplerVk.cpp
+++ b/src/dawn_native/vulkan/SamplerVk.cpp
@@ -31,6 +31,7 @@
case wgpu::AddressMode::ClampToEdge:
return VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
}
+ UNREACHABLE();
}
VkFilter VulkanSamplerFilter(wgpu::FilterMode filter) {
@@ -40,6 +41,7 @@
case wgpu::FilterMode::Nearest:
return VK_FILTER_NEAREST;
}
+ UNREACHABLE();
}
VkSamplerMipmapMode VulkanMipMapMode(wgpu::FilterMode filter) {
@@ -49,6 +51,7 @@
case wgpu::FilterMode::Nearest:
return VK_SAMPLER_MIPMAP_MODE_NEAREST;
}
+ UNREACHABLE();
}
} // anonymous namespace
diff --git a/src/dawn_native/vulkan/SwapChainVk.cpp b/src/dawn_native/vulkan/SwapChainVk.cpp
index 933f7b4..c0f856f 100644
--- a/src/dawn_native/vulkan/SwapChainVk.cpp
+++ b/src/dawn_native/vulkan/SwapChainVk.cpp
@@ -194,6 +194,7 @@
case wgpu::PresentMode::Mailbox:
return VK_PRESENT_MODE_MAILBOX_KHR;
}
+ UNREACHABLE();
}
uint32_t MinImageCountForPresentMode(VkPresentModeKHR mode) {
@@ -204,8 +205,9 @@
case VK_PRESENT_MODE_MAILBOX_KHR:
return 3;
default:
- UNREACHABLE();
+ break;
}
+ UNREACHABLE();
}
} // anonymous namespace
diff --git a/src/dawn_native/vulkan/TextureVk.cpp b/src/dawn_native/vulkan/TextureVk.cpp
index 0cef6f0..70fbeee 100644
--- a/src/dawn_native/vulkan/TextureVk.cpp
+++ b/src/dawn_native/vulkan/TextureVk.cpp
@@ -51,8 +51,9 @@
case wgpu::TextureViewDimension::e1D:
case wgpu::TextureViewDimension::Undefined:
- UNREACHABLE();
+ break;
}
+ UNREACHABLE();
}
// Computes which vulkan access type could be required for the given Dawn usage.
@@ -419,8 +420,9 @@
// TODO(dawn:570): implement depth16unorm
case wgpu::TextureFormat::Depth16Unorm:
case wgpu::TextureFormat::Undefined:
- UNREACHABLE();
+ break;
}
+ UNREACHABLE();
}
// Converts the Dawn usage flags to Vulkan usage flags. Also needs the format to choose
@@ -508,8 +510,9 @@
return VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
case wgpu::TextureUsage::None:
- UNREACHABLE();
+ break;
}
+ UNREACHABLE();
}
VkSampleCountFlagBits VulkanSampleCount(uint32_t sampleCount) {
@@ -518,9 +521,8 @@
return VK_SAMPLE_COUNT_1_BIT;
case 4:
return VK_SAMPLE_COUNT_4_BIT;
- default:
- UNREACHABLE();
}
+ UNREACHABLE();
}
MaybeError ValidateVulkanImageCanBeWrapped(const DeviceBase*,
@@ -853,8 +855,9 @@
return VulkanAspectMask(Aspect::Stencil);
case wgpu::TextureAspect::Plane0Only:
case wgpu::TextureAspect::Plane1Only:
- UNREACHABLE();
+ break;
}
+ UNREACHABLE();
}
void Texture::TweakTransitionForExternalUsage(CommandRecordingContext* recordingContext,
diff --git a/src/dawn_native/vulkan/UtilsVulkan.cpp b/src/dawn_native/vulkan/UtilsVulkan.cpp
index fd7a4ae..b04c0a4 100644
--- a/src/dawn_native/vulkan/UtilsVulkan.cpp
+++ b/src/dawn_native/vulkan/UtilsVulkan.cpp
@@ -44,8 +44,9 @@
return VK_COMPARE_OP_ALWAYS;
case wgpu::CompareFunction::Undefined:
- UNREACHABLE();
+ break;
}
+ UNREACHABLE();
}
// Convert Dawn texture aspects to Vulkan texture aspect flags
diff --git a/src/utils/TestUtils.cpp b/src/utils/TestUtils.cpp
index 8f359ab..d55a8c2 100644
--- a/src/utils/TestUtils.cpp
+++ b/src/utils/TestUtils.cpp
@@ -173,8 +173,9 @@
case wgpu::VertexFormat::Sint32x4:
return 16;
case wgpu::VertexFormat::Undefined:
- UNREACHABLE();
+ break;
}
+ UNREACHABLE();
}
} // namespace utils
diff --git a/src/utils/TextureUtils.cpp b/src/utils/TextureUtils.cpp
index 2747fa2..aaa808e 100644
--- a/src/utils/TextureUtils.cpp
+++ b/src/utils/TextureUtils.cpp
@@ -241,8 +241,9 @@
// TODO(dawn:570): implement depth16unorm
case wgpu::TextureFormat::Depth16Unorm:
case wgpu::TextureFormat::Undefined:
- UNREACHABLE();
+ break;
}
+ UNREACHABLE();
}
uint32_t GetTextureFormatBlockWidth(wgpu::TextureFormat textureFormat) {
@@ -357,8 +358,9 @@
// TODO(dawn:570): implement depth16unorm
case wgpu::TextureFormat::Depth16Unorm:
case wgpu::TextureFormat::Undefined:
- UNREACHABLE();
+ break;
}
+ UNREACHABLE();
}
uint32_t GetTextureFormatBlockHeight(wgpu::TextureFormat textureFormat) {
@@ -473,8 +475,9 @@
// TODO(dawn:570): implement depth16unorm
case wgpu::TextureFormat::Depth16Unorm:
case wgpu::TextureFormat::Undefined:
- UNREACHABLE();
+ break;
}
+ UNREACHABLE();
}
const char* GetWGSLColorTextureComponentType(wgpu::TextureFormat textureFormat) {