Commit 57119a1c authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Unbind framebuffer state in state_unbind_resources().

parent 50949c95
......@@ -1196,7 +1196,6 @@ void wined3d_device_uninit_3d(struct wined3d_device *device)
struct wined3d_resource *resource, *cursor;
struct wined3d_rendertarget_view *view;
struct wined3d_texture *texture;
unsigned int i;
TRACE("device %p.\n", device);
......@@ -1224,10 +1223,6 @@ void wined3d_device_uninit_3d(struct wined3d_device *device)
wined3d_cs_emit_reset_state(device->cs);
state_cleanup(state);
for (i = 0; i < device->adapter->d3d_info.limits.max_rt_count; ++i)
{
wined3d_device_set_rendertarget_view(device, i, NULL, FALSE);
}
wine_rb_clear(&device->samplers, device_free_sampler, NULL);
wine_rb_clear(&device->rasterizer_states, device_free_rasterizer_state, NULL);
......@@ -1243,14 +1238,6 @@ void wined3d_device_uninit_3d(struct wined3d_device *device)
device->adapter->adapter_ops->adapter_uninit_3d(device);
device->d3d_initialized = FALSE;
if ((view = state->fb.depth_stencil))
{
TRACE("Releasing depth/stencil view %p.\n", view);
state->fb.depth_stencil = NULL;
wined3d_rendertarget_view_decref(view);
}
if ((view = device->auto_depth_stencil_view))
{
device->auto_depth_stencil_view = NULL;
......
......@@ -374,6 +374,7 @@ void state_unbind_resources(struct wined3d_state *state)
struct wined3d_shader_resource_view *srv;
struct wined3d_vertex_declaration *decl;
struct wined3d_blend_state *blend_state;
struct wined3d_rendertarget_view *rtv;
struct wined3d_sampler *sampler;
struct wined3d_texture *texture;
struct wined3d_buffer *buffer;
......@@ -473,6 +474,21 @@ void state_unbind_resources(struct wined3d_state *state)
state->blend_state = NULL;
wined3d_blend_state_decref(blend_state);
}
for (i = 0; i < ARRAY_SIZE(state->fb.render_targets); ++i)
{
if ((rtv = state->fb.render_targets[i]))
{
state->fb.render_targets[i] = NULL;
wined3d_rendertarget_view_decref(rtv);
}
}
if ((rtv = state->fb.depth_stencil))
{
state->fb.depth_stencil = NULL;
wined3d_rendertarget_view_decref(rtv);
}
}
void wined3d_stateblock_state_cleanup(struct wined3d_stateblock_state *state)
......
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