From 8e1a4668829e4e4b294060bd940388c436eb39cc Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 22 Dec 2022 20:10:38 -0500 Subject: [PATCH] panfrost: Remove unused so_mask calculation This was copied from Iris, but it's not actually used in the new NIR-based transform feedback implementation that we now use on all chips. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_context.h | 1 - src/gallium/drivers/panfrost/pan_shader.c | 45 ---------------------- 2 files changed, 46 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_context.h b/src/gallium/drivers/panfrost/pan_context.h index 8810009b8b9..e202371c42e 100644 --- a/src/gallium/drivers/panfrost/pan_context.h +++ b/src/gallium/drivers/panfrost/pan_context.h @@ -303,7 +303,6 @@ struct panfrost_compiled_shader { struct pan_linkage linkage; struct pipe_stream_output_info stream_output; - uint64_t so_mask; struct panfrost_shader_key key; diff --git a/src/gallium/drivers/panfrost/pan_shader.c b/src/gallium/drivers/panfrost/pan_shader.c index 5af151bd37f..e77343a65ac 100644 --- a/src/gallium/drivers/panfrost/pan_shader.c +++ b/src/gallium/drivers/panfrost/pan_shader.c @@ -3,7 +3,6 @@ * Copyright (C) 2019-2022 Collabora, Ltd. * Copyright (C) 2019 Red Hat Inc. * Copyright (C) 2018 Alyssa Rosenzweig - * Copyright © 2017 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -223,45 +222,6 @@ panfrost_build_key(struct panfrost_context *ctx, } } -/** - * Fix an uncompiled shader's stream output info, and produce a bitmask - * of which VARYING_SLOT_* are captured for stream output. - * - * Core Gallium stores output->register_index as a "slot" number, where - * slots are assigned consecutively to all outputs in info->outputs_written. - * This naive packing of outputs doesn't work for us - we too have slots, - * but the layout is defined by the VUE map, which we won't have until we - * compile a specific shader variant. So, we remap these and simply store - * VARYING_SLOT_* in our copy's output->register_index fields. - * - * We then produce a bitmask of outputs which are used for SO. - * - * Implementation from iris. - */ - -static uint64_t -update_so_info(struct pipe_stream_output_info *so_info, - uint64_t outputs_written) -{ - uint64_t so_outputs = 0; - uint8_t reverse_map[64] = {0}; - unsigned slot = 0; - - while (outputs_written) - reverse_map[slot++] = u_bit_scan64(&outputs_written); - - for (unsigned i = 0; i < so_info->num_outputs; i++) { - struct pipe_stream_output *output = &so_info->output[i]; - - /* Map Gallium's condensed "slots" back to real VARYING_SLOT_* enums */ - output->register_index = reverse_map[output->register_index]; - - so_outputs |= 1ull << output->register_index; - } - - return so_outputs; -} - static struct panfrost_compiled_shader * panfrost_new_variant_locked( struct panfrost_context *ctx, @@ -278,11 +238,6 @@ panfrost_new_variant_locked( panfrost_shader_get(ctx->base.screen, &ctx->shaders, &ctx->descs, uncompiled, &ctx->base.debug, prog, 0); - /* Fixup the stream out information */ - prog->so_mask = - update_so_info(&prog->stream_output, - prog->info.outputs_written); - prog->earlyzs = pan_earlyzs_analyze(&prog->info); return prog;