diff options
author | Pierre Moreau <dev@pmoreau.org> | 2020-07-29 09:33:38 +0200 |
---|---|---|
committer | Ilia Mirkin <imirkin@alum.mit.edu> | 2021-04-11 11:47:42 -0400 |
commit | afe1472cde829a123c088f61ee26bdb7e176c0eb (patch) | |
tree | 92659c6433d2611ade2a5269269b94dbf4de21ac /src/gallium/drivers/nouveau/nv50/nv50_surface.c | |
parent | 2d6b7b2e0c743417b98a7b909858bdc26293f91b (diff) |
nv50: Replace hardcoded texture/constbuf count with define
Signed-off-by: Pierre Moreau <dev@pmoreau.org>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9299>
Diffstat (limited to 'src/gallium/drivers/nouveau/nv50/nv50_surface.c')
-rw-r--r-- | src/gallium/drivers/nouveau/nv50/nv50_surface.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_surface.c b/src/gallium/drivers/nouveau/nv50/nv50_surface.c index b3259f26038..e742336b234 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_surface.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_surface.c @@ -856,8 +856,8 @@ struct nv50_blitctx struct nv50_program *vp; struct nv50_program *gp; struct nv50_program *fp; - unsigned num_textures[3]; - unsigned num_samplers[3]; + unsigned num_textures[NV50_MAX_3D_SHADER_STAGES]; + unsigned num_samplers[NV50_MAX_3D_SHADER_STAGES]; struct pipe_sampler_view *texture[2]; struct nv50_tsc_entry *sampler[2]; unsigned min_samples; @@ -1284,7 +1284,7 @@ nv50_blitctx_pre_blit(struct nv50_blitctx *ctx, memcpy(nv50->window_rect.rect, info->window_rectangles, sizeof(struct pipe_scissor_state) * nv50->window_rect.rects); - for (s = 0; s < 3; ++s) { + for (s = 0; s < NV50_MAX_3D_SHADER_STAGES; ++s) { ctx->saved.num_textures[s] = nv50->num_textures[s]; ctx->saved.num_samplers[s] = nv50->num_samplers[s]; } @@ -1338,7 +1338,7 @@ nv50_blitctx_post_blit(struct nv50_blitctx *blit) pipe_sampler_view_reference(&nv50->textures[2][0], NULL); pipe_sampler_view_reference(&nv50->textures[2][1], NULL); - for (s = 0; s < 3; ++s) { + for (s = 0; s < NV50_MAX_3D_SHADER_STAGES; ++s) { nv50->num_textures[s] = blit->saved.num_textures[s]; nv50->num_samplers[s] = blit->saved.num_samplers[s]; } |