From ef11af28d416b405d02649ae71117ed16353551a Mon Sep 17 00:00:00 2001
From: "Jonathan \"Geenz\" Goodman" <geenz@lindenlab.com>
Date: Fri, 8 Nov 2024 14:51:19 -0500
Subject: #2637 Revert to the previous alpha analysis to maintain legacy
 content parity. (#3061)

---
 indra/llrender/llimagegl.cpp | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

(limited to 'indra')

diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index 26e6aad770..04489ea78a 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -2179,15 +2179,15 @@ void LLImageGL::analyzeAlpha(const void* data_in, U32 w, U32 h)
     // this will mid-skew the data (and thus increase the chances of not
     // being used as a mask) from high-frequency alpha maps which
     // suffer the worst from aliasing when used as alpha masks.
-    if (w >= 4 && h >= 4)
+    if (w >= 2 && h >= 2)
     {
-        llassert(w%4 == 0);
-        llassert(h%4 == 0);
+        llassert(w % 2 == 0);
+        llassert(h % 2 == 0);
         const GLubyte* rowstart = ((const GLubyte*) data_in) + mAlphaOffset;
-        for (U32 y = 0; y < h; y+=4)
+        for (U32 y = 0; y < h; y += 2)
         {
             const GLubyte* current = rowstart;
-            for (U32 x = 0; x < w; x+=4)
+            for (U32 x = 0; x < w; x += 2)
             {
                 const U32 s1 = current[0];
                 alphatotal += s1;
@@ -2210,8 +2210,7 @@ void LLImageGL::analyzeAlpha(const void* data_in, U32 w, U32 h)
                 sample[asum/(16*4)] += 4;
             }
 
-
-            rowstart += 4 * w * mAlphaStride;
+            rowstart += 2 * w * mAlphaStride;
         }
         length *= 2; // we sampled everything twice, essentially
     }
-- 
cgit v1.2.3


From 13c0708cc70078e5118dd88de57d4ffd52f85024 Mon Sep 17 00:00:00 2001
From: Brad Linden <46733234+brad-linden@users.noreply.github.com>
Date: Fri, 8 Nov 2024 14:16:23 -0800
Subject: Attempt at fix for secondlife/viewer#2745 mac crash when app is in
 background (#3063)

once again disable RenderAppleUseMultGL and RenderGLMultiThreadedMedia
also added a tiny fix for missing processor vendor in crash reports
---
 indra/llcommon/llprocessor.cpp     |  3 ++-
 indra/newview/featuretable_mac.txt | 10 +++++-----
 2 files changed, 7 insertions(+), 6 deletions(-)

(limited to 'indra')

diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp
index 41ff369de2..a783e18e49 100644
--- a/indra/llcommon/llprocessor.cpp
+++ b/indra/llcommon/llprocessor.cpp
@@ -692,7 +692,8 @@ private:
         memset(cpu_vendor, 0, len);
         sysctlbyname("machdep.cpu.vendor", (void*)cpu_vendor, &len, NULL, 0);
         cpu_vendor[0x1f] = 0;
-        setInfo(eVendor, cpu_vendor);
+        // M series CPUs don't provide this field so if empty, just fall back to Apple.
+        setInfo(eVendor, (cpu_vendor[0] != '\0') ? cpu_vendor : "Apple");
 
         setInfo(eStepping, getSysctlInt("machdep.cpu.stepping"));
         setInfo(eModel, getSysctlInt("machdep.cpu.model"));
diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt
index 9ba922c3ce..c6edf427eb 100644
--- a/indra/newview/featuretable_mac.txt
+++ b/indra/newview/featuretable_mac.txt
@@ -1,4 +1,4 @@
-version 62
+version 63
 // The version number above should be incremented IF AND ONLY IF some
 // change has been made that is sufficiently important to justify
 // resetting the graphics preferences of all users to the recommended
@@ -68,8 +68,8 @@ RenderFSAASamples			1	3
 RenderMaxTextureIndex		1	16
 RenderGLContextCoreProfile         1   1
 RenderGLMultiThreadedTextures      1   0
-RenderGLMultiThreadedMedia         1   1
-RenderAppleUseMultGL        1   1
+RenderGLMultiThreadedMedia         1   0
+RenderAppleUseMultGL        1   0
 RenderReflectionsEnabled    1   1
 RenderReflectionProbeDetail	1	2
 RenderScreenSpaceReflections 1  1
@@ -408,8 +408,8 @@ RenderFSAASamples			1	0
 
 // AppleGPU and NonAppleGPU can be thought of as Apple silicon vs Intel Mac
 list AppleGPU
-RenderGLMultiThreadedMedia  1   1
-RenderAppleUseMultGL        1   1
+RenderGLMultiThreadedMedia  1   0
+RenderAppleUseMultGL        1   0
 
 list NonAppleGPU
 RenderGLMultiThreadedMedia  1   0
-- 
cgit v1.2.3