summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/dri
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2013-09-20 15:08:29 +0200
committerMarek Olšák <[email protected]>2013-09-20 20:35:55 +0200
commit419cd5f2a24b87d31a2fd9dd9b7d0025b4f5515c (patch)
tree517df295a28d5fc0f0542de5e6f2552886b32e5b /src/gallium/state_trackers/dri
parentd2bd63433a252c84488023e9877e70d69223da42 (diff)
gallium: add flush_resource context function
r600g needs explicit flushing before DRI2 buffers are presented on the screen. v2: add (stub) implementations for all drivers, fix frontbuffer flushing v3: fix galahad Signed-off-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/dri')
-rw-r--r--src/gallium/state_trackers/dri/common/dri_drawable.c4
-rw-r--r--src/gallium/state_trackers/dri/drm/dri2.c10
2 files changed, 11 insertions, 3 deletions
diff --git a/src/gallium/state_trackers/dri/common/dri_drawable.c b/src/gallium/state_trackers/dri/common/dri_drawable.c
index ddf940048cf..f255108dabe 100644
--- a/src/gallium/state_trackers/dri/common/dri_drawable.c
+++ b/src/gallium/state_trackers/dri/common/dri_drawable.c
@@ -438,6 +438,8 @@ dri_flush(__DRIcontext *cPriv,
/* Flush the drawable. */
if ((flags & __DRI2_FLUSH_DRAWABLE) &&
drawable->textures[ST_ATTACHMENT_BACK_LEFT]) {
+ struct pipe_context *pipe = ctx->st->pipe;
+
if (drawable->stvis.samples > 1 &&
reason == __DRI2_THROTTLE_SWAPBUFFER) {
/* Resolve the MSAA back buffer. */
@@ -458,6 +460,8 @@ dri_flush(__DRIcontext *cPriv,
if (ctx->hud) {
hud_draw(ctx->hud, drawable->textures[ST_ATTACHMENT_BACK_LEFT]);
}
+
+ pipe->flush_resource(pipe, drawable->textures[ST_ATTACHMENT_BACK_LEFT]);
}
flush_flags = 0;
diff --git a/src/gallium/state_trackers/dri/drm/dri2.c b/src/gallium/state_trackers/dri/drm/dri2.c
index fea1c8dfe52..919ba6dc2a0 100644
--- a/src/gallium/state_trackers/dri/drm/dri2.c
+++ b/src/gallium/state_trackers/dri/drm/dri2.c
@@ -479,20 +479,24 @@ dri2_flush_frontbuffer(struct dri_context *ctx,
{
__DRIdrawable *dri_drawable = drawable->dPriv;
struct __DRIdri2LoaderExtensionRec *loader = drawable->sPriv->dri2.loader;
+ struct pipe_context *pipe = ctx->st->pipe;
if (statt != ST_ATTACHMENT_FRONT_LEFT)
return;
if (drawable->stvis.samples > 1) {
- struct pipe_context *pipe = ctx->st->pipe;
-
/* Resolve the front buffer. */
dri_pipe_blit(ctx->st->pipe,
drawable->textures[ST_ATTACHMENT_FRONT_LEFT],
drawable->msaa_textures[ST_ATTACHMENT_FRONT_LEFT]);
- pipe->flush(pipe, NULL, 0);
}
+ if (drawable->textures[ST_ATTACHMENT_FRONT_LEFT]) {
+ pipe->flush_resource(pipe, drawable->textures[ST_ATTACHMENT_FRONT_LEFT]);
+ }
+
+ pipe->flush(pipe, NULL, 0);
+
if (loader->flushFrontBuffer) {
loader->flushFrontBuffer(dri_drawable, dri_drawable->loaderPrivate);
}