From 7f403d3a07b0ba9cdd31cae90c73ab2a4518df12 Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Fri, 19 Apr 2024 11:30:04 -0400
Subject: [PATCH] Cleanup

---
 indra/newview/llreflectionmapmanager.cpp | 29 ++++++++++++------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp
index 61c74de56ff..66e0df44a3c 100644
--- a/indra/newview/llreflectionmapmanager.cpp
+++ b/indra/newview/llreflectionmapmanager.cpp
@@ -61,19 +61,7 @@ void load_exr(const std::string& filename)
 
     int ret = LoadEXR(&out, &width, &height, filename.c_str(), &err);
 
-    if (ret != TINYEXR_SUCCESS) 
-    {
-        LLSD notif_args;
-        notif_args["WHAT"] = filename;
-        notif_args["REASON"] = "Unknown";
-        if (err) 
-        {
-			notif_args["REASON"] = std::string(err);
-            FreeEXRErrorMessage(err); // release memory of error message.
-        }
-        LLNotificationsUtil::add("CannotLoad", notif_args);
-    }
-    else 
+    if (ret == TINYEXR_SUCCESS) 
     {
         U32 texName = 0;
         LLImageGL::generateTextures(1, &texName);
@@ -85,12 +73,25 @@ void load_exr(const std::string& filename)
 
         gGL.getTexUnit(0)->bind(gEXRImage);
 
-        glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F, width, height, 0, GL_RGBA, GL_FLOAT, out);
+        glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB16F, width, height, 0, GL_RGBA, GL_FLOAT, out);
         free(out); // release memory of image data
 
         glGenerateMipmap(GL_TEXTURE_2D);
 
         gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
+
+    }
+    else 
+    {
+        LLSD notif_args;
+        notif_args["WHAT"] = filename;
+        notif_args["REASON"] = "Unknown";
+        if (err) 
+        {
+			notif_args["REASON"] = std::string(err);
+            FreeEXRErrorMessage(err); // release memory of error message.
+        }
+        LLNotificationsUtil::add("CannotLoad", notif_args);
     }
 }
 
-- 
GitLab