mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
wait for occlusion
This commit is contained in:
parent
fe826af9b0
commit
9dbd150169
@ -62,9 +62,7 @@ is_answer_ready() const {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
void DXOcclusionQueryContext9::
|
void DXOcclusionQueryContext9::
|
||||||
waiting_for_answer() {
|
waiting_for_answer() {
|
||||||
DWORD result;
|
get_num_fragments();
|
||||||
PStatTimer timer(DXGraphicsStateGuardian9::_wait_occlusion_pcollector);
|
|
||||||
HRESULT hr = _query->GetData(&result, sizeof(result), D3DGETDATA_FLUSH);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -89,12 +87,16 @@ get_num_fragments() const {
|
|||||||
{
|
{
|
||||||
// The answer is not ready; this call will block.
|
// The answer is not ready; this call will block.
|
||||||
PStatTimer timer(DXGraphicsStateGuardian9::_wait_occlusion_pcollector);
|
PStatTimer timer(DXGraphicsStateGuardian9::_wait_occlusion_pcollector);
|
||||||
hr = _query->GetData(&result, sizeof(result), D3DGETDATA_FLUSH);
|
while (hr == S_FALSE) {
|
||||||
|
hr = _query->GetData(&result, sizeof(result), D3DGETDATA_FLUSH);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hr != S_OK) {
|
if (FAILED(hr)) {
|
||||||
// Some failure, e.g. devicelost. Return a nonzero value as a
|
// Some failure, e.g. devicelost. Return a nonzero value as a
|
||||||
// worst-case answer.
|
// worst-case answer.
|
||||||
|
dxgsg9_cat.info()
|
||||||
|
<< "occlusion query failed " << D3DERRORSTRING(hr);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user