From dcaa2903c3bb96e97bf679d0a721536aaa019a29 Mon Sep 17 00:00:00 2001 From: Mike Date: Mon, 5 Oct 2026 01:47:40 -0500 Subject: 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. --- indra/llrender/llrendertarget.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'indra/llrender/llrendertarget.cpp') 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; } -- cgit v1.3