From 5a91e04fa4b2f3ad9346f58a3789889ded36e41d Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Fri, 27 Jun 2025 19:40:59 +0200 Subject: [PATCH] nvc0: remove dead surface tracking code Part-of: --- .../drivers/nouveau/nvc0/nvc0_context.c | 5 --- .../drivers/nouveau/nvc0/nvc0_context.h | 5 --- .../drivers/nouveau/nvc0/nvc0_screen.h | 2 -- src/gallium/drivers/nouveau/nvc0/nvc0_state.c | 31 ------------------- 4 files changed, 43 deletions(-) diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c index 3d56a121fa9..4078a5c4294 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c @@ -219,11 +219,6 @@ nvc0_context_unreference_resources(struct nvc0_context *nvc0) } } - for (s = 0; s < 2; ++s) { - for (i = 0; i < NVC0_MAX_SURFACE_SLOTS; ++i) - pipe_surface_reference(&nvc0->surfaces[s][i], NULL); - } - for (i = 0; i < nvc0->num_tfbbufs; ++i) pipe_so_target_reference(&nvc0->tfbbuf[i], NULL); diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_context.h b/src/gallium/drivers/nouveau/nvc0/nvc0_context.h index f2b7d75d10f..cdff8cbcfea 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_context.h +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_context.h @@ -271,11 +271,6 @@ struct nvc0_context { struct nvc0_blitctx *blit; - /* NOTE: some of these surfaces may reference buffers */ - struct pipe_surface *surfaces[2][NVC0_MAX_SURFACE_SLOTS]; - uint16_t surfaces_dirty[2]; - uint16_t surfaces_valid[2]; - struct pipe_shader_buffer buffers[6][NVC0_MAX_BUFFERS]; uint32_t buffers_dirty[6]; uint32_t buffers_valid[6]; diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.h b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.h index 07e3cde62c8..ffdf3c10013 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.h +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.h @@ -20,8 +20,6 @@ #define NVC0_MAX_CONST_BUFFERS 16 #define NVC0_MAX_CONSTBUF_SIZE 65536 -#define NVC0_MAX_SURFACE_SLOTS 16 - #define NVC0_MAX_VIEWPORTS 16 #define NVC0_MAX_BUFFERS 32 diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c index 28e3f1aa650..c15890e8048 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c @@ -1175,37 +1175,6 @@ nvc0_set_transform_feedback_targets(struct pipe_context *pipe, } } -static void -nvc0_bind_surfaces_range(struct nvc0_context *nvc0, const unsigned t, - unsigned start, unsigned nr, - struct pipe_surface **psurfaces) -{ - const unsigned end = start + nr; - const unsigned mask = ((1 << nr) - 1) << start; - unsigned i; - - if (psurfaces) { - for (i = start; i < end; ++i) { - const unsigned p = i - start; - if (psurfaces[p]) - nvc0->surfaces_valid[t] |= (1 << i); - else - nvc0->surfaces_valid[t] &= ~(1 << i); - pipe_surface_reference(&nvc0->surfaces[t][i], psurfaces[p]); - } - } else { - for (i = start; i < end; ++i) - pipe_surface_reference(&nvc0->surfaces[t][i], NULL); - nvc0->surfaces_valid[t] &= ~mask; - } - nvc0->surfaces_dirty[t] |= mask; - - if (t == 0) - nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_3D_SUF); - else - nouveau_bufctx_reset(nvc0->bufctx_cp, NVC0_BIND_CP_SUF); -} - static bool nvc0_bind_images_range(struct nvc0_context *nvc0, const unsigned s, unsigned start, unsigned nr,