Add an explanation for the GetData while loop in GetVisibilityTestResult

This commit is contained in:
Voxel9 2019-12-23 20:10:45 +00:00
parent 1727b7e22b
commit fd2a0506af
1 changed files with 5 additions and 0 deletions

View File

@ -3324,6 +3324,11 @@ HRESULT WINAPI XTL::EMUPATCH(D3DDevice_GetVisibilityTestResult)
if (g_pVisibilityQuery != nullptr)
{
// In order to prevent an endless loop if the D3D device becomes lost, we pass
// the D3DGETDATA_FLUSH flag. This tells GetData to return D3DERR_DEVICELOST if
// such a situation occurs, and break out of the loop as a result.
// Note: By Cxbx's design, we cannot do drawing within this while loop in order
// to further prevent any other endless loop situations.
while (S_FALSE == g_pVisibilityQuery->GetData(pResult, sizeof(DWORD), D3DGETDATA_FLUSH));
}
else