diff options
author | Benjamin Franzke <[email protected]> | 2011-09-09 10:12:23 +0200 |
---|---|---|
committer | Benjamin Franzke <[email protected]> | 2011-11-02 15:43:27 +0100 |
commit | 98aa2a8f725e44aec8bd998fe436a134e94f13bb (patch) | |
tree | 90adc91f3a3528d91d398605843cc6a22d3b4c30 /src/gallium/state_trackers/dri/common | |
parent | 0a2afcb754c9d291f13650732a6a40aac1a019f2 (diff) |
st/dri/sw: Implement texture_from_pixmap
This is a cleanup of commit 02f1b50987c0d24da3dcc36dbb44821c20d0660c.
Update tex buffer using a dri_drawable hook from implemented in sw/drisw.c.
This saves us the duplication of dri_drawable.c.
CC: Stuart Abercrombie <[email protected]>
CC: Stéphane Marchesin <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/dri/common')
-rw-r--r-- | src/gallium/state_trackers/dri/common/dri_drawable.c | 3 | ||||
-rw-r--r-- | src/gallium/state_trackers/dri/common/dri_drawable.h | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/dri/common/dri_drawable.c b/src/gallium/state_trackers/dri/common/dri_drawable.c index 340404e6aa4..485616fde6c 100644 --- a/src/gallium/state_trackers/dri/common/dri_drawable.c +++ b/src/gallium/state_trackers/dri/common/dri_drawable.c @@ -207,6 +207,7 @@ dri_set_tex_buffer2(__DRIcontext *pDRICtx, GLint target, dri_drawable_validate_att(drawable, ST_ATTACHMENT_FRONT_LEFT); + /* Use the pipe resource associated with the X drawable */ pt = drawable->textures[ST_ATTACHMENT_FRONT_LEFT]; if (pt) { @@ -226,6 +227,8 @@ dri_set_tex_buffer2(__DRIcontext *pDRICtx, GLint target, } } + drawable->update_tex_buffer(drawable, ctx, pt); + ctx->st->teximage(ctx->st, (target == GL_TEXTURE_2D) ? ST_TEXTURE_2D : ST_TEXTURE_RECT, 0, internal_format, pt, FALSE); diff --git a/src/gallium/state_trackers/dri/common/dri_drawable.h b/src/gallium/state_trackers/dri/common/dri_drawable.h index 007421ebe18..3e3876e74a5 100644 --- a/src/gallium/state_trackers/dri/common/dri_drawable.h +++ b/src/gallium/state_trackers/dri/common/dri_drawable.h @@ -77,6 +77,10 @@ struct dri_drawable void (*flush_frontbuffer)(struct dri_drawable *drawable, enum st_attachment_type statt); + + void (*update_tex_buffer)(struct dri_drawable *drawable, + struct dri_context *ctx, + struct pipe_resource *res); }; static INLINE struct dri_drawable * |