mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-29 00:05:40 +00:00
prevents an infinite while loop by putting a cap of 4MS on occlusion queries.
This commit is contained in:
parent
8390c4159f
commit
4f3be25699
3 changed files with 14 additions and 3 deletions
|
|
@ -124,9 +124,16 @@ GFXD3D9OcclusionQuery::OcclusionQueryStatus GFXD3D9OcclusionQuery::getStatus( bo
|
|||
DWORD dwOccluded = 0;
|
||||
|
||||
if ( block )
|
||||
{
|
||||
{
|
||||
while( ( hRes = mQuery->GetData( &dwOccluded, sizeof(DWORD), D3DGETDATA_FLUSH ) ) == S_FALSE )
|
||||
;
|
||||
{
|
||||
//If we're stalled out, proceed with worst-case scenario -BJR
|
||||
if(GFX->mFrameTime->getElapsedMs()>4)
|
||||
{
|
||||
this->end();
|
||||
return NotOccluded;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue