Henri Verbeet : wined3d: Also update the container in wined3d_surface_update_desc().

Alexandre Julliard julliard at wine.codeweavers.com
Fri Aug 22 13:48:40 CDT 2014


Module: wine
Branch: master
Commit: 9f9731410bf79d3bee8b2ce16bee2a7f9962e0f2
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9f9731410bf79d3bee8b2ce16bee2a7f9962e0f2

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Fri Aug 22 12:32:00 2014 +0200

wined3d: Also update the container in wined3d_surface_update_desc().

This fixes a bug exposed by commit 415b8037206b1d4c104d9623037458739f6cfdf5.
In particular, wined3d_resource_update_draw_binding() uses the multisample
type to determine to appropriate draw binding, and since we never updated that
for the container, we could end up with an incorrect draw binding after a
device reset.

---

 dlls/wined3d/surface.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index b466524..1f96872 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2372,6 +2372,7 @@ HRESULT CDECL wined3d_surface_update_desc(struct wined3d_surface *surface,
     const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
     const struct wined3d_format *format = wined3d_get_format(gl_info, format_id);
     UINT resource_size = wined3d_format_calculate_size(format, device->surface_alignment, width, height, 1);
+    struct wined3d_texture *texture;
     BOOL create_dib = FALSE;
     HRESULT hr;
     DWORD valid_location = 0;
@@ -2448,6 +2449,13 @@ HRESULT CDECL wined3d_surface_update_desc(struct wined3d_surface *surface,
     if (surface->resource.map_binding == WINED3D_LOCATION_BUFFER && !surface_use_pbo(surface))
         surface->resource.map_binding = create_dib ? WINED3D_LOCATION_DIB : WINED3D_LOCATION_SYSMEM;
 
+    texture = surface->container;
+    texture->resource.format = format;
+    texture->resource.multisample_type = multisample_type;
+    texture->resource.multisample_quality = multisample_quality;
+    texture->resource.width = width;
+    texture->resource.height = height;
+
     if (create_dib)
     {
         if (FAILED(hr = surface_create_dib_section(surface)))




More information about the wine-cvs mailing list