Skip to content
Snippets Groups Projects
Commit 65d69ce8 authored by David Parks's avatar David Parks
Browse files

DRTVWR-559 Fix for stall in probe occlusion culling and fix for culled...

DRTVWR-559 Fix for stall in probe occlusion culling and fix for culled neighbors getting sampled (badly).
parent 0336c1a0
No related branches found
No related tags found
2 merge requests!3Update to main branch,!2Rebase onto current main branch
...@@ -41,6 +41,14 @@ LLReflectionMap::LLReflectionMap() ...@@ -41,6 +41,14 @@ LLReflectionMap::LLReflectionMap()
{ {
} }
LLReflectionMap::~LLReflectionMap()
{
if (mOcclusionQuery)
{
glDeleteQueries(1, &mOcclusionQuery);
}
}
void LLReflectionMap::update(U32 resolution, U32 face) void LLReflectionMap::update(U32 resolution, U32 face)
{ {
LL_PROFILE_ZONE_SCOPED_CATEGORY_DISPLAY; LL_PROFILE_ZONE_SCOPED_CATEGORY_DISPLAY;
...@@ -276,18 +284,21 @@ void LLReflectionMap::doOcclusion(const LLVector4a& eye) ...@@ -276,18 +284,21 @@ void LLReflectionMap::doOcclusion(const LLVector4a& eye)
if (mOcclusionQuery == 0) if (mOcclusionQuery == 0)
{ // no query was previously issued, allocate one and issue { // no query was previously issued, allocate one and issue
LL_PROFILE_ZONE_NAMED_CATEGORY_PIPELINE("rmdo - glGenQueries");
glGenQueries(1, &mOcclusionQuery); glGenQueries(1, &mOcclusionQuery);
do_query = true; do_query = true;
} }
else else
{ // query was previously issued, check it and only issue a new query { // query was previously issued, check it and only issue a new query
// if previous query is available // if previous query is available
GLuint result = (GLuint) 0xFFFFFFFF; LL_PROFILE_ZONE_NAMED_CATEGORY_PIPELINE("rmdo - glGetQueryObject");
glGetQueryObjectuiv(mOcclusionQuery, GL_QUERY_RESULT_NO_WAIT, &result); GLuint result = 0;
glGetQueryObjectuiv(mOcclusionQuery, GL_QUERY_RESULT_AVAILABLE, &result);
if (result != (GLuint) 0xFFFFFFFF) if (result > 0)
{ {
do_query = true; do_query = true;
glGetQueryObjectuiv(mOcclusionQuery, GL_QUERY_RESULT, &result);
mOccluded = result == 0; mOccluded = result == 0;
mOcclusionPendingFrames = 0; mOcclusionPendingFrames = 0;
} }
...@@ -299,6 +310,7 @@ void LLReflectionMap::doOcclusion(const LLVector4a& eye) ...@@ -299,6 +310,7 @@ void LLReflectionMap::doOcclusion(const LLVector4a& eye)
if (do_query) if (do_query)
{ {
LL_PROFILE_ZONE_NAMED_CATEGORY_PIPELINE("rmdo - push query");
glBeginQuery(GL_ANY_SAMPLES_PASSED, mOcclusionQuery); glBeginQuery(GL_ANY_SAMPLES_PASSED, mOcclusionQuery);
LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr; LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
......
...@@ -39,6 +39,8 @@ class alignas(16) LLReflectionMap : public LLRefCount ...@@ -39,6 +39,8 @@ class alignas(16) LLReflectionMap : public LLRefCount
// allocate an environment map of the given resolution // allocate an environment map of the given resolution
LLReflectionMap(); LLReflectionMap();
~LLReflectionMap();
// update this environment map // update this environment map
// resolution - size of cube map to generate // resolution - size of cube map to generate
void update(U32 resolution, U32 face); void update(U32 resolution, U32 face);
......
...@@ -862,7 +862,7 @@ void LLReflectionMapManager::updateUniforms() ...@@ -862,7 +862,7 @@ void LLReflectionMapManager::updateUniforms()
} }
GLint idx = neighbor->mProbeIndex; GLint idx = neighbor->mProbeIndex;
if (idx == -1) if (idx == -1 || neighbor->mOccluded)
{ {
continue; continue;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment