summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_flush.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2010-05-26 01:23:07 +0200
committerMarek Olšák <[email protected]>2010-05-26 01:23:11 +0200
commit2c072c8f72647a3b32e9855f7635b37ba399f5be (patch)
tree861a0b424ed1e4e17b6ca9f0f0503b8daa8ea161 /src/gallium/drivers/r300/r300_flush.c
parente1c117d87bd1c77c6093a7a77b7994a8313b084e (diff)
r300g: implement fake but compliant fences
Diffstat (limited to 'src/gallium/drivers/r300/r300_flush.c')
-rw-r--r--src/gallium/drivers/r300/r300_flush.c38
1 files changed, 5 insertions, 33 deletions
diff --git a/src/gallium/drivers/r300/r300_flush.c b/src/gallium/drivers/r300/r300_flush.c
index f629e57c5a4..9cda940c85d 100644
--- a/src/gallium/drivers/r300/r300_flush.c
+++ b/src/gallium/drivers/r300/r300_flush.c
@@ -37,8 +37,7 @@ static void r300_flush(struct pipe_context* pipe,
struct r300_context *r300 = r300_context(pipe);
struct r300_query *query;
struct r300_atom *atom;
- struct pipe_framebuffer_state *fb;
- unsigned i;
+ struct r300_fence **rfence = (struct r300_fence**)fence;
CS_LOCALS(r300);
(void) cs_count;
@@ -75,37 +74,10 @@ static void r300_flush(struct pipe_context* pipe,
query->flushed = TRUE;
}
- /* XXX
- *
- * This is a preliminary implementation of glFinish. Note that st/mesa
- * uses a non-null fence when glFinish is called and then waits for
- * the fence. Instead of returning the actual fence, we do the sync
- * directly.
- *
- * The ideal implementation should use something like EmitIrqLocked and
- * WaitIrq, or better, real fences.
- *
- * This feature degrades performance to the level of r300c for games that
- * use glFinish a lot, even openarena does. Ideally we wouldn't need
- * glFinish at all if we had proper throttling in swapbuffers so that
- * the CPU wouldn't outrun the GPU by several frames, so this is basically
- * a temporary fix for the input lag. Once swap&sync works with DRI2,
- * I'll be happy to remove this code.
- *
- * - M. */
- if (fence && 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);
- }
- }
+ /* Create a new fence. */
+ if (rfence) {
+ *rfence = CALLOC_STRUCT(r300_fence);
+ (*rfence)->ctx = r300;
}
}