diff options
author | Rob Clark <[email protected]> | 2020-04-24 13:54:43 -0700 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-04-29 00:08:57 +0000 |
commit | 1e18c58047ef5920dbe442bc6fc42e62dc0edb7d (patch) | |
tree | 551f65eb150a0b5932b82fcaed4c70c299944c9e /src/gallium/drivers | |
parent | bf97cc92216a0738b3dee743695496b68c149b54 (diff) |
freedreno: mark more state dirty when rebinding resources
Plus a bonus typo fix.
Signed-off-by: Rob Clark <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4744>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_context.h | 4 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_resource.c | 18 |
2 files changed, 16 insertions, 6 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_context.h b/src/gallium/drivers/freedreno/freedreno_context.h index 8665d886a69..faaade508fa 100644 --- a/src/gallium/drivers/freedreno/freedreno_context.h +++ b/src/gallium/drivers/freedreno/freedreno_context.h @@ -143,9 +143,11 @@ enum fd_dirty_3d_state { FD_DIRTY_PROG = BIT(16), FD_DIRTY_CONST = BIT(17), FD_DIRTY_TEX = BIT(18), + FD_DIRTY_IMAGE = BIT(19), + FD_DIRTY_SSBO = BIT(20), /* only used by a2xx.. possibly can be removed.. */ - FD_DIRTY_TEXSTATE = BIT(19), + FD_DIRTY_TEXSTATE = BIT(21), }; /* per shader-stage dirty state: */ diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c b/src/gallium/drivers/freedreno/freedreno_resource.c index 247fbe53072..46deed39b8c 100644 --- a/src/gallium/drivers/freedreno/freedreno_resource.c +++ b/src/gallium/drivers/freedreno/freedreno_resource.c @@ -61,7 +61,7 @@ /** * Go through the entire state and see if the resource is bound * anywhere. If it is, mark the relevant state as dirty. This is - * called on realloc_bo to ensure the neccessary state is re- + * called on realloc_bo to ensure the necessary state is re- * emitted so the GPU looks at the new backing bo. */ static void @@ -82,16 +82,20 @@ rebind_resource(struct fd_context *ctx, struct pipe_resource *prsc) for (unsigned i = 1; i < num_ubos; i++) { if (ctx->dirty_shader[stage] & FD_DIRTY_SHADER_CONST) break; - if (ctx->constbuf[stage].cb[i].buffer == prsc) + if (ctx->constbuf[stage].cb[i].buffer == prsc) { ctx->dirty_shader[stage] |= FD_DIRTY_SHADER_CONST; + ctx->dirty |= FD_DIRTY_CONST; + } } /* Textures */ for (unsigned i = 0; i < ctx->tex[stage].num_textures; i++) { if (ctx->dirty_shader[stage] & FD_DIRTY_SHADER_TEX) break; - if (ctx->tex[stage].textures[i] && (ctx->tex[stage].textures[i]->texture == prsc)) + if (ctx->tex[stage].textures[i] && (ctx->tex[stage].textures[i]->texture == prsc)) { ctx->dirty_shader[stage] |= FD_DIRTY_SHADER_TEX; + ctx->dirty |= FD_DIRTY_TEX; + } } /* Images */ @@ -99,8 +103,10 @@ rebind_resource(struct fd_context *ctx, struct pipe_resource *prsc) for (unsigned i = 0; i < num_images; i++) { if (ctx->dirty_shader[stage] & FD_DIRTY_SHADER_IMAGE) break; - if (ctx->shaderimg[stage].si[i].resource == prsc) + if (ctx->shaderimg[stage].si[i].resource == prsc) { ctx->dirty_shader[stage] |= FD_DIRTY_SHADER_IMAGE; + ctx->dirty |= FD_DIRTY_IMAGE; + } } /* SSBOs */ @@ -108,8 +114,10 @@ rebind_resource(struct fd_context *ctx, struct pipe_resource *prsc) for (unsigned i = 0; i < num_ssbos; i++) { if (ctx->dirty_shader[stage] & FD_DIRTY_SHADER_SSBO) break; - if (ctx->shaderbuf[stage].sb[i].buffer == prsc) + if (ctx->shaderbuf[stage].sb[i].buffer == prsc) { ctx->dirty_shader[stage] |= FD_DIRTY_SHADER_SSBO; + ctx->dirty |= FD_DIRTY_SSBO; + } } } } |