From 45a0e9596215589acf3b781ae6979fa41d4be7b0 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Thu, 16 Jun 2011 22:38:25 +0200 Subject: [PATCH] wined3d: Only load the surface for partial updates in wined3d_device_update_surface(). --- dlls/wined3d/device.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 67c38aaeda0..03f57ff77a0 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4833,8 +4833,13 @@ HRESULT CDECL wined3d_device_update_surface(struct wined3d_device *device, checkGLcall("glActiveTextureARB"); LEAVE_GL(); - /* Make sure the surface is loaded and up to date */ - surface_load_location(dst_surface, SFLAG_INTEXTURE, NULL); + /* Only load the surface for partial updates. For newly allocated texture + * the texture wouldn't be the current location, and we'd upload zeroes + * just to overwrite them again. */ + if (update_w == dst_w && update_h == dst_h) + surface_prepare_texture(dst_surface, gl_info, FALSE); + else + surface_load_location(dst_surface, SFLAG_INTEXTURE, NULL); surface_bind(dst_surface, gl_info, FALSE); data.buffer_object = 0;