nv50-nvc0: set cur_ctx during init if none currently bound
authorBen Skeggs <bskeggs@redhat.com>
Tue, 1 Mar 2011 04:37:06 +0000 (14:37 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 1 Mar 2011 04:44:42 +0000 (14:44 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
src/gallium/drivers/nv50/nv50_context.c
src/gallium/drivers/nvc0/nvc0_context.c

index bb6272a4a23da608b0325d5278ec598d9ffd1e28..8eb59e20d8dd21fcaad0d97f49a3ba2023497de4 100644 (file)
@@ -102,6 +102,8 @@ nv50_create(struct pipe_screen *pscreen, void *priv)
 
    nv50->pipe.flush = nv50_flush;
 
+   if (!screen->cur_ctx)
+      screen->cur_ctx = nv50;
    screen->base.channel->user_private = nv50;
    screen->base.channel->flush_notify = nv50_default_flush_notify;
 
index f02de4d044a8e0b267ef7798d80177c78d32ac4e..ebdf5f2f9e8e2c6214a6928b117e2a4a8507163d 100644 (file)
@@ -101,6 +101,8 @@ nvc0_create(struct pipe_screen *pscreen, void *priv)
 
    nvc0->pipe.flush = nvc0_flush;
 
+   if (!screen->cur_ctx)
+      screen->cur_ctx = nvc0;
    screen->base.channel->user_private = nvc0;
    screen->base.channel->flush_notify = nvc0_default_flush_notify;