diff --git a/src/gallium/auxiliary/driver_ddebug/dd_screen.c b/src/gallium/auxiliary/driver_ddebug/dd_screen.c index a0a8ab1b063..dadcde63a13 100644 --- a/src/gallium/auxiliary/driver_ddebug/dd_screen.c +++ b/src/gallium/auxiliary/driver_ddebug/dd_screen.c @@ -167,14 +167,16 @@ dd_screen_can_create_resource(struct pipe_screen *_screen, static void dd_screen_flush_frontbuffer(struct pipe_screen *_screen, + struct pipe_context *_pipe, struct pipe_resource *resource, unsigned level, unsigned layer, void *context_private, struct pipe_box *sub_box) { struct pipe_screen *screen = dd_screen(_screen)->screen; + struct pipe_context *pipe = _pipe ? dd_context(_pipe)->pipe : NULL; - screen->flush_frontbuffer(screen, resource, level, layer, context_private, + screen->flush_frontbuffer(screen, pipe, resource, level, layer, context_private, sub_box); } diff --git a/src/gallium/auxiliary/driver_noop/noop_pipe.c b/src/gallium/auxiliary/driver_noop/noop_pipe.c index 496ccf00dec..f107c71ecf9 100644 --- a/src/gallium/auxiliary/driver_noop/noop_pipe.c +++ b/src/gallium/auxiliary/driver_noop/noop_pipe.c @@ -399,6 +399,7 @@ static struct pipe_context *noop_create_context(struct pipe_screen *screen, * pipe_screen */ static void noop_flush_frontbuffer(struct pipe_screen *_screen, + struct pipe_context *ctx, struct pipe_resource *resource, unsigned level, unsigned layer, void *context_private, struct pipe_box *box) diff --git a/src/gallium/auxiliary/driver_rbug/rbug_screen.c b/src/gallium/auxiliary/driver_rbug/rbug_screen.c index 09987a618fe..25d0fcf0ece 100644 --- a/src/gallium/auxiliary/driver_rbug/rbug_screen.c +++ b/src/gallium/auxiliary/driver_rbug/rbug_screen.c @@ -356,6 +356,7 @@ rbug_screen_resource_destroy(struct pipe_screen *screen, static void rbug_screen_flush_frontbuffer(struct pipe_screen *_screen, + struct pipe_context *_ctx, struct pipe_resource *_resource, unsigned level, unsigned layer, void *context_private, struct pipe_box *sub_box) @@ -364,8 +365,10 @@ rbug_screen_flush_frontbuffer(struct pipe_screen *_screen, struct rbug_resource *rb_resource = rbug_resource(_resource); struct pipe_screen *screen = rb_screen->screen; struct pipe_resource *resource = rb_resource->resource; + struct pipe_context *ctx = _ctx ? rbug_context(_ctx)->pipe : NULL; screen->flush_frontbuffer(screen, + ctx, resource, level, layer, context_private, sub_box); diff --git a/src/gallium/auxiliary/driver_trace/tr_screen.c b/src/gallium/auxiliary/driver_trace/tr_screen.c index 56a70de894a..143161b70b2 100644 --- a/src/gallium/auxiliary/driver_trace/tr_screen.c +++ b/src/gallium/auxiliary/driver_trace/tr_screen.c @@ -279,6 +279,7 @@ trace_screen_context_create(struct pipe_screen *_screen, void *priv, static void trace_screen_flush_frontbuffer(struct pipe_screen *_screen, + struct pipe_context *_pipe, struct pipe_resource *resource, unsigned level, unsigned layer, void *context_private, @@ -286,6 +287,7 @@ trace_screen_flush_frontbuffer(struct pipe_screen *_screen, { struct trace_screen *tr_scr = trace_screen(_screen); struct pipe_screen *screen = tr_scr->screen; + struct pipe_context *pipe = _pipe ? trace_context(_pipe)->pipe : NULL; trace_dump_call_begin("pipe_screen", "flush_frontbuffer"); @@ -297,7 +299,7 @@ trace_screen_flush_frontbuffer(struct pipe_screen *_screen, trace_dump_arg(ptr, context_private); */ - screen->flush_frontbuffer(screen, resource, level, layer, context_private, sub_box); + screen->flush_frontbuffer(screen, pipe, resource, level, layer, context_private, sub_box); trace_dump_call_end(); } diff --git a/src/gallium/auxiliary/vl/vl_winsys_dri.c b/src/gallium/auxiliary/vl/vl_winsys_dri.c index ceaa784b903..1f160ec9758 100644 --- a/src/gallium/auxiliary/vl/vl_winsys_dri.c +++ b/src/gallium/auxiliary/vl/vl_winsys_dri.c @@ -120,6 +120,7 @@ vl_dri2_get_flush_reply(struct vl_dri_screen *scrn) static void vl_dri2_flush_frontbuffer(struct pipe_screen *screen, + struct pipe_context *pipe, struct pipe_resource *resource, unsigned level, unsigned layer, void *context_private, struct pipe_box *sub_box) diff --git a/src/gallium/auxiliary/vl/vl_winsys_dri3.c b/src/gallium/auxiliary/vl/vl_winsys_dri3.c index 8d5ad005367..1866dbc413e 100644 --- a/src/gallium/auxiliary/vl/vl_winsys_dri3.c +++ b/src/gallium/auxiliary/vl/vl_winsys_dri3.c @@ -555,6 +555,7 @@ dri3_get_screen_for_root(xcb_connection_t *conn, xcb_window_t root) static void vl_dri3_flush_frontbuffer(struct pipe_screen *screen, + struct pipe_context *pipe, struct pipe_resource *resource, unsigned level, unsigned layer, void *context_private, struct pipe_box *sub_box) diff --git a/src/gallium/drivers/d3d12/d3d12_screen.cpp b/src/gallium/drivers/d3d12/d3d12_screen.cpp index 5241e9f1ac9..3f12eae117e 100644 --- a/src/gallium/drivers/d3d12/d3d12_screen.cpp +++ b/src/gallium/drivers/d3d12/d3d12_screen.cpp @@ -627,6 +627,7 @@ d3d12_destroy_screen(struct pipe_screen *pscreen) static void d3d12_flush_frontbuffer(struct pipe_screen * pscreen, + struct pipe_context *pctx, struct pipe_resource *pres, unsigned level, unsigned layer, void *winsys_drawable_handle, diff --git a/src/gallium/drivers/i915/i915_screen.c b/src/gallium/drivers/i915/i915_screen.c index da878d4a43d..abb4889c822 100644 --- a/src/gallium/drivers/i915/i915_screen.c +++ b/src/gallium/drivers/i915/i915_screen.c @@ -449,6 +449,7 @@ i915_fence_finish(struct pipe_screen *screen, static void i915_flush_frontbuffer(struct pipe_screen *screen, + struct pipe_context *pipe, struct pipe_resource *resource, unsigned level, unsigned layer, void *winsys_drawable_handle, @@ -456,6 +457,7 @@ i915_flush_frontbuffer(struct pipe_screen *screen, { /* XXX: Dummy right now. */ (void)screen; + (void)pipe; (void)resource; (void)level; (void)layer; diff --git a/src/gallium/drivers/iris/iris_screen.c b/src/gallium/drivers/iris/iris_screen.c index 0ee64c58385..19ee81f1680 100644 --- a/src/gallium/drivers/iris/iris_screen.c +++ b/src/gallium/drivers/iris/iris_screen.c @@ -82,6 +82,7 @@ static void iris_flush_frontbuffer(struct pipe_screen *_screen, + struct pipe_context *_pipe, struct pipe_resource *resource, unsigned level, unsigned layer, void *context_private, struct pipe_box *box) diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index 753ce175b17..a76aa8d8c34 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -714,6 +714,7 @@ llvmpipe_is_format_supported( struct pipe_screen *_screen, static void llvmpipe_flush_frontbuffer(struct pipe_screen *_screen, + struct pipe_context *_pipe, struct pipe_resource *resource, unsigned level, unsigned layer, void *context_private, diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c index 43f57bbf081..b30cf8a1a5c 100644 --- a/src/gallium/drivers/softpipe/sp_screen.c +++ b/src/gallium/drivers/softpipe/sp_screen.c @@ -481,6 +481,7 @@ softpipe_destroy_screen( struct pipe_screen *screen ) */ static void softpipe_flush_frontbuffer(struct pipe_screen *_screen, + struct pipe_context *pipe, struct pipe_resource *resource, unsigned level, unsigned layer, void *context_private, diff --git a/src/gallium/drivers/swr/swr_loader.cpp b/src/gallium/drivers/swr/swr_loader.cpp index 97db7ca3e8b..84d4b44ee57 100644 --- a/src/gallium/drivers/swr/swr_loader.cpp +++ b/src/gallium/drivers/swr/swr_loader.cpp @@ -145,10 +145,12 @@ swr_create_screen(struct sw_winsys *winsys) void swr_gdi_swap(struct pipe_screen *screen, + struct pipe_context *ctx, struct pipe_resource *res, void *hDC) { screen->flush_frontbuffer(screen, + ctx, res, 0, 0, hDC, diff --git a/src/gallium/drivers/swr/swr_public.h b/src/gallium/drivers/swr/swr_public.h index b32f41fdf7b..d75509b607b 100644 --- a/src/gallium/drivers/swr/swr_public.h +++ b/src/gallium/drivers/swr/swr_public.h @@ -25,6 +25,7 @@ #define SWR_PUBLIC_H struct pipe_screen; +struct pipe_context; struct sw_displaytarget; struct sw_winsys; struct swr_screen; @@ -44,6 +45,7 @@ void swr_destroy_screen_internal(struct swr_screen **screen); #ifdef _WIN32 void swr_gdi_swap(struct pipe_screen *screen, + struct pipe_conext *ctx, struct pipe_resource *res, void *hDC); #endif /* _WIN32 */ diff --git a/src/gallium/drivers/swr/swr_screen.cpp b/src/gallium/drivers/swr/swr_screen.cpp index 8bc7a207901..cd899a6178c 100644 --- a/src/gallium/drivers/swr/swr_screen.cpp +++ b/src/gallium/drivers/swr/swr_screen.cpp @@ -988,6 +988,7 @@ swr_resource_destroy(struct pipe_screen *p_screen, struct pipe_resource *pt) static void swr_flush_frontbuffer(struct pipe_screen *p_screen, + struct pipe_context *pipe, struct pipe_resource *resource, unsigned level, unsigned layer, @@ -997,7 +998,6 @@ swr_flush_frontbuffer(struct pipe_screen *p_screen, struct swr_screen *screen = swr_screen(p_screen); struct sw_winsys *winsys = screen->winsys; struct swr_resource *spr = swr_resource(resource); - struct pipe_context *pipe = screen->pipe; struct swr_context *ctx = swr_context(pipe); if (pipe) { diff --git a/src/gallium/drivers/tegra/tegra_screen.c b/src/gallium/drivers/tegra/tegra_screen.c index 3b31d96788b..2b108b07908 100644 --- a/src/gallium/drivers/tegra/tegra_screen.c +++ b/src/gallium/drivers/tegra/tegra_screen.c @@ -358,6 +358,7 @@ tegra_screen_resource_destroy(struct pipe_screen *pscreen, static void tegra_screen_flush_frontbuffer(struct pipe_screen *pscreen, + struct pipe_context *pcontext, struct pipe_resource *resource, unsigned int level, unsigned int layer, @@ -365,8 +366,11 @@ tegra_screen_flush_frontbuffer(struct pipe_screen *pscreen, struct pipe_box *box) { struct tegra_screen *screen = to_tegra_screen(pscreen); + struct tegra_context *context = to_tegra_context(pcontext); - screen->gpu->flush_frontbuffer(screen->gpu, resource, level, layer, + screen->gpu->flush_frontbuffer(screen->gpu, + context ? context->gpu : NULL, + resource, level, layer, winsys_drawable_handle, box); } diff --git a/src/gallium/drivers/virgl/virgl_screen.c b/src/gallium/drivers/virgl/virgl_screen.c index 92944f4c06f..f55b5f22ac6 100644 --- a/src/gallium/drivers/virgl/virgl_screen.c +++ b/src/gallium/drivers/virgl/virgl_screen.c @@ -745,6 +745,7 @@ virgl_is_format_supported( struct pipe_screen *screen, } static void virgl_flush_frontbuffer(struct pipe_screen *screen, + struct pipe_context *ctx, struct pipe_resource *res, unsigned level, unsigned layer, void *winsys_drawable_handle, struct pipe_box *sub_box) diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c index 0cf08e56903..678074010fc 100644 --- a/src/gallium/drivers/zink/zink_screen.c +++ b/src/gallium/drivers/zink/zink_screen.c @@ -692,6 +692,7 @@ update_queue_props(struct zink_screen *screen) static void zink_flush_frontbuffer(struct pipe_screen *pscreen, + struct pipe_context *pcontext, struct pipe_resource *pres, unsigned level, unsigned layer, void *winsys_drawable_handle, diff --git a/src/gallium/frontends/dri/drisw.c b/src/gallium/frontends/dri/drisw.c index 4ac241c6dbc..3eacc6e57df 100644 --- a/src/gallium/frontends/dri/drisw.c +++ b/src/gallium/frontends/dri/drisw.c @@ -198,7 +198,7 @@ drisw_put_image_shm(struct dri_drawable *drawable, } static inline void -drisw_present_texture(__DRIdrawable *dPriv, +drisw_present_texture(struct pipe_context *pipe, __DRIdrawable *dPriv, struct pipe_resource *ptex, struct pipe_box *sub_box) { struct dri_drawable *drawable = dri_drawable(dPriv); @@ -207,7 +207,7 @@ drisw_present_texture(__DRIdrawable *dPriv, if (screen->swrast_no_present) return; - screen->base.screen->flush_frontbuffer(screen->base.screen, ptex, 0, 0, drawable, sub_box); + screen->base.screen->flush_frontbuffer(screen->base.screen, pipe, ptex, 0, 0, drawable, sub_box); } static inline void @@ -221,10 +221,11 @@ drisw_invalidate_drawable(__DRIdrawable *dPriv) } static inline void -drisw_copy_to_front(__DRIdrawable * dPriv, +drisw_copy_to_front(struct pipe_context *pipe, + __DRIdrawable * dPriv, struct pipe_resource *ptex) { - drisw_present_texture(dPriv, ptex, NULL); + drisw_present_texture(pipe, dPriv, ptex, NULL); drisw_invalidate_drawable(dPriv); } @@ -261,7 +262,7 @@ drisw_swap_buffers(__DRIdrawable *dPriv) drawable->msaa_textures[ST_ATTACHMENT_BACK_LEFT]); } - drisw_copy_to_front(dPriv, ptex); + drisw_copy_to_front(ctx->st->pipe, dPriv, ptex); } } @@ -285,7 +286,7 @@ drisw_copy_sub_buffer(__DRIdrawable *dPriv, int x, int y, ctx->st->flush(ctx->st, ST_FLUSH_FRONT, NULL, NULL, NULL); u_box_2d(x, dPriv->h - y - h, w, h, &box); - drisw_present_texture(dPriv, ptex, &box); + drisw_present_texture(ctx->st->pipe, dPriv, ptex, &box); } } @@ -308,7 +309,7 @@ drisw_flush_frontbuffer(struct dri_context *ctx, ptex = drawable->textures[statt]; if (ptex) { - drisw_copy_to_front(ctx->dPriv, ptex); + drisw_copy_to_front(ctx->st->pipe, ctx->dPriv, ptex); } } diff --git a/src/gallium/frontends/glx/xlib/xm_st.c b/src/gallium/frontends/glx/xlib/xm_st.c index 4fe7b57f24c..04068a62656 100644 --- a/src/gallium/frontends/glx/xlib/xm_st.c +++ b/src/gallium/frontends/glx/xlib/xm_st.c @@ -59,11 +59,13 @@ xmesa_st_framebuffer(struct st_framebuffer_iface *stfbi) */ static bool xmesa_st_framebuffer_display(struct st_framebuffer_iface *stfbi, + struct st_context_iface *stctx, enum st_attachment_type statt) { struct xmesa_st_framebuffer *xstfb = xmesa_st_framebuffer(stfbi); struct pipe_resource *ptex = xstfb->textures[statt]; struct pipe_resource *pres; + struct pipe_context *pctx = stctx ? stctx->pipe : NULL; if (!ptex) return true; @@ -75,7 +77,7 @@ xmesa_st_framebuffer_display(struct st_framebuffer_iface *stfbi, pres = xstfb->display_resource; } - xstfb->screen->flush_frontbuffer(xstfb->screen, pres, 0, 0, &xstfb->buffer->ws, NULL); + xstfb->screen->flush_frontbuffer(xstfb->screen, pctx, pres, 0, 0, &xstfb->buffer->ws, NULL); return true; } @@ -265,7 +267,7 @@ xmesa_st_framebuffer_flush_front(struct st_context_iface *stctx, struct xmesa_st_framebuffer *xstfb = xmesa_st_framebuffer(stfbi); bool ret; - ret = xmesa_st_framebuffer_display(stfbi, statt); + ret = xmesa_st_framebuffer_display(stfbi, stctx, statt); if (ret && xmesa_strict_invalidate) xmesa_check_buffer_size(xstfb->buffer); @@ -347,7 +349,7 @@ xmesa_swap_st_framebuffer(struct st_framebuffer_iface *stfbi) struct xmesa_st_framebuffer *xstfb = xmesa_st_framebuffer(stfbi); bool ret; - ret = xmesa_st_framebuffer_display(stfbi, ST_ATTACHMENT_BACK_LEFT); + ret = xmesa_st_framebuffer_display(stfbi, NULL, ST_ATTACHMENT_BACK_LEFT); if (ret) { struct pipe_resource **front, **back, *tmp; @@ -378,7 +380,7 @@ xmesa_copy_st_framebuffer(struct st_framebuffer_iface *stfbi, { xmesa_st_framebuffer_copy_textures(stfbi, src, dst, x, y, w, h); if (dst == ST_ATTACHMENT_FRONT_LEFT) - xmesa_st_framebuffer_display(stfbi, dst); + xmesa_st_framebuffer_display(stfbi, NULL, dst); } diff --git a/src/gallium/frontends/va/surface.c b/src/gallium/frontends/va/surface.c index 2d9c05cefed..e95f604ef2c 100644 --- a/src/gallium/frontends/va/surface.c +++ b/src/gallium/frontends/va/surface.c @@ -381,7 +381,7 @@ vlVaPutSurface(VADriverContextP ctx, VASurfaceID surface_id, void* draw, short s */ drv->pipe->flush(drv->pipe, NULL, 0); - screen->flush_frontbuffer(screen, tex, 0, 0, + screen->flush_frontbuffer(screen, drv->pipe, tex, 0, 0, vscreen->get_private(vscreen), NULL); diff --git a/src/gallium/frontends/vdpau/presentation.c b/src/gallium/frontends/vdpau/presentation.c index 54f15ff34b1..41a626af120 100644 --- a/src/gallium/frontends/vdpau/presentation.c +++ b/src/gallium/frontends/vdpau/presentation.c @@ -268,7 +268,7 @@ vlVdpPresentationQueueDisplay(VdpPresentationQueue presentation_queue, // to back buffer so the texture can be copied in flush_frontbuffer pipe->screen->fence_reference(pipe->screen, &surf->fence, NULL); pipe->flush(pipe, &surf->fence, 0); - pipe->screen->flush_frontbuffer(pipe->screen, tex, 0, 0, + pipe->screen->flush_frontbuffer(pipe->screen, pipe, tex, 0, 0, vscreen->get_private(vscreen), NULL); pq->last_surf = surf; diff --git a/src/gallium/frontends/wgl/stw_framebuffer.c b/src/gallium/frontends/wgl/stw_framebuffer.c index f5260989478..359fd314526 100644 --- a/src/gallium/frontends/wgl/stw_framebuffer.c +++ b/src/gallium/frontends/wgl/stw_framebuffer.c @@ -497,7 +497,9 @@ BOOL APIENTRY DrvPresentBuffers(HDC hdc, LPPRESENTBUFFERS data) { struct stw_framebuffer *fb; + struct stw_context *ctx; struct pipe_screen *screen; + struct pipe_context *pipe; struct pipe_resource *res; if (!stw_dev) @@ -508,6 +510,8 @@ DrvPresentBuffers(HDC hdc, LPPRESENTBUFFERS data) return FALSE; screen = stw_dev->screen; + ctx = stw_current_context(); + pipe = ctx ? ctx->st->pipe : NULL; res = (struct pipe_resource *)data->pPrivData; @@ -536,7 +540,7 @@ DrvPresentBuffers(HDC hdc, LPPRESENTBUFFERS data) data->ullPresentToken); } else { - stw_dev->stw_winsys->present( screen, res, hdc ); + stw_dev->stw_winsys->present( screen, pipe, res, hdc ); } } @@ -587,8 +591,10 @@ stw_framebuffer_present_locked(HDC hdc, } else { struct pipe_screen *screen = stw_dev->screen; + struct stw_context *ctx = stw_current_context(); + struct pipe_context *pipe = ctx ? ctx->st->pipe : NULL; - stw_dev->stw_winsys->present( screen, res, hdc ); + stw_dev->stw_winsys->present( screen, pipe, res, hdc ); stw_framebuffer_update(fb); stw_notify_current_locked(fb); diff --git a/src/gallium/frontends/wgl/stw_winsys.h b/src/gallium/frontends/wgl/stw_winsys.h index 07a0729a7b8..9d5f6debe3c 100644 --- a/src/gallium/frontends/wgl/stw_winsys.h +++ b/src/gallium/frontends/wgl/stw_winsys.h @@ -74,6 +74,7 @@ struct stw_winsys */ void (*present)( struct pipe_screen *screen, + struct pipe_context *context, struct pipe_resource *res, HDC hDC ); diff --git a/src/gallium/frontends/xvmc/surface.c b/src/gallium/frontends/xvmc/surface.c index 03ee59482c6..66d31053f44 100644 --- a/src/gallium/frontends/xvmc/surface.c +++ b/src/gallium/frontends/xvmc/surface.c @@ -447,7 +447,7 @@ Status XvMCPutSurface(Display *dpy, XvMCSurface *surface, Drawable drawable, XVMC_MSG(XVMC_TRACE, "[XvMC] Submitted surface %p for display. Pushing to front buffer.\n", surface); - pipe->screen->flush_frontbuffer(pipe->screen, tex, 0, 0, + pipe->screen->flush_frontbuffer(pipe->screen, pipe, tex, 0, 0, vscreen->get_private(vscreen), NULL); if(dump_window == -1) { diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h index 54125e903d9..78dae7865b2 100644 --- a/src/gallium/include/pipe/p_screen.h +++ b/src/gallium/include/pipe/p_screen.h @@ -318,6 +318,7 @@ struct pipe_screen { * \param subbox an optional sub region to flush */ void (*flush_frontbuffer)( struct pipe_screen *screen, + struct pipe_context *ctx, struct pipe_resource *resource, unsigned level, unsigned layer, void *winsys_drawable_handle, diff --git a/src/gallium/targets/haiku-softpipe/GalliumContext.cpp b/src/gallium/targets/haiku-softpipe/GalliumContext.cpp index ead238194bf..b1be0635dff 100644 --- a/src/gallium/targets/haiku-softpipe/GalliumContext.cpp +++ b/src/gallium/targets/haiku-softpipe/GalliumContext.cpp @@ -342,7 +342,7 @@ GalliumContext::SwapBuffers(context_id contextID) return B_ERROR; } - fScreen->flush_frontbuffer(fScreen, surface->texture, 0, 0, + fScreen->flush_frontbuffer(fScreen, context->st->pipe, surface->texture, 0, 0, context->bitmap, NULL); return B_OK; diff --git a/src/gallium/targets/libgl-d3d12/libgl_d3d12.c b/src/gallium/targets/libgl-d3d12/libgl_d3d12.c index fa31e5c0e7d..981f1fca36b 100644 --- a/src/gallium/targets/libgl-d3d12/libgl_d3d12.c +++ b/src/gallium/targets/libgl-d3d12/libgl_d3d12.c @@ -64,10 +64,11 @@ no_winsys: static void gdi_present(struct pipe_screen *screen, + struct pipe_context *context, struct pipe_resource *res, HDC hDC) { - d3d12_wgl_present(screen, res, hDC); + d3d12_wgl_present(screen, context, res, hDC); } diff --git a/src/gallium/targets/libgl-gdi/libgl_gdi.c b/src/gallium/targets/libgl-gdi/libgl_gdi.c index 3619dfc6f3f..ee55da0558f 100644 --- a/src/gallium/targets/libgl-gdi/libgl_gdi.c +++ b/src/gallium/targets/libgl-gdi/libgl_gdi.c @@ -40,6 +40,7 @@ #include "stw_winsys.h" #include "stw_device.h" #include "gdi/gdi_sw_winsys.h" +#include "pipe/p_context.h" #ifdef GALLIUM_SOFTPIPE #include "softpipe/sp_texture.h" @@ -151,6 +152,7 @@ no_winsys: static void gdi_present(struct pipe_screen *screen, + struct pipe_context *ctx, struct pipe_resource *res, HDC hDC) { @@ -178,21 +180,21 @@ gdi_present(struct pipe_screen *screen, #ifdef GALLIUM_SWR if (use_swr) { - swr_gdi_swap(screen, res, hDC); + swr_gdi_swap(screen, ctx, res, hDC); return; } #endif #ifdef GALLIUM_D3D12 if (use_d3d12) { - d3d12_wgl_present(screen, res, hDC); + d3d12_wgl_present(screen, ctx, res, hDC); return; } #endif #ifdef GALLIUM_ZINK if (use_zink) { - screen->flush_frontbuffer(screen, res, 0, 0, hDC, NULL); + screen->flush_frontbuffer(screen, ctx, res, 0, 0, hDC, NULL); return; } #endif diff --git a/src/gallium/tests/graw/clear.c b/src/gallium/tests/graw/clear.c index 3c16f5211a6..d46b9c90cd0 100644 --- a/src/gallium/tests/graw/clear.c +++ b/src/gallium/tests/graw/clear.c @@ -33,7 +33,7 @@ static void draw( void ) graw_save_surface_to_file(ctx, surf, NULL); - screen->flush_frontbuffer(screen, tex, 0, 0, window, NULL); + screen->flush_frontbuffer(screen, ctx, tex, 0, 0, window, NULL); } static void init( void ) diff --git a/src/gallium/tests/graw/fs-test.c b/src/gallium/tests/graw/fs-test.c index 6eca0d54967..f0c93b18ada 100644 --- a/src/gallium/tests/graw/fs-test.c +++ b/src/gallium/tests/graw/fs-test.c @@ -238,7 +238,7 @@ static void draw( void ) graw_save_surface_to_file(ctx, surf, NULL); - screen->flush_frontbuffer(screen, rttex, 0, 0, window, NULL); + screen->flush_frontbuffer(screen, ctx, rttex, 0, 0, window, NULL); } #define SIZE 16 diff --git a/src/gallium/tests/graw/graw_util.h b/src/gallium/tests/graw/graw_util.h index 45c11659d0d..cbfacdb27fe 100644 --- a/src/gallium/tests/graw/graw_util.h +++ b/src/gallium/tests/graw/graw_util.h @@ -208,7 +208,7 @@ graw_util_viewport(struct graw_info *info, static inline void graw_util_flush_front(const struct graw_info *info) { - info->screen->flush_frontbuffer(info->screen, info->color_buf[0], + info->screen->flush_frontbuffer(info->screen, info->ctx, info->color_buf[0], 0, 0, info->window, NULL); } diff --git a/src/gallium/tests/graw/gs-test.c b/src/gallium/tests/graw/gs-test.c index 39d3737524d..bcbe8ad95af 100644 --- a/src/gallium/tests/graw/gs-test.c +++ b/src/gallium/tests/graw/gs-test.c @@ -328,7 +328,7 @@ static void draw( void ) graw_save_surface_to_file(ctx, surf, NULL); - screen->flush_frontbuffer(screen, rttex, 0, 0, window, NULL); + screen->flush_frontbuffer(screen, ctx, rttex, 0, 0, window, NULL); } #define SIZE 16 diff --git a/src/gallium/tests/graw/quad-sample.c b/src/gallium/tests/graw/quad-sample.c index 1164a2b2bbf..65d2917fbae 100644 --- a/src/gallium/tests/graw/quad-sample.c +++ b/src/gallium/tests/graw/quad-sample.c @@ -154,7 +154,7 @@ static void draw( void ) graw_save_surface_to_file(ctx, surf, NULL); - screen->flush_frontbuffer(screen, rttex, 0, 0, window, NULL); + screen->flush_frontbuffer(screen, ctx, rttex, 0, 0, window, NULL); } #define SIZE 16 diff --git a/src/gallium/tests/graw/shader-leak.c b/src/gallium/tests/graw/shader-leak.c index cc5cd8a4bcd..ba2e44af8b8 100644 --- a/src/gallium/tests/graw/shader-leak.c +++ b/src/gallium/tests/graw/shader-leak.c @@ -156,7 +156,7 @@ static void draw( void ) ctx->delete_fs_state(ctx, fs); } - screen->flush_frontbuffer(screen, tex, 0, 0, window, NULL); + screen->flush_frontbuffer(screen, ctx, tex, 0, 0, window, NULL); ctx->destroy(ctx); exit(0); diff --git a/src/gallium/tests/graw/tri-gs.c b/src/gallium/tests/graw/tri-gs.c index 97075f988ce..b0cdb33e52b 100644 --- a/src/gallium/tests/graw/tri-gs.c +++ b/src/gallium/tests/graw/tri-gs.c @@ -166,7 +166,7 @@ static void draw( void ) util_draw_arrays(ctx, PIPE_PRIM_TRIANGLES, 0, 3); ctx->flush(ctx, NULL, 0); - screen->flush_frontbuffer(screen, tex, 0, 0, window, NULL); + screen->flush_frontbuffer(screen, ctx, tex, 0, 0, window, NULL); } diff --git a/src/gallium/tests/graw/tri-instanced.c b/src/gallium/tests/graw/tri-instanced.c index a11286cc31f..a5cc3dc8106 100644 --- a/src/gallium/tests/graw/tri-instanced.c +++ b/src/gallium/tests/graw/tri-instanced.c @@ -218,7 +218,7 @@ static void draw( void ) graw_save_surface_to_file(ctx, surf, NULL); - screen->flush_frontbuffer(screen, tex, 0, 0, window, NULL); + screen->flush_frontbuffer(screen, ctx, tex, 0, 0, window, NULL); } diff --git a/src/gallium/tests/graw/vs-test.c b/src/gallium/tests/graw/vs-test.c index e634154dd1c..fb096354935 100644 --- a/src/gallium/tests/graw/vs-test.c +++ b/src/gallium/tests/graw/vs-test.c @@ -226,7 +226,7 @@ static void draw( void ) graw_save_surface_to_file(ctx, surf, NULL); - screen->flush_frontbuffer(screen, rttex, 0, 0, window, NULL); + screen->flush_frontbuffer(screen, ctx, rttex, 0, 0, window, NULL); } #define SIZE 16 diff --git a/src/gallium/winsys/d3d12/wgl/d3d12_wgl_public.h b/src/gallium/winsys/d3d12/wgl/d3d12_wgl_public.h index aa0191274ea..ac5f2c75476 100644 --- a/src/gallium/winsys/d3d12/wgl/d3d12_wgl_public.h +++ b/src/gallium/winsys/d3d12/wgl/d3d12_wgl_public.h @@ -32,6 +32,7 @@ extern "C" { struct pipe_resource; struct pipe_screen; +struct pipe_context; struct stw_winsys; struct pipe_screen * @@ -40,6 +41,7 @@ d3d12_wgl_create_screen(struct sw_winsys *winsys, void d3d12_wgl_present(struct pipe_screen *screen, + struct pipe_context *context, struct pipe_resource *res, HDC hDC); diff --git a/src/gallium/winsys/d3d12/wgl/d3d12_wgl_winsys.c b/src/gallium/winsys/d3d12/wgl/d3d12_wgl_winsys.c index cf098daa738..7a193cdef68 100644 --- a/src/gallium/winsys/d3d12/wgl/d3d12_wgl_winsys.c +++ b/src/gallium/winsys/d3d12/wgl/d3d12_wgl_winsys.c @@ -43,10 +43,11 @@ d3d12_wgl_create_screen(struct sw_winsys *winsys, HDC hDC) void d3d12_wgl_present(struct pipe_screen *screen, + struct pipe_context *ctx, struct pipe_resource *res, HDC hDC) { - screen->flush_frontbuffer(screen, res, 0, 0, hDC, NULL); + screen->flush_frontbuffer(screen, ctx, res, 0, 0, hDC, NULL); } unsigned