freedreno/a6xx: pre-bake UBWC flags in texture-view
authorRob Clark <robdclark@chromium.org>
Sun, 28 Apr 2019 16:35:15 +0000 (09:35 -0700)
committerRob Clark <robdclark@chromium.org>
Tue, 30 Apr 2019 00:01:01 +0000 (17:01 -0700)
Small cleanup.  No need to defer this to emit time.

Signed-off-by: Rob Clark <robdclark@chromium.org>
src/gallium/drivers/freedreno/a6xx/fd6_emit.c
src/gallium/drivers/freedreno/a6xx/fd6_texture.c

index f0aa854888c62b8af62e59706c61db1fc077779b..efb4d5fd84b780d9b3fe066f9019758a52014164 100644 (file)
@@ -436,9 +436,7 @@ fd6_emit_textures(struct fd_pipe *pipe, struct fd_ringbuffer *ring,
                        OUT_RING(state, view->texconst0);
                        OUT_RING(state, view->texconst1);
                        OUT_RING(state, view->texconst2);
-                       OUT_RING(state, view->texconst3 |
-                               COND(rsc && view->ubwc_enabled,
-                                       A6XX_TEX_CONST_3_FLAG | A6XX_TEX_CONST_3_UNK27));
+                       OUT_RING(state, view->texconst3);
 
                        if (rsc) {
                                if (view->base.format == PIPE_FORMAT_X32_S8X24_UINT)
index 54f49861e0623ae58d0740c3789f160dc0d7a970..d7e7105c748445db4fbad2a1740c292eb9baf31b 100644 (file)
@@ -314,6 +314,10 @@ fd6_sampler_view_create(struct pipe_context *pctx, struct pipe_resource *prsc,
                break;
        }
 
+       if (so->ubwc_enabled) {
+               so->texconst3 |= A6XX_TEX_CONST_3_FLAG | A6XX_TEX_CONST_3_UNK27;
+       }
+
        return &so->base;
 }