freedreno: Fix assertion failures in context setup in shader-db mode.
authorEric Anholt <eric@anholt.net>
Mon, 13 May 2019 23:58:51 +0000 (16:58 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 16 May 2019 17:25:06 +0000 (10:25 -0700)
The TTN path needs access to the screen to make the right decisions about
lowering, but we didn't have pctx->screen set up at fdN_prog_init time.

Reviewed-by: Rob Clark <robdclark@gmail.com>
Tested-by: Eduardo Lima Mitev <elima@igalia.com>
src/gallium/drivers/freedreno/a3xx/fd3_context.c
src/gallium/drivers/freedreno/a4xx/fd4_context.c
src/gallium/drivers/freedreno/a5xx/fd5_context.c
src/gallium/drivers/freedreno/a6xx/fd6_context.c

index 59dcaa4bf6b6e38aaa12cfbfbcc91fee123e5af7..878f67afba03429507da7325768564dde5d1df03 100644 (file)
@@ -79,6 +79,7 @@ fd3_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
                return NULL;
 
        pctx = &fd3_ctx->base.base;
+       pctx->screen = pscreen;
 
        fd3_ctx->base.dev = fd_device_ref(screen->dev);
        fd3_ctx->base.screen = fd_screen(pscreen);
index e9730e9c20905e2b710c714e8678c75d95a7c206..896050918dcafd9ef6580750580e68af32b74a50 100644 (file)
@@ -79,6 +79,7 @@ fd4_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
                return NULL;
 
        pctx = &fd4_ctx->base.base;
+       pctx->screen = pscreen;
 
        fd4_ctx->base.dev = fd_device_ref(screen->dev);
        fd4_ctx->base.screen = fd_screen(pscreen);
index 37e02c61b1f1d7b53849cad91b79ea77e74f739d..211d2b5fee5d09e8b83a4b97693abe52ac46cac7 100644 (file)
@@ -78,6 +78,7 @@ fd5_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
                return NULL;
 
        pctx = &fd5_ctx->base.base;
+       pctx->screen = pscreen;
 
        fd5_ctx->base.dev = fd_device_ref(screen->dev);
        fd5_ctx->base.screen = fd_screen(pscreen);
index 7ba0926e3a047cb8ca936f06f2785b817f4862b5..4f696ef092c4a7167d8d949ade545c311dceb4c3 100644 (file)
@@ -84,6 +84,7 @@ fd6_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
                return NULL;
 
        pctx = &fd6_ctx->base.base;
+       pctx->screen = pscreen;
 
        fd6_ctx->base.dev = fd_device_ref(screen->dev);
        fd6_ctx->base.screen = fd_screen(pscreen);