wined3d: Don't use the old depth-stencil surface after decrementing its ref count.
This commit is contained in:
parent
4cdd01fc82
commit
342d2b8979
|
@ -5157,8 +5157,6 @@ HRESULT CDECL wined3d_device_set_depth_stencil(struct wined3d_device *device, st
|
||||||
device->fb.depth_stencil = depth_stencil;
|
device->fb.depth_stencil = depth_stencil;
|
||||||
if (depth_stencil)
|
if (depth_stencil)
|
||||||
wined3d_surface_incref(depth_stencil);
|
wined3d_surface_incref(depth_stencil);
|
||||||
if (prev)
|
|
||||||
wined3d_surface_decref(prev);
|
|
||||||
|
|
||||||
if (!prev != !depth_stencil)
|
if (!prev != !depth_stencil)
|
||||||
{
|
{
|
||||||
|
@ -5172,6 +5170,8 @@ HRESULT CDECL wined3d_device_set_depth_stencil(struct wined3d_device *device, st
|
||||||
{
|
{
|
||||||
device_invalidate_state(device, STATE_RENDER(WINED3DRS_DEPTHBIAS));
|
device_invalidate_state(device, STATE_RENDER(WINED3DRS_DEPTHBIAS));
|
||||||
}
|
}
|
||||||
|
if (prev)
|
||||||
|
wined3d_surface_decref(prev);
|
||||||
|
|
||||||
device_invalidate_state(device, STATE_FRAMEBUFFER);
|
device_invalidate_state(device, STATE_FRAMEBUFFER);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue