diff --git a/src/gallium/drivers/d3d12/d3d12_context.cpp b/src/gallium/drivers/d3d12/d3d12_context.cpp index ecfaa41139c..39cdcab2cde 100644 --- a/src/gallium/drivers/d3d12/d3d12_context.cpp +++ b/src/gallium/drivers/d3d12/d3d12_context.cpp @@ -904,6 +904,8 @@ d3d12_create_sampler_view(struct pipe_context *pctx, desc.Buffer.StructureByteStride = 0; desc.Buffer.NumElements = texture->width0 / util_format_get_blocksize(state->format); break; + default: + unreachable("Invalid SRV dimension"); } d3d12_descriptor_pool_alloc_handle(ctx->view_pool, &sampler_view->handle); diff --git a/src/gallium/drivers/d3d12/d3d12_format.c b/src/gallium/drivers/d3d12/d3d12_format.c index 5bf4e6110bf..89a617a6dd7 100644 --- a/src/gallium/drivers/d3d12/d3d12_format.c +++ b/src/gallium/drivers/d3d12/d3d12_format.c @@ -285,9 +285,10 @@ d3d12_non_opaque_plane_count(DXGI_FORMAT format) case DXGI_FORMAT_Y216: case DXGI_FORMAT_NV11: return 2; - } - return 1; + default: + return 1; + } } unsigned diff --git a/src/gallium/drivers/d3d12/d3d12_resource.cpp b/src/gallium/drivers/d3d12/d3d12_resource.cpp index 2dd9787a470..1917076976b 100644 --- a/src/gallium/drivers/d3d12/d3d12_resource.cpp +++ b/src/gallium/drivers/d3d12/d3d12_resource.cpp @@ -172,6 +172,9 @@ init_texture(struct d3d12_screen *screen, desc.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE3D; desc.DepthOrArraySize = templ->depth0; break; + + default: + unreachable("Invalid texture type"); } desc.Flags = D3D12_RESOURCE_FLAG_NONE; diff --git a/src/gallium/drivers/d3d12/d3d12_screen.cpp b/src/gallium/drivers/d3d12/d3d12_screen.cpp index f273e559d87..5241e9f1ac9 100644 --- a/src/gallium/drivers/d3d12/d3d12_screen.cpp +++ b/src/gallium/drivers/d3d12/d3d12_screen.cpp @@ -475,10 +475,10 @@ d3d12_get_shader_param(struct pipe_screen *pscreen, case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTER_BUFFERS: case PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED: return 0; /* not implemented */ - } /* should only get here on unhandled cases */ - return 0; + default: return 0; + } } static bool diff --git a/src/gallium/drivers/d3d12/d3d12_surface.cpp b/src/gallium/drivers/d3d12/d3d12_surface.cpp index 8cd7623ee3e..48f4818e69f 100644 --- a/src/gallium/drivers/d3d12/d3d12_surface.cpp +++ b/src/gallium/drivers/d3d12/d3d12_surface.cpp @@ -134,6 +134,9 @@ initialize_dsv(struct pipe_context *pctx, desc.Texture2DArray.FirstArraySlice = tpl->u.tex.first_layer; desc.Texture2DArray.ArraySize = tpl->u.tex.last_layer - tpl->u.tex.first_layer + 1; break; + + default: + unreachable("Unhandled DSV dimension"); } d3d12_descriptor_pool_alloc_handle(ctx->dsv_pool, handle); @@ -208,6 +211,9 @@ initialize_rtv(struct pipe_context *pctx, desc.Texture3D.FirstWSlice = tpl->u.tex.first_layer; desc.Texture3D.WSize = tpl->u.tex.last_layer - tpl->u.tex.first_layer + 1; break; + + default: + unreachable("Unhandled RTV dimension"); } d3d12_descriptor_pool_alloc_handle(ctx->rtv_pool, handle);