diff options
author | Dave Parks <davep@lindenlab.com> | 2023-02-27 10:42:53 -0600 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2023-02-27 10:42:53 -0600 |
commit | 4ec8844f012f27ddd0ab9aa6a3098273c7bb0ac1 (patch) | |
tree | 2c92393df0209ba5203d0d5d9da105834ecf5820 /indra/newview/llvieweroctree.cpp | |
parent | 61a6054e3ae4a9e63b6d96901ed8b4720205c3ed (diff) |
DRTVWR-559 Fix for occlusion culling going off the rails when settings change -- remove LLPipeline::resetVertexBuffers and add a sanity check to how long we wait for a query to be "available".
Diffstat (limited to 'indra/newview/llvieweroctree.cpp')
-rw-r--r-- | indra/newview/llvieweroctree.cpp | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/indra/newview/llvieweroctree.cpp b/indra/newview/llvieweroctree.cpp index 7d6c18ae67..d1d23cfb8e 100644 --- a/indra/newview/llvieweroctree.cpp +++ b/indra/newview/llvieweroctree.cpp @@ -870,6 +870,7 @@ LLOcclusionCullingGroup::LLOcclusionCullingGroup(OctreeNode* node, LLViewerOctre for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++) { mOcclusionQuery[i] = 0; + mOcclusionCheckCount[i] = 0; mOcclusionIssued[i] = 0; mOcclusionState[i] = parent ? SG_STATE_INHERIT_MASK & parent->mOcclusionState[i] : 0; mVisible[i] = 0; @@ -1127,10 +1128,12 @@ void LLOcclusionCullingGroup::checkOcclusion() { LL_PROFILE_ZONE_NAMED_CATEGORY_OCTREE("co - query available"); glGetQueryObjectuiv(mOcclusionQuery[LLViewerCamera::sCurCameraID], GL_QUERY_RESULT_AVAILABLE, &available); + mOcclusionCheckCount[LLViewerCamera::sCurCameraID]++; } - if (available) + if (available || mOcclusionCheckCount[LLViewerCamera::sCurCameraID] > 4) { + mOcclusionCheckCount[LLViewerCamera::sCurCameraID] = 0; GLuint query_result; // Will be # samples drawn, or a boolean depending on mHasOcclusionQuery2 (both are type GLuint) { LL_PROFILE_ZONE_NAMED_CATEGORY_OCTREE("co - query result"); @@ -1140,20 +1143,6 @@ void LLOcclusionCullingGroup::checkOcclusion() sPendingQueries.erase(mOcclusionQuery[LLViewerCamera::sCurCameraID]); #endif -#if 0 // (12/2021) occasional false-negative occlusion tests produce water reflection errors, SL-16461 - // If/when water occlusion queries become 100% reliable, re-enable this optimization - - if (LLPipeline::RENDER_TYPE_WATER == mSpatialPartition->mDrawableType) - { - // Note any unoccluded water, for deciding on reflection/distortion passes - // (If occlusion is disabled, these are set within LLDrawPoolWater::render) - if (query_result > 0) - { - LLDrawPoolWater::sNeedsReflectionUpdate = TRUE; - LLDrawPoolWater::sNeedsDistortionUpdate = TRUE; - } - } -#endif if (query_result > 0) { clearOcclusionState(LLOcclusionCullingGroup::OCCLUDED, LLOcclusionCullingGroup::STATE_MODE_DIFF); |