diff options
author | Marek Olšák <[email protected]> | 2010-05-26 01:23:07 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2010-05-26 01:23:11 +0200 |
commit | 2c072c8f72647a3b32e9855f7635b37ba399f5be (patch) | |
tree | 861a0b424ed1e4e17b6ca9f0f0503b8daa8ea161 /src/gallium/drivers/r300/r300_context.c | |
parent | e1c117d87bd1c77c6093a7a77b7994a8313b084e (diff) |
r300g: implement fake but compliant fences
Diffstat (limited to 'src/gallium/drivers/r300/r300_context.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_context.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index 505970ffb8a..4721b7d5dc9 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -235,3 +235,29 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, FREE(r300); return NULL; } + +void r300_finish(struct r300_context *r300) +{ + struct pipe_framebuffer_state *fb; + unsigned i; + + /* This is a preliminary implementation of glFinish. + * + * The ideal implementation should use something like EmitIrqLocked and + * WaitIrq, or better, real fences. + */ + if (r300->fb_state.state) { + fb = r300->fb_state.state; + + for (i = 0; i < fb->nr_cbufs; i++) { + if (fb->cbufs[i]->texture) { + r300->rws->buffer_wait(r300->rws, + r300_texture(fb->cbufs[i]->texture)->buffer); + } + if (fb->zsbuf) { + r300->rws->buffer_wait(r300->rws, + r300_texture(fb->zsbuf->texture)->buffer); + } + } + } +} |