CD3D9Driver::reset() HRESULT check

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.

CD3D9Driver::reset() HRESULT check

Postby Qps » Wed Feb 29, 2012 1:15 pm

Hi

In CD3D9Driver::reset() the pID3DDevice is reset, i believe the check for the result isnt in the correct place.

I believe the code should be changed:

cpp Code: Select all
HRESULT hr = pID3DDevice->Reset(&present);
/* Code to be moved*/
if (FAILED(hr))
{
        /* All the error checks */
        return false;
}
 
/*Move the code here */


this way the function will return false before it can use the surfaces which might not be freed up.

In my situation the reset resulted in D3DERR_INVALIDCALL, but since the following line is above the error checking it throws an exception.
cpp Code: Select all
pID3DDevice->GetDepthStencilSurface(&(DepthBuffers[0]->Surface));
Qps
 
Posts: 18
Joined: Thu Jan 27, 2011 2:02 pm

Return to Bug reports

Who is online

Users browsing this forum: No registered users and 0 guests