freedreno: mark more state dirty when rebinding resources

Plus a bonus typo fix.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4744>
This commit is contained in:
Rob Clark
2020-04-24 13:54:43 -07:00
committed by Marge Bot
parent bf97cc9221
commit 1e18c58047
2 changed files with 16 additions and 6 deletions

View File

@@ -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: */

View File

@@ -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;
}
}
}
}