From 5a550c8dc79120c259cea42db376ba7949e98384 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 16 Feb 2021 12:45:08 -0800 Subject: [PATCH] lima: don't look at dirty bits for setup of FS key You always have to populate the key with the right texture swizzles, even if textures haven't changed since binding a new shader. Signed-off-by: Erico Nunes Reviewed-by: Vasily Khoruzhick Part-of: --- src/gallium/drivers/lima/lima_program.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/gallium/drivers/lima/lima_program.c b/src/gallium/drivers/lima/lima_program.c index adc0c923ccd..6248dea640d 100644 --- a/src/gallium/drivers/lima/lima_program.c +++ b/src/gallium/drivers/lima/lima_program.c @@ -503,20 +503,16 @@ lima_update_fs_state(struct lima_context *ctx) memset(key, 0, sizeof(*key)); key->shader_state = ctx->bind_fs; - if (((ctx->dirty & LIMA_CONTEXT_DIRTY_TEXTURES) && - lima_tex->num_samplers && - lima_tex->num_textures)) { - for (int i = 0; i < lima_tex->num_samplers; i++) { - struct lima_sampler_view *sampler = lima_sampler_view(lima_tex->textures[i]); - for (int j = 0; j < 4; j++) - key->tex[i].swizzle[j] = sampler->swizzle[j]; - } + for (int i = 0; i < lima_tex->num_textures; i++) { + struct lima_sampler_view *sampler = lima_sampler_view(lima_tex->textures[i]); + for (int j = 0; j < 4; j++) + key->tex[i].swizzle[j] = sampler->swizzle[j]; } /* Fill rest with identity swizzle */ uint8_t identity[4] = { PIPE_SWIZZLE_X, PIPE_SWIZZLE_Y, PIPE_SWIZZLE_Z, PIPE_SWIZZLE_W }; - for (int i = lima_tex->num_samplers; i < PIPE_MAX_SAMPLERS; i++) + for (int i = lima_tex->num_textures; i < ARRAY_SIZE(key->tex); i++) memcpy(key->tex[i].swizzle, identity, 4); struct lima_fs_shader_state *old_fs = ctx->fs;