summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2013-05-31 21:43:50 +0200
committerMarek Olšák <[email protected]>2013-06-13 03:54:14 +0200
commitfdf9d234e2aa46f865a59ec15b2d4167bebbc35b (patch)
treecbbd880dcb1774f101123d90eca49e162f21a181 /src
parent6c6cfc02c90663973e1a07f0596d1550bd35a38c (diff)
st/dri: refactor dri_msaa_resolve
The generic blit will be used by the following commit. Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/state_trackers/dri/common/dri_drawable.c16
-rw-r--r--src/gallium/state_trackers/dri/common/dri_drawable.h6
-rw-r--r--src/gallium/state_trackers/dri/drm/dri2.c5
3 files changed, 15 insertions, 12 deletions
diff --git a/src/gallium/state_trackers/dri/common/dri_drawable.c b/src/gallium/state_trackers/dri/common/dri_drawable.c
index f784ee65ea9..ff04d57a258 100644
--- a/src/gallium/state_trackers/dri/common/dri_drawable.c
+++ b/src/gallium/state_trackers/dri/common/dri_drawable.c
@@ -359,13 +359,10 @@ swap_fences_unref(struct dri_drawable *draw)
}
void
-dri_msaa_resolve(struct dri_context *ctx,
- struct dri_drawable *drawable,
- enum st_attachment_type att)
+dri_pipe_blit(struct pipe_context *pipe,
+ struct pipe_resource *dst,
+ struct pipe_resource *src)
{
- struct pipe_context *pipe = ctx->st->pipe;
- struct pipe_resource *dst = drawable->textures[att];
- struct pipe_resource *src = drawable->msaa_textures[att];
struct pipe_blit_info blit;
if (!dst || !src)
@@ -437,9 +434,12 @@ dri_flush(__DRIcontext *cPriv,
/* Flush the drawable. */
if ((flags & __DRI2_FLUSH_DRAWABLE) &&
drawable->textures[ST_ATTACHMENT_BACK_LEFT]) {
- /* Resolve MSAA buffers. */
if (drawable->stvis.samples > 1) {
- dri_msaa_resolve(ctx, drawable, ST_ATTACHMENT_BACK_LEFT);
+ /* Resolve the MSAA back buffer. */
+ dri_pipe_blit(ctx->st->pipe,
+ drawable->textures[ST_ATTACHMENT_BACK_LEFT],
+ drawable->msaa_textures[ST_ATTACHMENT_BACK_LEFT]);
+
/* FRONT_LEFT is resolved in drawable->flush_frontbuffer. */
}
diff --git a/src/gallium/state_trackers/dri/common/dri_drawable.h b/src/gallium/state_trackers/dri/common/dri_drawable.h
index 56f8a4073a3..50e5cc4cd67 100644
--- a/src/gallium/state_trackers/dri/common/dri_drawable.h
+++ b/src/gallium/state_trackers/dri/common/dri_drawable.h
@@ -110,9 +110,9 @@ dri_drawable_get_format(struct dri_drawable *drawable,
unsigned *bind);
void
-dri_msaa_resolve(struct dri_context *ctx,
- struct dri_drawable *drawable,
- enum st_attachment_type att);
+dri_pipe_blit(struct pipe_context *pipe,
+ struct pipe_resource *dst,
+ struct pipe_resource *src);
void
dri_flush(__DRIcontext *cPriv,
diff --git a/src/gallium/state_trackers/dri/drm/dri2.c b/src/gallium/state_trackers/dri/drm/dri2.c
index 4117a9f09dd..50628a618e7 100644
--- a/src/gallium/state_trackers/dri/drm/dri2.c
+++ b/src/gallium/state_trackers/dri/drm/dri2.c
@@ -470,7 +470,10 @@ dri2_flush_frontbuffer(struct dri_context *ctx,
if (drawable->stvis.samples > 1) {
struct pipe_context *pipe = ctx->st->pipe;
- dri_msaa_resolve(ctx, drawable, ST_ATTACHMENT_FRONT_LEFT);
+ /* 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);
}