Prof-Butts / xwa_ddraw_d3d11

Direct3D 11 implementation of DDraw.dll for XWA with VR support and New Shaders
MIT License
6 stars 4 forks source link

D3D corruption due to _renderTargetViewSSAO_R being cleared when NULL #74

Closed morallo closed 1 year ago

morallo commented 1 year ago

In SSDOPass(), this buffer that is created only when SteamVR is used is always cleared. https://github.com/Prof-Butts/xwa_ddraw_d3d11/blob/132a5dd6ee601906661a6253cb6f557a042b22ed/impl11/ddraw/PrimarySurface.cpp#L2825

This causes a D3D corruption error visible when enabling the Direct3D debug layer:

D3D11 CORRUPTION: ID3D11DeviceContext::ClearRenderTargetView: First parameter is corrupt or NULL. [ MISCELLANEOUS CORRUPTION #13: CORRUPTED_PARAMETER1]
morallo commented 1 year ago

OK, this was my fault. The buffer should be always created, but I put it inside an if(g_bUseSteamVR) clause.