Commit 9f973141 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Also update the container in wined3d_surface_update_desc().

This fixes a bug exposed by commit 415b8037. 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.
parent ea1689e7
......@@ -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)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment