From 1448d2f252efc1ab8d3175c7fd9701dfe3079577 Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Sun, 17 Jan 2010 17:37:55 +0100 Subject: nv50: implement instanced drawing Too bad we don't have hw array divisors or a method for setting startInstance. --- src/gallium/drivers/nv50/nv50_context.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/gallium/drivers/nv50/nv50_context.c') diff --git a/src/gallium/drivers/nv50/nv50_context.c b/src/gallium/drivers/nv50/nv50_context.c index 22a8498c69..1e69746322 100644 --- a/src/gallium/drivers/nv50/nv50_context.c +++ b/src/gallium/drivers/nv50/nv50_context.c @@ -104,7 +104,9 @@ nv50_create(struct pipe_screen *pscreen, unsigned pctx_id) nv50->pipe.destroy = nv50_destroy; nv50->pipe.draw_arrays = nv50_draw_arrays; + nv50->pipe.draw_arrays_instanced = nv50_draw_arrays_instanced; nv50->pipe.draw_elements = nv50_draw_elements; + nv50->pipe.draw_elements_instanced = nv50_draw_elements_instanced; nv50->pipe.clear = nv50_clear; nv50->pipe.flush = nv50_flush; -- cgit v1.2.3 From 49dde55b96f717171a9dc6facd800e1c4be6eedf Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Sat, 23 Jan 2010 18:35:27 +0100 Subject: nv50: only flush texture caches on st request --- src/gallium/drivers/nv50/nv50_context.c | 5 +++++ src/gallium/drivers/nv50/nv50_tex.c | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src/gallium/drivers/nv50/nv50_context.c') diff --git a/src/gallium/drivers/nv50/nv50_context.c b/src/gallium/drivers/nv50/nv50_context.c index 1e69746322..e2198b189d 100644 --- a/src/gallium/drivers/nv50/nv50_context.c +++ b/src/gallium/drivers/nv50/nv50_context.c @@ -34,6 +34,11 @@ nv50_flush(struct pipe_context *pipe, unsigned flags, struct nv50_context *nv50 = nv50_context(pipe); struct nouveau_channel *chan = nv50->screen->base.channel; + if (flags & PIPE_FLUSH_TEXTURE_CACHE) { + BEGIN_RING(chan, nv50->screen->tesla, 0x1338, 1); + OUT_RING (chan, 0x20); + } + if (flags & PIPE_FLUSH_FRAME) FIRE_RING(chan); } diff --git a/src/gallium/drivers/nv50/nv50_tex.c b/src/gallium/drivers/nv50/nv50_tex.c index 871536dca9..9f1a171303 100644 --- a/src/gallium/drivers/nv50/nv50_tex.c +++ b/src/gallium/drivers/nv50/nv50_tex.c @@ -220,11 +220,8 @@ nv50_tex_validate(struct nv50_context *nv50) return; } - /* not sure if the following really do what I think: */ so_method(so, tesla, 0x1330, 1); /* flush TIC */ so_data (so, 0); - so_method(so, tesla, 0x1338, 1); /* flush texture caches */ - so_data (so, 0x20); so_ref(so, &nv50->state.tic_upload); so_ref(NULL, &so); -- cgit v1.2.3 From 0ef781c1ae04451ac4f184187e900f872cad5f94 Mon Sep 17 00:00:00 2001 From: Marcin Slusarz Date: Wed, 20 Jan 2010 23:27:07 +0100 Subject: nv50: fix crash in nv50_pre_pipebuffer_map (nv50_screen->cur_ctx) nv50_pre_pipebuffer_map references screen->cur_ctx which points to freed memory after the context is destroyed. This crash is easily triggerable by progs/xdemos/glxcontexts. --- src/gallium/drivers/nv50/nv50_context.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/gallium/drivers/nv50/nv50_context.c') diff --git a/src/gallium/drivers/nv50/nv50_context.c b/src/gallium/drivers/nv50/nv50_context.c index e2198b189d..5c705ccc8f 100644 --- a/src/gallium/drivers/nv50/nv50_context.c +++ b/src/gallium/drivers/nv50/nv50_context.c @@ -86,6 +86,10 @@ nv50_destroy(struct pipe_context *pipe) so_ref(NULL, &nv50->state.vtxattr); draw_destroy(nv50->draw); + + if (nv50->screen->cur_ctx == nv50) + nv50->screen->cur_ctx = NULL; + FREE(nv50); } -- cgit v1.2.3