[PATCH 1/5] wined3d: Set SFLAG_PIN_SYSMEM when the application tries to use surfaces that are currently mapped.
Henri Verbeet
hverbeet at codeweavers.com
Tue Jan 10 13:36:58 CST 2012
---
dlls/wined3d/surface.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 1ff5521..f2a09dc 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;
--
1.7.3.4
More information about the wine-patches
mailing list