diff options
| author | Mike <contact@mikelittman.me> | 2026-10-05 01:47:40 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-10-05 14:47:40 +0800 |
| commit | dcaa2903c3bb96e97bf679d0a721536aaa019a29 (patch) | |
| tree | d41feecf98a8d4b6aa812e47b5304209aa183703 /indra/llrender/llrendertarget.cpp | |
| parent | 62e2d529558ba086708025b394aa790e49076c77 (diff) | |
Avoid the Apple OpenGL null-fence crash during precache (#30)
glDeleteBuffers and glWaitSync on a failed fence both fault in
GLDFenceRec::getStatus on Apple's GL/Metal translator. Finish and
unbind before deleting buffers, skip a null upload fence, and resize
depth targets with the unsized format Apple accepts.
Diffstat (limited to 'indra/llrender/llrendertarget.cpp')
| -rw-r--r-- | indra/llrender/llrendertarget.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp index ebdc609f94..dcee340a71 100644 --- a/indra/llrender/llrendertarget.cpp +++ b/indra/llrender/llrendertarget.cpp @@ -95,7 +95,15 @@ void LLRenderTarget::resize(U32 resx, U32 resy) { 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); + // Apple's GL rejects sized GL_DEPTH_COMPONENT24 with GL_UNSIGNED_INT. +#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); + glGetError(); sBytesAllocated += pix_diff*4; } |
