Use UNREACHABLE in more places

This commit is contained in:
Corentin Wallez 2017-07-10 21:48:12 -04:00 committed by Corentin Wallez
parent 96acaef95e
commit 8fca4a21b7
7 changed files with 8 additions and 13 deletions

View File

@ -477,7 +477,7 @@ namespace backend {
case nxt::BindingType::UniformBuffer: case nxt::BindingType::UniformBuffer:
case nxt::BindingType::StorageBuffer: case nxt::BindingType::StorageBuffer:
{ {
nxt::BufferUsageBit requiredUsage; nxt::BufferUsageBit requiredUsage = nxt::BufferUsageBit::None;
switch (type) { switch (type) {
case nxt::BindingType::UniformBuffer: case nxt::BindingType::UniformBuffer:
requiredUsage = nxt::BufferUsageBit::Uniform; requiredUsage = nxt::BufferUsageBit::Uniform;

View File

@ -43,8 +43,7 @@ namespace backend {
executionModel = nxt::ShaderStage::Compute; executionModel = nxt::ShaderStage::Compute;
break; break;
default: default:
ASSERT(false); UNREACHABLE();
break;
} }
// Extract push constants // Extract push constants

View File

@ -92,7 +92,7 @@ namespace d3d12 {
compileTarget = "ps_5_1"; compileTarget = "ps_5_1";
break; break;
case nxt::ShaderStage::Compute: case nxt::ShaderStage::Compute:
ASSERT(false); UNREACHABLE();
break; break;
} }

View File

@ -61,7 +61,7 @@ namespace d3d12 {
heapProperties = &kReadbackHeapProperties; heapProperties = &kReadbackHeapProperties;
break; break;
default: default:
ASSERT(false); UNREACHABLE();
} }
ComPtr<ID3D12Resource> resource; ComPtr<ID3D12Resource> resource;

View File

@ -63,8 +63,7 @@ namespace metal {
descriptor.fragmentFunction = function; descriptor.fragmentFunction = function;
break; break;
case nxt::ShaderStage::Compute: case nxt::ShaderStage::Compute:
ASSERT(false); UNREACHABLE();
break;
} }
} }

View File

@ -174,8 +174,7 @@ namespace opengl {
glVertexAttribDivisor(location, 1); glVertexAttribDivisor(location, 1);
break; break;
default: default:
ASSERT(false); UNREACHABLE();
break;
} }
} }
} }

View File

@ -32,8 +32,7 @@ namespace {
case VulkanBackend: case VulkanBackend:
return utils::BackendType::Vulkan; return utils::BackendType::Vulkan;
default: default:
NXT_ASSERT(false); UNREACHABLE();
return utils::BackendType::Null;
} }
} }
@ -48,8 +47,7 @@ namespace {
case VulkanBackend: case VulkanBackend:
return "Vulkan"; return "Vulkan";
default: default:
NXT_ASSERT(false); UNREACHABLE();
return "";
} }
} }