nv30: create uploader after pipe->screen is set
authorIlia Mirkin <imirkin@alum.mit.edu>
Sun, 19 Mar 2017 05:22:29 +0000 (01:22 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Sun, 19 Mar 2017 05:24:06 +0000 (01:24 -0400)
Fixes crashes after recent upload rework.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/nv30/nv30_context.c

index 716d2bbe4c15c4fc5fd1362a472755d4271f5fae..4c16e0c41df6335ee1b0e102ad8ef32ec3cdb23f 100644 (file)
@@ -209,6 +209,12 @@ nv30_context_create(struct pipe_screen *pscreen, void *priv, unsigned ctxflags)
    nv30->base.screen = &screen->base;
    nv30->base.copy_data = nv30_transfer_copy_data;
 
+   pipe = &nv30->base.pipe;
+   pipe->screen = pscreen;
+   pipe->priv = priv;
+   pipe->destroy = nv30_context_destroy;
+   pipe->flush = nv30_context_flush;
+
    nv30->base.pipe.stream_uploader = u_upload_create_default(&nv30->base.pipe);
    if (!nv30->base.pipe.stream_uploader) {
       nv30_context_destroy(pipe);
@@ -216,12 +222,6 @@ nv30_context_create(struct pipe_screen *pscreen, void *priv, unsigned ctxflags)
    }
    nv30->base.pipe.const_uploader = nv30->base.pipe.stream_uploader;
 
-   pipe = &nv30->base.pipe;
-   pipe->screen = pscreen;
-   pipe->priv = priv;
-   pipe->destroy = nv30_context_destroy;
-   pipe->flush = nv30_context_flush;
-
    /*XXX: *cough* per-context client */
    nv30->base.client = screen->base.client;