diff options
| author | Mike <contact@mikelittman.me> | 2026-10-22 12:20:17 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-10-23 00:20:17 +0800 |
| commit | 5b52af0bf830de6732bc587f5932c0209f6c337a (patch) | |
| tree | b9708b676d7d790951391abc24d289955834cc2e /indra/llrender | |
| parent | 32721d1421819fcd8ca0776421e147d59dad60ab (diff) | |
Fix remaining Apple audio, depth, and speaking-indicator crashes (#39)
Stop the OpenAL wind path from spinning when unqueue fails. Allocate
Apple depth buffers with the unsized format and skip deferred lighting
when that allocation left the target empty. Remove every registration
of a speaking indicator, including a null one.
Diffstat (limited to 'indra/llrender')
| -rw-r--r-- | indra/llrender/llrendertarget.cpp | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp index dcee340a71..0745397c3a 100644 --- a/indra/llrender/llrendertarget.cpp +++ b/indra/llrender/llrendertarget.cpp @@ -370,21 +370,39 @@ bool LLRenderTarget::addColorAttachment(U32 color_fmt) bool LLRenderTarget::allocateDepth() { LL_PROFILE_ZONE_SCOPED_CATEGORY_DISPLAY; + if (mResX == 0 || mResY == 0) + { + LL_WARNS() << "Unable to allocate depth buffer for render target " << mName + << ": size " << mResX << "x" << mResY << LL_ENDL; + return false; + } + LLImageGL::generateTextures(1, &mDepth); gGL.getTexUnit(0)->bindManual(mUsage, mDepth); U32 internal_type = LLTexUnit::getInternalType(mUsage); - LLImageGL::setManualImage(internal_type, 0, GL_DEPTH_COMPONENT24, mResX, mResY, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL, false); - gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT); - - sBytesAllocated += mResX*mResY*4; - - if (glGetError() != GL_NO_ERROR) + // Apple's GL rejects the sized GL_DEPTH_COMPONENT24 internal format + // with GL_UNSIGNED_INT. The unsized format is the one it allocates. +#if LL_DARWIN + const U32 depth_internal = GL_DEPTH_COMPONENT; +#else + const U32 depth_internal = GL_DEPTH_COMPONENT24; +#endif + glGetError(); + LLImageGL::setManualImage(internal_type, 0, depth_internal, mResX, mResY, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL, false); + GLenum err = glGetError(); + if (err != GL_NO_ERROR) { - LL_WARNS() << "Unable to allocate depth buffer for render target " << mName << LL_ENDL; + LL_WARNS() << "Unable to allocate depth buffer for render target " << mName + << " (" << mResX << "x" << mResY << ") gl error " << err << LL_ENDL; return false; } + gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT); + glGetError(); + + sBytesAllocated += mResX*mResY*4; + return true; } |
