PeterTh / gedosato

The Generic DownSampling Tool
GNU General Public License v3.0
464 stars 166 forks source link

redirectGetDepthStencilSurface issues and possible fix #197

Open Boulotaur2024 opened 9 years ago

Boulotaur2024 commented 9 years ago

Reference link on GAF

Turns out the problem is related to redirectGetDepthStencilSurface. Commenting the following lines completely solve the issue described in the GAF thread :

HRESULT RSManagerDX9::redirectGetDepthStencilSurface(IDirect3DSurface9 **ppZStencilSurface) {
    if(downsampling && depthStencilSurf != NULL) {
        SDLOG(4, "redirectGetDepthStencilSurface\n");
        *ppZStencilSurface = depthStencilSurf;
        //(*ppZStencilSurface)->AddRef();
        //return D3D_OK;
    }
    return d3ddev->GetDepthStencilSurface(ppZStencilSurface);
}

But that may not be very clean I don't know. That's why I'm not submitting it as a fix. I'll try to play the game a bit to see if I don't get a huge memory leak with the above hack. (It kinda reminds me of the L.A noire thingy)

Boulotaur2024 commented 9 years ago

I should have mentionned that "depthStencilSurf" is properly created earlier (in initResources) and set to the device (I logged both operations and they both returned D3D_OK). It's a regular D24S8 depth texture. I'm confused as to how it can cause so many issues here

EDIT : other than that I've been running Gedo for 3 days with the above hack and I've had no issue at all