diff options
author | Marek Olšák <[email protected]> | 2009-12-02 17:15:27 +0100 |
---|---|---|
committer | Corbin Simpson <[email protected]> | 2009-12-04 09:23:59 -0800 |
commit | 7679447b5835fd73ab44b3d77b12a034c95af5c5 (patch) | |
tree | b057715b502d4df1c52da20719cd85535b7cc1b8 /src/gallium/drivers/r300 | |
parent | 3da8265cd3233e2b22ab0f8a28fbba892984e399 (diff) |
r300g, radeong: fix the CS overflow
Diffstat (limited to 'src/gallium/drivers/r300')
-rw-r--r-- | src/gallium/drivers/r300/r300_cs.h | 2 | ||||
-rw-r--r-- | src/gallium/drivers/r300/r300_emit.c | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h index 8b100375fdf..9fcf3ab538c 100644 --- a/src/gallium/drivers/r300/r300_cs.h +++ b/src/gallium/drivers/r300/r300_cs.h @@ -55,7 +55,7 @@ int cs_count = 0; #define CHECK_CS(size) \ - cs_winsys->check_cs(cs_winsys, (size)) + assert(cs_winsys->check_cs(cs_winsys, (size))) #define BEGIN_CS(size) do { \ CHECK_CS(size); \ diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index a479842f9eb..3bb42f9e434 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -871,10 +871,17 @@ void r300_emit_dirty_state(struct r300_context* r300) return; } + /* Check size of CS. */ + /* Make sure we have at least 8*1024 spare dwords. */ + /* XXX It would be nice to know the number of dwords we really need to + * XXX emit. */ + if (!r300->winsys->check_cs(r300->winsys, 8*1024)) { + r300->context.flush(&r300->context, 0, NULL); + } + /* Clean out BOs. */ r300->winsys->reset_bos(r300->winsys); - /* XXX check size */ validate: /* Color buffers... */ for (i = 0; i < r300->framebuffer_state.nr_cbufs; i++) { |