diff options
author | George Sapountzis <gsapountzis@gmail.com> | 2010-05-26 01:08:15 +0300 |
---|---|---|
committer | George Sapountzis <gsapountzis@gmail.com> | 2010-07-30 23:43:26 +0300 |
commit | a30b966f8345cb99922a416fce2da6edb70f864c (patch) | |
tree | 4d78fcb19e905b6caefb5854eb530fc701fc70e6 /src/gallium/state_trackers/dri/sw/drisw.c | |
parent | 2e4ad14a525f4028f0e0a93de2f8db785df33fb7 (diff) | |
download | external_mesa3d-a30b966f8345cb99922a416fce2da6edb70f864c.zip external_mesa3d-a30b966f8345cb99922a416fce2da6edb70f864c.tar.gz external_mesa3d-a30b966f8345cb99922a416fce2da6edb70f864c.tar.bz2 |
st/dri: drop dri1_helper
Diffstat (limited to 'src/gallium/state_trackers/dri/sw/drisw.c')
-rw-r--r-- | src/gallium/state_trackers/dri/sw/drisw.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/gallium/state_trackers/dri/sw/drisw.c b/src/gallium/state_trackers/dri/sw/drisw.c index 9edade9..d221009 100644 --- a/src/gallium/state_trackers/dri/sw/drisw.c +++ b/src/gallium/state_trackers/dri/sw/drisw.c @@ -43,7 +43,6 @@ #include "dri_screen.h" #include "dri_context.h" #include "dri_drawable.h" -#include "dri1_helper.h" DEBUG_GET_ONCE_BOOL_OPTION(swrast_no_present, "SWRAST_NO_PRESENT", FALSE); static boolean swrast_no_present = FALSE; @@ -88,6 +87,24 @@ drisw_put_image(struct dri_drawable *drawable, put_image(dPriv, data, width, height); } +static struct pipe_surface * +drisw_get_pipe_surface(struct dri_drawable *drawable, struct pipe_resource *ptex) +{ + struct pipe_screen *pipe_screen = dri_screen(drawable->sPriv)->base.screen; + struct pipe_surface *psurf = drawable->drisw_surface; + + if (!psurf || psurf->texture != ptex) { + pipe_surface_reference(&drawable->drisw_surface, NULL); + + drawable->drisw_surface = pipe_screen->get_tex_surface(pipe_screen, + ptex, 0, 0, 0, 0/* no bind flag???*/); + + psurf = drawable->drisw_surface; + } + + return psurf; +} + static INLINE void drisw_present_texture(__DRIdrawable *dPriv, struct pipe_resource *ptex) @@ -99,7 +116,7 @@ drisw_present_texture(__DRIdrawable *dPriv, if (swrast_no_present) return; - psurf = dri1_get_pipe_surface(drawable, ptex); + psurf = drisw_get_pipe_surface(drawable, ptex); if (!psurf) return; @@ -174,10 +191,6 @@ drisw_flush_frontbuffer(struct dri_drawable *drawable, * During fixed-size operation, the function keeps allocating new attachments * as they are requested. Unused attachments are not removed, not until the * framebuffer is resized or destroyed. - * - * It should be possible for DRI1 and DRISW to share this function, but it - * seems a better seperation and safer for each DRI version to provide its own - * function. */ static void drisw_allocate_textures(struct dri_drawable *drawable, |