From af6983885bd015ff6961a441e1c87153058bc49a Mon Sep 17 00:00:00 2001 From: Jesse Natalie Date: Wed, 25 Nov 2020 16:49:43 -0800 Subject: [PATCH] d3d12: Delete unused local variables Reviewed-by: Erik Faye-Lund Part-of: --- src/gallium/drivers/d3d12/d3d12_batch.cpp | 2 -- src/gallium/drivers/d3d12/d3d12_context.cpp | 4 ---- src/gallium/drivers/d3d12/d3d12_descriptor_pool.cpp | 2 -- src/gallium/drivers/d3d12/d3d12_gs_variant.cpp | 5 ----- src/gallium/drivers/d3d12/d3d12_nir_passes.c | 1 - src/gallium/drivers/d3d12/d3d12_pipeline_state.cpp | 1 - src/gallium/drivers/d3d12/d3d12_query.cpp | 1 - src/gallium/drivers/d3d12/d3d12_resource.cpp | 3 +-- src/gallium/drivers/d3d12/d3d12_surface.cpp | 5 ----- 9 files changed, 1 insertion(+), 23 deletions(-) diff --git a/src/gallium/drivers/d3d12/d3d12_batch.cpp b/src/gallium/drivers/d3d12/d3d12_batch.cpp index b7757b92f94..943ca1873f5 100644 --- a/src/gallium/drivers/d3d12/d3d12_batch.cpp +++ b/src/gallium/drivers/d3d12/d3d12_batch.cpp @@ -108,8 +108,6 @@ delete_object(set_entry *entry) bool d3d12_reset_batch(struct d3d12_context *ctx, struct d3d12_batch *batch, uint64_t timeout_ns) { - struct d3d12_screen *screen = d3d12_screen(ctx->base.screen); - // batch hasn't been submitted before if (!batch->fence && !batch->has_errors) return true; diff --git a/src/gallium/drivers/d3d12/d3d12_context.cpp b/src/gallium/drivers/d3d12/d3d12_context.cpp index aa7c8edb639..33f5329612c 100644 --- a/src/gallium/drivers/d3d12/d3d12_context.cpp +++ b/src/gallium/drivers/d3d12/d3d12_context.cpp @@ -966,7 +966,6 @@ static void d3d12_destroy_sampler_view(struct pipe_context *pctx, struct pipe_sampler_view *pview) { - struct d3d12_context *ctx = d3d12_context(pctx); struct d3d12_sampler_view *view = d3d12_sampler_view(pview); d3d12_descriptor_handle_free(&view->handle); pipe_resource_reference(&view->base.texture, NULL); @@ -1296,8 +1295,6 @@ d3d12_create_stream_output_target(struct pipe_context *pctx, unsigned buffer_offset, unsigned buffer_size) { - struct d3d12_context *ctx = d3d12_context(pctx); - struct d3d12_screen *screen = d3d12_screen(pctx->screen); struct d3d12_resource *res = d3d12_resource(pres); struct d3d12_stream_output_target *cso = CALLOC_STRUCT(d3d12_stream_output_target); @@ -1814,7 +1811,6 @@ static uint64_t d3d12_get_timestamp(struct pipe_context *pctx) { struct d3d12_context *ctx = d3d12_context(pctx); - struct d3d12_screen *screen = d3d12_screen(pctx->screen); if (!ctx->timestamp_query) ctx->timestamp_query = pctx->create_query(pctx, PIPE_QUERY_TIMESTAMP, 0); diff --git a/src/gallium/drivers/d3d12/d3d12_descriptor_pool.cpp b/src/gallium/drivers/d3d12/d3d12_descriptor_pool.cpp index c7a2bc181fa..b83fe1b2976 100644 --- a/src/gallium/drivers/d3d12/d3d12_descriptor_pool.cpp +++ b/src/gallium/drivers/d3d12/d3d12_descriptor_pool.cpp @@ -197,8 +197,6 @@ d3d12_descriptor_pool_new(pipe_context *pctx, D3D12_DESCRIPTOR_HEAP_TYPE type, uint32_t num_descriptors) { - struct d3d12_context *ctx = d3d12_context(pctx); - struct d3d12_descriptor_pool *pool = CALLOC_STRUCT(d3d12_descriptor_pool); if (!pool) return NULL; diff --git a/src/gallium/drivers/d3d12/d3d12_gs_variant.cpp b/src/gallium/drivers/d3d12/d3d12_gs_variant.cpp index eb139d95be5..15820f01999 100644 --- a/src/gallium/drivers/d3d12/d3d12_gs_variant.cpp +++ b/src/gallium/drivers/d3d12/d3d12_gs_variant.cpp @@ -59,7 +59,6 @@ d3d12_make_passthrough_gs(struct d3d12_context *ctx, struct d3d12_gs_variant_key struct d3d12_shader_selector *gs; uint64_t varyings = key->varyings.mask; nir_shader *nir; - nir_intrinsic_instr *instr; struct pipe_shader_state templ; nir_builder b = nir_builder_init_simple_shader(MESA_SHADER_GEOMETRY, @@ -145,7 +144,6 @@ d3d12_begin_emit_primitives_gs(struct emit_primitives_context *emit_ctx, unsigned vertices_out) { nir_builder *b = &emit_ctx->b; - nir_intrinsic_instr *instr; nir_variable *edgeflag_var = NULL; nir_variable *pos_var = NULL; uint64_t varyings = key->varyings.mask; @@ -281,7 +279,6 @@ d3d12_begin_emit_primitives_gs(struct emit_primitives_context *emit_ctx, static struct d3d12_shader_selector * d3d12_finish_emit_primitives_gs(struct emit_primitives_context *emit_ctx, bool end_primitive) { - struct d3d12_shader_selector *gs; struct pipe_shader_state templ; nir_builder *b = &emit_ctx->b; nir_shader *nir = b->shader; @@ -312,7 +309,6 @@ d3d12_emit_points(struct d3d12_context *ctx, struct d3d12_gs_variant_key *key) { struct emit_primitives_context emit_ctx = {0}; nir_builder *b = &emit_ctx.b; - nir_intrinsic_instr *instr; d3d12_begin_emit_primitives_gs(&emit_ctx, ctx, key, GL_POINTS, 3); @@ -393,7 +389,6 @@ d3d12_emit_triangles(struct d3d12_context *ctx, struct d3d12_gs_variant_key *key { struct emit_primitives_context emit_ctx = {0}; nir_builder *b = &emit_ctx.b; - nir_intrinsic_instr *instr; d3d12_begin_emit_primitives_gs(&emit_ctx, ctx, key, GL_TRIANGLE_STRIP, 3); diff --git a/src/gallium/drivers/d3d12/d3d12_nir_passes.c b/src/gallium/drivers/d3d12/d3d12_nir_passes.c index 96b126fec53..94c784c7c08 100644 --- a/src/gallium/drivers/d3d12/d3d12_nir_passes.c +++ b/src/gallium/drivers/d3d12/d3d12_nir_passes.c @@ -992,7 +992,6 @@ d3d12_fixup_clipdist_writes(nir_shader *shader) { nir_builder b; nir_function_impl *impl = nir_shader_get_entrypoint(shader); - nir_ssa_def *primitive_id; nir_builder_init(&b, impl); nir_foreach_block(block, impl) { diff --git a/src/gallium/drivers/d3d12/d3d12_pipeline_state.cpp b/src/gallium/drivers/d3d12/d3d12_pipeline_state.cpp index 0498c0bf75b..f8b27334b3e 100644 --- a/src/gallium/drivers/d3d12/d3d12_pipeline_state.cpp +++ b/src/gallium/drivers/d3d12/d3d12_pipeline_state.cpp @@ -88,7 +88,6 @@ fill_so_declaration(const struct pipe_stream_output_info *info, for (unsigned i = 0; i < info->num_outputs; i++) { const struct pipe_stream_output *output = &info->output[i]; const int buffer = output->output_buffer; - const int varying = output->register_index; unsigned index; /* Mesa doesn't store entries for gl_SkipComponents in the Outputs[] diff --git a/src/gallium/drivers/d3d12/d3d12_query.cpp b/src/gallium/drivers/d3d12/d3d12_query.cpp index c6da498ada7..ecdc9703f3b 100644 --- a/src/gallium/drivers/d3d12/d3d12_query.cpp +++ b/src/gallium/drivers/d3d12/d3d12_query.cpp @@ -106,7 +106,6 @@ d3d12_create_query(struct pipe_context *pctx, struct d3d12_screen *screen = d3d12_screen(pctx->screen); struct d3d12_query *query = CALLOC_STRUCT(d3d12_query); D3D12_QUERY_HEAP_DESC desc = {}; - D3D12_RESOURCE_DESC res_desc = {}; if (!query) return NULL; diff --git a/src/gallium/drivers/d3d12/d3d12_resource.cpp b/src/gallium/drivers/d3d12/d3d12_resource.cpp index 330481311bd..c9b0ec5770f 100644 --- a/src/gallium/drivers/d3d12/d3d12_resource.cpp +++ b/src/gallium/drivers/d3d12/d3d12_resource.cpp @@ -251,7 +251,7 @@ d3d12_resource_create(struct pipe_screen *pscreen, templ->usage == PIPE_USAGE_STAGING ? "STAGING " :"", util_format_name(templ->format), templ->nr_samples, templ->width0, templ->height0, templ->depth0, - templ->array_size, templ->last_level, templ); + templ->array_size, templ->last_level); } pipe_reference_init(&res->base.reference, 1); @@ -302,7 +302,6 @@ d3d12_resource_get_handle(struct pipe_screen *pscreen, struct winsys_handle *handle, unsigned usage) { - struct d3d12_screen *screen = d3d12_screen(pscreen); struct d3d12_resource *res = d3d12_resource(pres); if (handle->type != WINSYS_HANDLE_TYPE_D3D12_RES) diff --git a/src/gallium/drivers/d3d12/d3d12_surface.cpp b/src/gallium/drivers/d3d12/d3d12_surface.cpp index 9ddbb7e59dc..8cd7623ee3e 100644 --- a/src/gallium/drivers/d3d12/d3d12_surface.cpp +++ b/src/gallium/drivers/d3d12/d3d12_surface.cpp @@ -220,10 +220,6 @@ d3d12_create_surface(struct pipe_context *pctx, struct pipe_resource *pres, const struct pipe_surface *tpl) { - struct d3d12_resource *res = d3d12_resource(pres); - struct d3d12_context *ctx = d3d12_context(pctx); - struct d3d12_screen *screen = d3d12_screen(pctx->screen); - bool is_depth_or_stencil = util_format_is_depth_or_stencil(tpl->format); unsigned bind = is_depth_or_stencil ? PIPE_BIND_DEPTH_STENCIL : PIPE_BIND_RENDER_TARGET; @@ -259,7 +255,6 @@ static void d3d12_surface_destroy(struct pipe_context *pctx, struct pipe_surface *psurf) { - struct d3d12_context *ctx = d3d12_context(pctx); struct d3d12_surface *surface = (struct d3d12_surface*) psurf; d3d12_descriptor_handle_free(&surface->desc_handle);