From b55e3d82cfae2cb8370d1b929ae4bb1bf9941591 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Tue, 10 Jan 2012 20:36:58 +0100 Subject: [PATCH] wined3d: Set SFLAG_PIN_SYSMEM when the application tries to use surfaces that are currently mapped. --- dlls/wined3d/surface.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 1ff55211af..f2a09dc23a 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -2283,7 +2283,7 @@ static void surface_download_data(struct wined3d_surface *surface, const struct /* This call just uploads data, the caller is responsible for binding the * correct texture. */ /* Context activation is done by the caller. */ -static void surface_upload_data(const struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, +static void surface_upload_data(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, const struct wined3d_format *format, const RECT *src_rect, UINT src_pitch, const POINT *dst_point, BOOL srgb, const struct wined3d_bo_address *data) { @@ -2294,6 +2294,12 @@ static void surface_upload_data(const struct wined3d_surface *surface, const str surface, gl_info, debug_d3dformat(format->id), wine_dbgstr_rect(src_rect), src_pitch, wine_dbgstr_point(dst_point), srgb, data->buffer_object, data->addr); + if (surface->flags & SFLAG_LOCKED) + { + WARN("Uploading a surface that is currently mapped, setting SFLAG_PIN_SYSMEM.\n"); + surface->flags |= SFLAG_PIN_SYSMEM; + } + if (format->heightscale != 1.0f && format->heightscale != 0.0f) update_h *= format->heightscale; -- 2.32.0.93.g670b81a890