wined3d: Unbind resources inside wined3d_device_reset().
This commit is contained in:
parent
c84112f86f
commit
44e109debe
|
@ -564,20 +564,10 @@ static HRESULT WINAPI IDirect3DDevice8Impl_Reset(IDirect3DDevice8 *iface,
|
|||
IDirect3DDevice8Impl *This = impl_from_IDirect3DDevice8(iface);
|
||||
WINED3DPRESENT_PARAMETERS localParameters;
|
||||
HRESULT hr;
|
||||
UINT i;
|
||||
|
||||
TRACE("iface %p, present_parameters %p.\n", iface, pPresentationParameters);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
wined3d_device_set_index_buffer(This->wined3d_device, NULL, WINED3DFMT_UNKNOWN);
|
||||
for (i = 0; i < 16; ++i)
|
||||
{
|
||||
wined3d_device_set_stream_source(This->wined3d_device, i, NULL, 0, 0);
|
||||
}
|
||||
for (i = 0; i < 16; ++i)
|
||||
{
|
||||
wined3d_device_set_texture(This->wined3d_device, i, NULL);
|
||||
}
|
||||
|
||||
localParameters.BackBufferWidth = pPresentationParameters->BackBufferWidth;
|
||||
localParameters.BackBufferHeight = pPresentationParameters->BackBufferHeight;
|
||||
|
|
|
@ -552,7 +552,6 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH IDirect3DDevice9Impl_Reset(IDirect3DDevi
|
|||
IDirect3DDevice9Impl *This = impl_from_IDirect3DDevice9Ex(iface);
|
||||
WINED3DPRESENT_PARAMETERS localParameters;
|
||||
HRESULT hr;
|
||||
UINT i;
|
||||
|
||||
TRACE("iface %p, present_parameters %p.\n", iface, pPresentationParameters);
|
||||
|
||||
|
@ -565,15 +564,6 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH IDirect3DDevice9Impl_Reset(IDirect3DDevi
|
|||
* below fails, the device is considered "lost", and _Reset and _Release are the only allowed calls
|
||||
*/
|
||||
wined3d_mutex_lock();
|
||||
wined3d_device_set_index_buffer(This->wined3d_device, NULL, WINED3DFMT_UNKNOWN);
|
||||
for (i = 0; i < 16; ++i)
|
||||
{
|
||||
wined3d_device_set_stream_source(This->wined3d_device, i, NULL, 0, 0);
|
||||
}
|
||||
for (i = 0; i < 16; ++i)
|
||||
{
|
||||
wined3d_device_set_texture(This->wined3d_device, i, NULL);
|
||||
}
|
||||
|
||||
localParameters.BackBufferWidth = pPresentationParameters->BackBufferWidth;
|
||||
localParameters.BackBufferHeight = pPresentationParameters->BackBufferHeight;
|
||||
|
|
|
@ -5624,10 +5624,21 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
|
|||
struct wined3d_swapchain *swapchain;
|
||||
BOOL DisplayModeChanged = FALSE;
|
||||
WINED3DDISPLAYMODE mode;
|
||||
unsigned int i;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("device %p, present_parameters %p.\n", device, present_parameters);
|
||||
|
||||
wined3d_device_set_index_buffer(device, NULL, WINED3DFMT_UNKNOWN);
|
||||
for (i = 0; i < MAX_STREAMS; ++i)
|
||||
{
|
||||
wined3d_device_set_stream_source(device, i, NULL, 0, 0);
|
||||
}
|
||||
for (i = 0; i < MAX_FRAGMENT_SAMPLERS; ++i)
|
||||
{
|
||||
wined3d_device_set_texture(device, i, NULL);
|
||||
}
|
||||
|
||||
LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry)
|
||||
{
|
||||
TRACE("Enumerating resource %p.\n", resource);
|
||||
|
|
Loading…
Reference in New Issue