summaryrefslogtreecommitdiff
path: root/indra/newview/llreflectionmap.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2023-02-22 11:01:18 -0600
committerDave Parks <davep@lindenlab.com>2023-02-22 11:01:18 -0600
commit65d69ce80dca112ea0bfd06f2749d4d6fcb366b4 (patch)
tree30c5e6f3ad1bc0b4d9ce32334695b0499fce434f /indra/newview/llreflectionmap.cpp
parent0336c1a06de89937d5c0f971e06270afc868ddfa (diff)
DRTVWR-559 Fix for stall in probe occlusion culling and fix for culled neighbors getting sampled (badly).
Diffstat (limited to 'indra/newview/llreflectionmap.cpp')
-rw-r--r--indra/newview/llreflectionmap.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/indra/newview/llreflectionmap.cpp b/indra/newview/llreflectionmap.cpp
index fb934da02e..37ad74e54d 100644
--- a/indra/newview/llreflectionmap.cpp
+++ b/indra/newview/llreflectionmap.cpp
@@ -41,6 +41,14 @@ LLReflectionMap::LLReflectionMap()
{
}
+LLReflectionMap::~LLReflectionMap()
+{
+ if (mOcclusionQuery)
+ {
+ glDeleteQueries(1, &mOcclusionQuery);
+ }
+}
+
void LLReflectionMap::update(U32 resolution, U32 face)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_DISPLAY;
@@ -276,18 +284,21 @@ void LLReflectionMap::doOcclusion(const LLVector4a& eye)
if (mOcclusionQuery == 0)
{ // no query was previously issued, allocate one and issue
+ LL_PROFILE_ZONE_NAMED_CATEGORY_PIPELINE("rmdo - glGenQueries");
glGenQueries(1, &mOcclusionQuery);
do_query = true;
}
else
{ // query was previously issued, check it and only issue a new query
// if previous query is available
- GLuint result = (GLuint) 0xFFFFFFFF;
- glGetQueryObjectuiv(mOcclusionQuery, GL_QUERY_RESULT_NO_WAIT, &result);
+ LL_PROFILE_ZONE_NAMED_CATEGORY_PIPELINE("rmdo - glGetQueryObject");
+ GLuint result = 0;
+ glGetQueryObjectuiv(mOcclusionQuery, GL_QUERY_RESULT_AVAILABLE, &result);
- if (result != (GLuint) 0xFFFFFFFF)
+ if (result > 0)
{
do_query = true;
+ glGetQueryObjectuiv(mOcclusionQuery, GL_QUERY_RESULT, &result);
mOccluded = result == 0;
mOcclusionPendingFrames = 0;
}
@@ -299,6 +310,7 @@ void LLReflectionMap::doOcclusion(const LLVector4a& eye)
if (do_query)
{
+ LL_PROFILE_ZONE_NAMED_CATEGORY_PIPELINE("rmdo - push query");
glBeginQuery(GL_ANY_SAMPLES_PASSED, mOcclusionQuery);
LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;