freedreno: mark more state dirty when rebinding resources
authorRob Clark <robdclark@chromium.org>
Fri, 24 Apr 2020 20:54:43 +0000 (13:54 -0700)
committerMarge Bot <eric+marge@anholt.net>
Wed, 29 Apr 2020 00:08:57 +0000 (00:08 +0000)
Plus a bonus typo fix.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4744>

src/gallium/drivers/freedreno/freedreno_context.h
src/gallium/drivers/freedreno/freedreno_resource.c

index 8665d886a69b431e9f53b8bd90aa8366d2ce8388..faaade508fa9d2fc80d3f3c9ea95490422fb9859 100644 (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: */
index 247fbe53072940324314202c8aa8265e7081b089..46deed39b8cf2a80c54f18e7a68076a1d87f20aa 100644 (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;
+                       }
                }
        }
 }