Merge branch 'release/2024.12-ForeverFPS' of https://github.com/secondlife/viewer

# Conflicts:
#	indra/llcommon/llerror.cpp
#	indra/llmath/v4math.h
#	indra/llui/lltransutil.cpp
#	indra/newview/llface.cpp
#	indra/newview/llstartup.cpp
#	indra/newview/llvovolume.cpp
master
Ansariel 2025-01-26 00:07:35 +01:00
commit 8758495d11
35 changed files with 447 additions and 154 deletions

View File

@ -1622,11 +1622,11 @@ namespace LLError
std::string LLUserWarningMsg::sLocalizedOutOfMemoryWarning; std::string LLUserWarningMsg::sLocalizedOutOfMemoryWarning;
LLUserWarningMsg::Handler LLUserWarningMsg::sHandler; LLUserWarningMsg::Handler LLUserWarningMsg::sHandler;
void LLUserWarningMsg::show(const std::string& message) void LLUserWarningMsg::show(const std::string& message, S32 error_code)
{ {
if (sHandler) if (sHandler)
{ {
sHandler(std::string(), message); sHandler(std::string(), message, error_code);
} }
} }
@ -1634,7 +1634,7 @@ namespace LLError
{ {
if (sHandler && !sLocalizedOutOfMemoryTitle.empty()) if (sHandler && !sLocalizedOutOfMemoryTitle.empty())
{ {
sHandler(sLocalizedOutOfMemoryTitle, sLocalizedOutOfMemoryWarning); sHandler(sLocalizedOutOfMemoryTitle, sLocalizedOutOfMemoryWarning, ERROR_BAD_ALLOC);
} }
} }
@ -1645,7 +1645,7 @@ namespace LLError
"Firestorm couldn't access some of the files it needs and will be closed." "Firestorm couldn't access some of the files it needs and will be closed."
"\n\nPlease reinstall viewer from https://www.firestormviewer.org/download and " "\n\nPlease reinstall viewer from https://www.firestormviewer.org/download and "
"contact https://www.firestormviewer.org/support if issue persists after reinstall."; "contact https://www.firestormviewer.org/support if issue persists after reinstall.";
sHandler("Missing Files", error_string); sHandler("Missing Files", error_string, ERROR_MISSING_FILES);
} }
void LLUserWarningMsg::setHandler(const LLUserWarningMsg::Handler &handler) void LLUserWarningMsg::setHandler(const LLUserWarningMsg::Handler &handler)

View File

@ -320,7 +320,15 @@ namespace LLError
class LLUserWarningMsg class LLUserWarningMsg
{ {
public: public:
typedef std::function<void(const std::string&, const std::string&)> Handler; typedef enum
{
ERROR_OTHER = 0,
ERROR_BAD_ALLOC = 1,
ERROR_MISSING_FILES = 2,
} eLastExecEvent;
// tittle, message and error code to include in error marker file
typedef std::function<void(const std::string&, const std::string&, S32 error_code)> Handler;
static void setHandler(const Handler&); static void setHandler(const Handler&);
static void setOutOfMemoryStrings(const std::string& title, const std::string& message); static void setOutOfMemoryStrings(const std::string& title, const std::string& message);
@ -328,7 +336,7 @@ namespace LLError
static void showOutOfMemory(); static void showOutOfMemory();
static void showMissingFiles(); static void showMissingFiles();
// Genering error // Genering error
static void show(const std::string&); static void show(const std::string&, S32 error_code = -1);
private: private:
// needs to be preallocated before viewer runs out of memory // needs to be preallocated before viewer runs out of memory

View File

@ -996,7 +996,7 @@ void LLInventoryItem::asLLSD( LLSD& sd ) const
} }
//sd[INV_FLAGS_LABEL] = (S32)mFlags; //sd[INV_FLAGS_LABEL] = (S32)mFlags;
sd[INV_FLAGS_LABEL] = ll_sd_from_U32(mFlags); sd[INV_FLAGS_LABEL] = ll_sd_from_U32(mFlags);
sd[INV_SALE_INFO_LABEL] = mSaleInfo; sd[INV_SALE_INFO_LABEL] = mSaleInfo.asLLSD();
sd[INV_NAME_LABEL] = mName; sd[INV_NAME_LABEL] = mName;
sd[INV_DESC_LABEL] = mDescription; sd[INV_DESC_LABEL] = mDescription;
sd[INV_CREATION_DATE_LABEL] = (S32) mCreationDate; sd[INV_CREATION_DATE_LABEL] = (S32) mCreationDate;

View File

@ -89,8 +89,14 @@ bool LLSaleInfo::exportLegacyStream(std::ostream& output_stream) const
LLSD LLSaleInfo::asLLSD() const LLSD LLSaleInfo::asLLSD() const
{ {
LLSD sd = LLSD(); LLSD sd;
sd["sale_type"] = lookup(mSaleType); const char* type = lookup(mSaleType);
if (!type)
{
LL_WARNS_ONCE() << "Unknown sale type: " << mSaleType << LL_ENDL;
type = lookup(LLSaleInfo::FS_NOT);
}
sd["sale_type"] = type;
sd["sale_price"] = mSalePrice; sd["sale_price"] = mSalePrice;
return sd; return sd;
} }

View File

@ -33,6 +33,9 @@ class LLRotation;
#include <assert.h> #include <assert.h>
#include "llpreprocessor.h" #include "llpreprocessor.h"
#include "llmemory.h" #include "llmemory.h"
#include "glm/vec3.hpp"
#include "glm/vec4.hpp"
#include "glm/gtc/type_ptr.hpp"
/////////////////////////////////// ///////////////////////////////////
// FIRST TIME USERS PLEASE READ // FIRST TIME USERS PLEASE READ
@ -364,6 +367,16 @@ public:
inline operator LLQuad() const; inline operator LLQuad() const;
explicit inline operator glm::vec3() const
{
return glm::make_vec3(getF32ptr());
};
explicit inline operator glm::vec4() const
{
return glm::make_vec4(getF32ptr());
};
private: private:
LLQuad mQ{}; LLQuad mQ{};
}; };

View File

@ -31,6 +31,11 @@
#include "llmath.h" #include "llmath.h"
#include "llsd.h" #include "llsd.h"
#include "glm/vec3.hpp"
#include "glm/vec4.hpp"
#include "glm/gtc/type_ptr.hpp"
class LLVector2; class LLVector2;
class LLVector4; class LLVector4;
class LLVector4a; class LLVector4a;
@ -66,6 +71,11 @@ class LLVector3
explicit LLVector3(const LLVector4a& vec); // Initializes LLVector4 to (vec[0]. vec[1], vec[2]) explicit LLVector3(const LLVector4a& vec); // Initializes LLVector4 to (vec[0]. vec[1], vec[2])
explicit LLVector3(const LLSD& sd); explicit LLVector3(const LLSD& sd);
// GLM interop
explicit LLVector3(const glm::vec3& vec); // Initializes LLVector3 to (vec[0]. vec[1], vec[2])
explicit LLVector3(const glm::vec4& vec); // Initializes LLVector3 to (vec[0]. vec[1], vec[2])
explicit inline operator glm::vec3() const; // Initializes glm::vec3 to (vec[0]. vec[1], vec[2])
explicit inline operator glm::vec4() const; // Initializes glm::vec4 to (vec[0]. vec[1], vec[2], 1)
LLSD getValue() const; LLSD getValue() const;
@ -92,6 +102,8 @@ class LLVector3
inline void set(const F32 *vec); // Sets LLVector3 to vec inline void set(const F32 *vec); // Sets LLVector3 to vec
const LLVector3& set(const LLVector4 &vec); const LLVector3& set(const LLVector4 &vec);
const LLVector3& set(const LLVector3d &vec);// Sets LLVector3 to vec const LLVector3& set(const LLVector3d &vec);// Sets LLVector3 to vec
inline void set(const glm::vec4& vec); // Sets LLVector3 to vec
inline void set(const glm::vec3& vec); // Sets LLVector3 to vec
inline void setVec(F32 x, F32 y, F32 z); // deprecated inline void setVec(F32 x, F32 y, F32 z); // deprecated
inline void setVec(const LLVector3 &vec); // deprecated inline void setVec(const LLVector3 &vec); // deprecated
@ -190,6 +202,20 @@ inline LLVector3::LLVector3(const F32 *vec)
mV[VZ] = vec[VZ]; mV[VZ] = vec[VZ];
} }
inline LLVector3::LLVector3(const glm::vec3& vec)
{
mV[VX] = vec.x;
mV[VY] = vec.y;
mV[VZ] = vec.z;
}
inline LLVector3::LLVector3(const glm::vec4& vec)
{
mV[VX] = vec.x;
mV[VY] = vec.y;
mV[VZ] = vec.z;
}
/* /*
inline LLVector3::LLVector3(const LLVector3 &copy) inline LLVector3::LLVector3(const LLVector3 &copy)
{ {
@ -259,6 +285,20 @@ inline void LLVector3::set(const F32 *vec)
mV[2] = vec[2]; mV[2] = vec[2];
} }
inline void LLVector3::set(const glm::vec4& vec)
{
mV[VX] = vec.x;
mV[VY] = vec.y;
mV[VZ] = vec.z;
}
inline void LLVector3::set(const glm::vec3& vec)
{
mV[VX] = vec.x;
mV[VY] = vec.y;
mV[VZ] = vec.z;
}
// deprecated // deprecated
inline void LLVector3::setVec(F32 x, F32 y, F32 z) inline void LLVector3::setVec(F32 x, F32 y, F32 z)
{ {
@ -471,6 +511,17 @@ inline LLVector3 operator-(const LLVector3 &a)
return LLVector3( -a.mV[0], -a.mV[1], -a.mV[2] ); return LLVector3( -a.mV[0], -a.mV[1], -a.mV[2] );
} }
inline LLVector3::operator glm::vec3() const
{
// Do not use glm::make_vec3 it can result in a buffer overrun on some platforms due to glm::vec3 being a simd vector internally
return glm::vec3(mV[VX], mV[VY], mV[VZ]);
}
inline LLVector3::operator glm::vec4() const
{
return glm::vec4(mV[VX], mV[VY], mV[VZ], 1.f);
}
inline F32 dist_vec(const LLVector3 &a, const LLVector3 &b) inline F32 dist_vec(const LLVector3 &a, const LLVector3 &b)
{ {
F32 x = a.mV[0] - b.mV[0]; F32 x = a.mV[0] - b.mV[0];

View File

@ -32,6 +32,10 @@
#include "v3math.h" #include "v3math.h"
#include "v2math.h" #include "v2math.h"
#include "glm/vec3.hpp"
#include "glm/vec4.hpp"
#include "glm/gtc/type_ptr.hpp"
class LLMatrix3; class LLMatrix3;
class LLMatrix4; class LLMatrix4;
class LLQuaternion; class LLQuaternion;
@ -73,6 +77,11 @@ class LLVector4
mV[3] = (F32)sd[3].asReal(); mV[3] = (F32)sd[3].asReal();
} }
// GLM interop
explicit LLVector4(const glm::vec3& vec); // Initializes LLVector4 to (vec, 1)
explicit LLVector4(const glm::vec4& vec); // Initializes LLVector4 to vec
explicit operator glm::vec3() const; // Initializes glm::vec3 to (vec[0]. vec[1], vec[2])
explicit operator glm::vec4() const; // Initializes glm::vec4 to (vec[0]. vec[1], vec[2], vec[3])
inline bool isFinite() const; // checks to see if all values of LLVector3 are finite inline bool isFinite() const; // checks to see if all values of LLVector3 are finite
@ -85,6 +94,8 @@ class LLVector4
inline void set(const LLVector4 &vec); // Sets LLVector4 to vec inline void set(const LLVector4 &vec); // Sets LLVector4 to vec
inline void set(const LLVector3 &vec, F32 w = 1.f); // Sets LLVector4 to LLVector3 vec inline void set(const LLVector3 &vec, F32 w = 1.f); // Sets LLVector4 to LLVector3 vec
inline void set(const F32 *vec); // Sets LLVector4 to vec inline void set(const F32 *vec); // Sets LLVector4 to vec
inline void set(const glm::vec4& vec); // Sets LLVector4 to vec
inline void set(const glm::vec3& vec, F32 w = 1.f); // Sets LLVector4 to LLVector3 vec with w defaulted to 1
inline void setVec(F32 x, F32 y, F32 z); // deprecated inline void setVec(F32 x, F32 y, F32 z); // deprecated
inline void setVec(F32 x, F32 y, F32 z, F32 w); // deprecated inline void setVec(F32 x, F32 y, F32 z, F32 w); // deprecated
@ -223,6 +234,21 @@ inline LLVector4::LLVector4(const LLSD &sd)
setValue(sd); setValue(sd);
} }
inline LLVector4::LLVector4(const glm::vec3& vec)
{
mV[VX] = vec.x;
mV[VY] = vec.y;
mV[VZ] = vec.z;
mV[VW] = 1.f;
}
inline LLVector4::LLVector4(const glm::vec4& vec)
{
mV[VX] = vec.x;
mV[VY] = vec.y;
mV[VZ] = vec.z;
mV[VW] = vec.w;
}
inline bool LLVector4::isFinite() const inline bool LLVector4::isFinite() const
{ {
@ -297,6 +323,21 @@ inline void LLVector4::set(const F32 *vec)
mV[VW] = vec[VW]; mV[VW] = vec[VW];
} }
inline void LLVector4::set(const glm::vec4& vec)
{
mV[VX] = vec.x;
mV[VY] = vec.y;
mV[VZ] = vec.z;
mV[VW] = vec.w;
}
inline void LLVector4::set(const glm::vec3& vec, F32 w)
{
mV[VX] = vec.x;
mV[VY] = vec.y;
mV[VZ] = vec.z;
mV[VW] = w;
}
// deprecated // deprecated
inline void LLVector4::setVec(F32 x, F32 y, F32 z) inline void LLVector4::setVec(F32 x, F32 y, F32 z)
@ -473,6 +514,16 @@ inline bool operator<(const LLVector4& lhs, const LLVector4& rhs)
} }
// [/RLVa:KB] // [/RLVa:KB]
inline LLVector4::operator glm::vec3() const
{
return glm::vec3(mV[VX], mV[VY], mV[VZ]);
}
inline LLVector4::operator glm::vec4() const
{
return glm::make_vec4(mV);
}
inline F32 dist_vec(const LLVector4 &a, const LLVector4 &b) inline F32 dist_vec(const LLVector4 &a, const LLVector4 &b)
{ {
LLVector4 vec = a - b; LLVector4 vec = a - b;

View File

@ -737,9 +737,8 @@ void LLLightState::setPosition(const LLVector4& position)
++gGL.mLightHash; ++gGL.mLightHash;
mPosition = position; mPosition = position;
//transform position by current modelview matrix //transform position by current modelview matrix
glm::vec4 pos(glm::make_vec4(position.mV)); glm::vec4 pos(position);
const glm::mat4& mat = gGL.getModelviewMatrix(); pos = gGL.getModelviewMatrix() * pos;
pos = mat * pos;
mPosition.set(glm::value_ptr(pos)); mPosition.set(glm::value_ptr(pos));
} }
@ -794,7 +793,7 @@ void LLLightState::setSpotDirection(const LLVector3& direction)
++gGL.mLightHash; ++gGL.mLightHash;
//transform direction by current modelview matrix //transform direction by current modelview matrix
glm::vec3 dir(glm::make_vec3(direction.mV)); glm::vec3 dir(direction);
const glm::mat3 mat(gGL.getModelviewMatrix()); const glm::mat3 mat(gGL.getModelviewMatrix());
dir = mat * dir; dir = mat * dir;
@ -2129,12 +2128,14 @@ void set_last_projection(const glm::mat4& mat)
glm::vec3 mul_mat4_vec3(const glm::mat4& mat, const glm::vec3& vec) glm::vec3 mul_mat4_vec3(const glm::mat4& mat, const glm::vec3& vec)
{ {
//const float w = vec[0] * mat[0][3] + vec[1] * mat[1][3] + vec[2] * mat[2][3] + mat[3][3]; #if 1 // SIMD path results in strange crashes. Fall back to scalar for now.
//return glm::vec3( const float w = vec[0] * mat[0][3] + vec[1] * mat[1][3] + vec[2] * mat[2][3] + mat[3][3];
// (vec[0] * mat[0][0] + vec[1] * mat[1][0] + vec[2] * mat[2][0] + mat[3][0]) / w, return glm::vec3(
// (vec[0] * mat[0][1] + vec[1] * mat[1][1] + vec[2] * mat[2][1] + mat[3][1]) / w, (vec[0] * mat[0][0] + vec[1] * mat[1][0] + vec[2] * mat[2][0] + mat[3][0]) / w,
// (vec[0] * mat[0][2] + vec[1] * mat[1][2] + vec[2] * mat[2][2] + mat[3][2]) / w (vec[0] * mat[0][1] + vec[1] * mat[1][1] + vec[2] * mat[2][1] + mat[3][1]) / w,
//); (vec[0] * mat[0][2] + vec[1] * mat[1][2] + vec[2] * mat[2][2] + mat[3][2]) / w
);
#else
LLVector4a x, y, z, s, t, p, q; LLVector4a x, y, z, s, t, p, q;
x.splat(vec.x); x.splat(vec.x);
@ -2164,4 +2165,5 @@ glm::vec3 mul_mat4_vec3(const glm::mat4& mat, const glm::vec3& vec)
res.setAdd(x, z); res.setAdd(x, z);
res.div(q); res.div(q);
return glm::make_vec3(res.getF32ptr()); return glm::make_vec3(res.getF32ptr());
#endif
} }

View File

@ -472,6 +472,7 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev
if (filename.empty()) if (filename.empty())
{ {
LL_WARNS("ShaderLoading") << "tried loading empty filename" << LL_ENDL;
return 0; return 0;
} }
@ -929,6 +930,8 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev
} }
LL_WARNS("ShaderLoading") << "Failed to load " << filename << LL_ENDL; LL_WARNS("ShaderLoading") << "Failed to load " << filename << LL_ENDL;
} }
LL_DEBUGS("ShaderLoading") << "loadShaderFile() completed, ret: " << U32(ret) << LL_ENDL;
return ret; return ret;
} }

View File

@ -1563,7 +1563,7 @@ bool LLNotifications::loadTemplates()
gDirUtilp->findSkinnedFilenames(LLDir::XUI, "notifications.xml", LLDir::ALL_SKINS); gDirUtilp->findSkinnedFilenames(LLDir::XUI, "notifications.xml", LLDir::ALL_SKINS);
if (search_paths.empty()) if (search_paths.empty())
{ {
LLError::LLUserWarningMsg::show(LLTrans::getString("MBMissingFile")); LLError::LLUserWarningMsg::show(LLTrans::getString("MBMissingFile"), LLError::LLUserWarningMsg::ERROR_MISSING_FILES);
LL_ERRS() << "Problem finding notifications.xml" << LL_ENDL; LL_ERRS() << "Problem finding notifications.xml" << LL_ENDL;
} }
@ -1573,7 +1573,7 @@ bool LLNotifications::loadTemplates()
if (!success || root.isNull() || !root->hasName( "notifications" )) if (!success || root.isNull() || !root->hasName( "notifications" ))
{ {
LLError::LLUserWarningMsg::show(LLTrans::getString("MBMissingFile")); LLError::LLUserWarningMsg::show(LLTrans::getString("MBMissingFile"), LLError::LLUserWarningMsg::ERROR_MISSING_FILES);
LL_ERRS() << "Problem reading XML from UI Notifications file: " << base_filename << LL_ENDL; LL_ERRS() << "Problem reading XML from UI Notifications file: " << base_filename << LL_ENDL;
return false; return false;
} }
@ -1584,7 +1584,7 @@ bool LLNotifications::loadTemplates()
if(!params.validateBlock()) if(!params.validateBlock())
{ {
LLError::LLUserWarningMsg::show(LLTrans::getString("MBMissingFile")); LLError::LLUserWarningMsg::show(LLTrans::getString("MBMissingFile"), LLError::LLUserWarningMsg::ERROR_MISSING_FILES);
LL_ERRS() << "Problem reading XUI from UI Notifications file: " << base_filename << LL_ENDL; LL_ERRS() << "Problem reading XUI from UI Notifications file: " << base_filename << LL_ENDL;
return false; return false;
} }
@ -1651,7 +1651,7 @@ bool LLNotifications::loadVisibilityRules()
if(!params.validateBlock()) if(!params.validateBlock())
{ {
LLError::LLUserWarningMsg::show(LLTrans::getString("MBMissingFile")); LLError::LLUserWarningMsg::show(LLTrans::getString("MBMissingFile"), LLError::LLUserWarningMsg::ERROR_MISSING_FILES);
LL_ERRS() << "Problem reading UI Notification Visibility Rules file: " << full_filename << LL_ENDL; LL_ERRS() << "Problem reading UI Notification Visibility Rules file: " << full_filename << LL_ENDL;
return false; return false;
} }

View File

@ -48,7 +48,7 @@ bool LLTransUtil::parseStrings(const std::string& xml_filename, const std::set<s
"Firestorm couldn't access some of the files it needs and will be closed." "Firestorm couldn't access some of the files it needs and will be closed."
"\n\nPlease reinstall viewer from https://www.firestormviewer.org/download and " "\n\nPlease reinstall viewer from https://www.firestormviewer.org/download and "
"contact https://www.firestormviewer.org/support if issue persists after reinstall."; "contact https://www.firestormviewer.org/support if issue persists after reinstall.";
LLError::LLUserWarningMsg::show(error_string); LLError::LLUserWarningMsg::show(error_string, LLError::LLUserWarningMsg::ERROR_MISSING_FILES);
gDirUtilp->dumpCurrentDirectories(LLError::LEVEL_WARN); gDirUtilp->dumpCurrentDirectories(LLError::LEVEL_WARN);
LL_ERRS() << "Couldn't load string table " << xml_filename << ". Please reinstall viewer from https://www.firestormviewer.org/download and contact https://www.firestormviewer.org/support if issue persists after reinstall." << LL_ENDL; LL_ERRS() << "Couldn't load string table " << xml_filename << ". Please reinstall viewer from https://www.firestormviewer.org/download and contact https://www.firestormviewer.org/support if issue persists after reinstall." << LL_ENDL;
return false; return false;

View File

@ -1320,8 +1320,7 @@ bool LLWindowWin32::switchContext(bool fullscreen, const LLCoordScreen& size, bo
catch (...) catch (...)
{ {
LOG_UNHANDLED_EXCEPTION("ChoosePixelFormat"); LOG_UNHANDLED_EXCEPTION("ChoosePixelFormat");
OSMessageBox(mCallbacks->translateString("MBPixelFmtErr"), LLError::LLUserWarningMsg::show(mCallbacks->translateString("MBPixelFmtErr"), 8/*LAST_EXEC_GRAPHICS_INIT*/);
mCallbacks->translateString("MBError"), OSMB_OK);
close(); close();
return false; return false;
} }
@ -1332,8 +1331,7 @@ bool LLWindowWin32::switchContext(bool fullscreen, const LLCoordScreen& size, bo
if (!DescribePixelFormat(mhDC, pixel_format, sizeof(PIXELFORMATDESCRIPTOR), if (!DescribePixelFormat(mhDC, pixel_format, sizeof(PIXELFORMATDESCRIPTOR),
&pfd)) &pfd))
{ {
OSMessageBox(mCallbacks->translateString("MBPixelFmtDescErr"), LLError::LLUserWarningMsg::show(mCallbacks->translateString("MBPixelFmtDescErr"), 8/*LAST_EXEC_GRAPHICS_INIT*/);
mCallbacks->translateString("MBError"), OSMB_OK);
close(); close();
return false; return false;
} }
@ -1371,8 +1369,7 @@ bool LLWindowWin32::switchContext(bool fullscreen, const LLCoordScreen& size, bo
if (!SetPixelFormat(mhDC, pixel_format, &pfd)) if (!SetPixelFormat(mhDC, pixel_format, &pfd))
{ {
OSMessageBox(mCallbacks->translateString("MBPixelFmtSetErr"), LLError::LLUserWarningMsg::show(mCallbacks->translateString("MBPixelFmtSetErr"), 8/*LAST_EXEC_GRAPHICS_INIT*/);
mCallbacks->translateString("MBError"), OSMB_OK);
close(); close();
return false; return false;
} }
@ -1380,16 +1377,14 @@ bool LLWindowWin32::switchContext(bool fullscreen, const LLCoordScreen& size, bo
if (!(mhRC = SafeCreateContext(mhDC))) if (!(mhRC = SafeCreateContext(mhDC)))
{ {
OSMessageBox(mCallbacks->translateString("MBGLContextErr"), LLError::LLUserWarningMsg::show(mCallbacks->translateString("MBGLContextErr"), 8/*LAST_EXEC_GRAPHICS_INIT*/);
mCallbacks->translateString("MBError"), OSMB_OK);
close(); close();
return false; return false;
} }
if (!wglMakeCurrent(mhDC, mhRC)) if (!wglMakeCurrent(mhDC, mhRC))
{ {
OSMessageBox(mCallbacks->translateString("MBGLContextActErr"), LLError::LLUserWarningMsg::show(mCallbacks->translateString("MBGLContextActErr"), 8/*LAST_EXEC_GRAPHICS_INIT*/);
mCallbacks->translateString("MBError"), OSMB_OK);
close(); close();
return false; return false;
} }
@ -1595,15 +1590,14 @@ const S32 max_format = (S32)num_formats - 1;
if (!mhDC) if (!mhDC)
{ {
OSMessageBox(mCallbacks->translateString("MBDevContextErr"), mCallbacks->translateString("MBError"), OSMB_OK); LLError::LLUserWarningMsg::show(mCallbacks->translateString("MBDevContextErr"), 8/*LAST_EXEC_GRAPHICS_INIT*/);
close(); close();
return false; return false;
} }
if (!SetPixelFormat(mhDC, pixel_format, &pfd)) if (!SetPixelFormat(mhDC, pixel_format, &pfd))
{ {
OSMessageBox(mCallbacks->translateString("MBPixelFmtSetErr"), LLError::LLUserWarningMsg::show(mCallbacks->translateString("MBPixelFmtSetErr"), 8/*LAST_EXEC_GRAPHICS_INIT*/);
mCallbacks->translateString("MBError"), OSMB_OK);
close(); close();
return false; return false;
} }
@ -1635,7 +1629,7 @@ const S32 max_format = (S32)num_formats - 1;
{ {
LL_WARNS("Window") << "No wgl_ARB_pixel_format extension!" << LL_ENDL; LL_WARNS("Window") << "No wgl_ARB_pixel_format extension!" << LL_ENDL;
// cannot proceed without wgl_ARB_pixel_format extension, shutdown same as any other gGLManager.initGL() failure // cannot proceed without wgl_ARB_pixel_format extension, shutdown same as any other gGLManager.initGL() failure
OSMessageBox(mCallbacks->translateString("MBVideoDrvErr"), mCallbacks->translateString("MBError"), OSMB_OK); LLError::LLUserWarningMsg::show(mCallbacks->translateString("MBVideoDrvErr"), 8/*LAST_EXEC_GRAPHICS_INIT*/);
close(); close();
return false; return false;
} }
@ -1644,7 +1638,7 @@ const S32 max_format = (S32)num_formats - 1;
if (!DescribePixelFormat(mhDC, pixel_format, sizeof(PIXELFORMATDESCRIPTOR), if (!DescribePixelFormat(mhDC, pixel_format, sizeof(PIXELFORMATDESCRIPTOR),
&pfd)) &pfd))
{ {
OSMessageBox(mCallbacks->translateString("MBPixelFmtDescErr"), mCallbacks->translateString("MBError"), OSMB_OK); LLError::LLUserWarningMsg::show(mCallbacks->translateString("MBPixelFmtDescErr"), 8/*LAST_EXEC_GRAPHICS_INIT*/);
close(); close();
return false; return false;
} }
@ -1666,14 +1660,14 @@ const S32 max_format = (S32)num_formats - 1;
if (!wglMakeCurrent(mhDC, mhRC)) if (!wglMakeCurrent(mhDC, mhRC))
{ {
OSMessageBox(mCallbacks->translateString("MBGLContextActErr"), mCallbacks->translateString("MBError"), OSMB_OK); LLError::LLUserWarningMsg::show(mCallbacks->translateString("MBGLContextActErr"), 8/*LAST_EXEC_GRAPHICS_INIT*/);
close(); close();
return false; return false;
} }
if (!gGLManager.initGL()) if (!gGLManager.initGL())
{ {
OSMessageBox(mCallbacks->translateString("MBVideoDrvErr"), mCallbacks->translateString("MBError"), OSMB_OK); LLError::LLUserWarningMsg::show(mCallbacks->translateString("MBVideoDrvErr"), 8/*LAST_EXEC_GRAPHICS_INIT*/);
close(); close();
return false; return false;
} }
@ -1877,7 +1871,7 @@ void* LLWindowWin32::createSharedContext()
if (!rc && !(rc = wglCreateContext(mhDC))) if (!rc && !(rc = wglCreateContext(mhDC)))
{ {
close(); close();
OSMessageBox(mCallbacks->translateString("MBGLContextErr"), mCallbacks->translateString("MBError"), OSMB_OK); LLError::LLUserWarningMsg::show(mCallbacks->translateString("MBGLContextErr"), 8/*LAST_EXEC_GRAPHICS_INIT*/);
} }
return rc; return rc;

View File

@ -974,9 +974,9 @@ void renderAssetDebug(LLViewerObject* obj, Asset* asset)
LLVector4a t; LLVector4a t;
agent_to_asset.affineTransform(gDebugRaycastStart, t); agent_to_asset.affineTransform(gDebugRaycastStart, t);
start = glm::make_vec4(t.getF32ptr()); start = vec4(t);
agent_to_asset.affineTransform(gDebugRaycastEnd, t); agent_to_asset.affineTransform(gDebugRaycastEnd, t);
end = glm::make_vec4(t.getF32ptr()); end = vec4(t);
start.w = end.w = 1.0; start.w = end.w = 1.0;

View File

@ -328,6 +328,7 @@ bool gUseQuickTime = true;
eLastExecEvent gLastExecEvent = LAST_EXEC_NORMAL; eLastExecEvent gLastExecEvent = LAST_EXEC_NORMAL;
S32 gLastExecDuration = -1; // (<0 indicates unknown) S32 gLastExecDuration = -1; // (<0 indicates unknown)
LLUUID gLastAgentSessionId;
#if LL_WINDOWS #if LL_WINDOWS
# define LL_PLATFORM_KEY "win" # define LL_PLATFORM_KEY "win"
@ -2655,12 +2656,26 @@ void errorCallback(LLError::ELevel level, const std::string &error_string)
} }
} }
void errorMSG(const std::string& title_string, const std::string& message_string) void errorHandler(const std::string& title_string, const std::string& message_string, S32 code)
{ {
if (!message_string.empty()) if (!message_string.empty())
{ {
OSMessageBox(message_string, title_string.empty() ? LLTrans::getString("MBFatalError") : title_string, OSMB_OK); OSMessageBox(message_string, title_string.empty() ? LLTrans::getString("MBFatalError") : title_string, OSMB_OK);
} }
switch (code)
{
case LLError::LLUserWarningMsg::ERROR_OTHER:
LLAppViewer::instance()->createErrorMarker(LAST_EXEC_OTHER_CRASH);
break;
case LLError::LLUserWarningMsg::ERROR_BAD_ALLOC:
LLAppViewer::instance()->createErrorMarker(LAST_EXEC_BAD_ALLOC);
break;
case LLError::LLUserWarningMsg::ERROR_MISSING_FILES:
LLAppViewer::instance()->createErrorMarker(LAST_EXEC_MISSING_FILES);
break;
default:
break;
}
} }
void LLAppViewer::initLoggingAndGetLastDuration() void LLAppViewer::initLoggingAndGetLastDuration()
@ -2674,7 +2689,7 @@ void LLAppViewer::initLoggingAndGetLastDuration()
LLError::addGenericRecorder(&errorCallback); LLError::addGenericRecorder(&errorCallback);
//LLError::setTimeFunction(getRuntime); //LLError::setTimeFunction(getRuntime);
LLError::LLUserWarningMsg::setHandler(errorMSG); LLError::LLUserWarningMsg::setHandler(errorHandler);
if (mSecondInstance) if (mSecondInstance)
@ -2969,6 +2984,7 @@ bool LLAppViewer::initConfiguration()
OSMessageBox( OSMessageBox(
"Unable to load default settings file. The installation may be corrupted.", "Unable to load default settings file. The installation may be corrupted.",
LLStringUtil::null,OSMB_OK); LLStringUtil::null,OSMB_OK);
LLAppViewer::instance()->createErrorMarker(LAST_EXEC_MISSING_FILES);
return false; return false;
} }
@ -4484,16 +4500,21 @@ bool LLAppViewer::markerIsSameVersion(const std::string& marker_name) const
bool sameVersion = false; bool sameVersion = false;
std::string my_version(LLVersionInfo::instance().getChannelAndVersion()); std::string my_version(LLVersionInfo::instance().getChannelAndVersion());
char marker_version[MAX_MARKER_LENGTH]; char marker_data[MAX_MARKER_LENGTH];
S32 marker_version_length; S32 marker_version_length;
LLAPRFile marker_file; LLAPRFile marker_file;
marker_file.open(marker_name, LL_APR_RB); marker_file.open(marker_name, LL_APR_RB);
if (marker_file.getFileHandle()) if (marker_file.getFileHandle())
{ {
marker_version_length = marker_file.read(marker_version, sizeof(marker_version)); marker_version_length = marker_file.read(marker_data, sizeof(marker_data));
std::string marker_string(marker_version, marker_version_length); std::string marker_string(marker_data, marker_version_length);
if ( 0 == my_version.compare( 0, my_version.length(), marker_version, 0, marker_version_length ) ) size_t pos = marker_string.find('\n');
if (pos != std::string::npos)
{
marker_string = marker_string.substr(0, pos);
}
if ( 0 == my_version.compare( 0, my_version.length(), marker_string, 0, marker_string.length()) )
{ {
sameVersion = true; sameVersion = true;
} }
@ -4507,6 +4528,88 @@ bool LLAppViewer::markerIsSameVersion(const std::string& marker_name) const
return sameVersion; return sameVersion;
} }
void LLAppViewer::recordSessionToMarker()
{
std::string marker_version(LLVersionInfo::instance().getChannelAndVersion());
std::string uuid_str = "\n" + gAgentSessionID.asString();
if (marker_version.length() + uuid_str.length() > MAX_MARKER_LENGTH)
{
LL_WARNS_ONCE("MarkerFile") << "Version length (" << marker_version.length() << ")"
<< " greater than maximum (" << MAX_MARKER_LENGTH << ")"
<< ": marker matching may be incorrect"
<< LL_ENDL;
}
mMarkerFile.seek(APR_SET, (S32)marker_version.length());
mMarkerFile.write(uuid_str.data(), (S32)uuid_str.length());
}
LLUUID LLAppViewer::getMarkerSessionId(const std::string& marker_name) const
{
std::string data;
if (getMarkerData(marker_name, data))
{
return LLUUID(data);
}
return LLUUID();
}
S32 LLAppViewer::getMarkerErrorCode(const std::string& marker_name) const
{
std::string data;
if (getMarkerData(marker_name, data))
{
if (data.empty())
{
return 0;
}
else
{
return std::stoi(data);
}
}
return -1;
}
bool LLAppViewer::getMarkerData(const std::string& marker_name, std::string& data) const
{
bool sameVersion = false;
std::string my_version(LLVersionInfo::instance().getChannelAndVersion());
char marker_data[MAX_MARKER_LENGTH];
S32 marker_version_length;
LLAPRFile marker_file;
marker_file.open(marker_name, LL_APR_RB);
if (marker_file.getFileHandle())
{
marker_version_length = marker_file.read(marker_data, sizeof(marker_data));
marker_file.close();
std::string marker_string(marker_data, marker_version_length);
size_t pos = marker_string.find('\n');
if (pos != std::string::npos)
{
data = marker_string.substr(pos + 1, marker_version_length - pos - 1);
marker_string = marker_string.substr(0, pos);
}
if (0 == my_version.compare(0, my_version.length(), marker_string, 0, marker_string.length()))
{
sameVersion = true;
}
else
{
return false;
}
LL_DEBUGS("MarkerFile") << "Compare markers for '" << marker_name << "': "
<< "\n mine '" << my_version << "'"
<< "\n marker '" << marker_string << "'"
<< "\n " << (sameVersion ? "same" : "different") << " version"
<< LL_ENDL;
return true;
}
return false;
}
void LLAppViewer::processMarkerFiles() void LLAppViewer::processMarkerFiles()
{ {
//We've got 4 things to test for here //We've got 4 things to test for here
@ -4525,6 +4628,10 @@ void LLAppViewer::processMarkerFiles()
// File exists... // File exists...
// first, read it to see if it was created by the same version (we need this later) // first, read it to see if it was created by the same version (we need this later)
marker_is_same_version = markerIsSameVersion(mMarkerFileName); marker_is_same_version = markerIsSameVersion(mMarkerFileName);
if (marker_is_same_version)
{
gLastAgentSessionId = getMarkerSessionId(mMarkerFileName);
}
// now test to see if this file is locked by a running process (try to open for write) // now test to see if this file is locked by a running process (try to open for write)
marker_log_stream << "Checking exec marker file for lock..."; marker_log_stream << "Checking exec marker file for lock...";
@ -4645,13 +4752,19 @@ void LLAppViewer::processMarkerFiles()
std::string error_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ERROR_MARKER_FILE_NAME); std::string error_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ERROR_MARKER_FILE_NAME);
if(LLAPRFile::isExist(error_marker_file, NULL, LL_APR_RB)) if(LLAPRFile::isExist(error_marker_file, NULL, LL_APR_RB))
{ {
if (markerIsSameVersion(error_marker_file)) S32 marker_code = getMarkerErrorCode(error_marker_file);
if (marker_code >= 0)
{ {
if (gLastExecEvent == LAST_EXEC_LOGOUT_FROZE) if (gLastExecEvent == LAST_EXEC_LOGOUT_FROZE)
{ {
gLastExecEvent = LAST_EXEC_LOGOUT_CRASH; gLastExecEvent = LAST_EXEC_LOGOUT_CRASH;
LL_INFOS("MarkerFile") << "Error marker '"<< error_marker_file << "' crashed, setting LastExecEvent to LOGOUT_CRASH" << LL_ENDL; LL_INFOS("MarkerFile") << "Error marker '"<< error_marker_file << "' crashed, setting LastExecEvent to LOGOUT_CRASH" << LL_ENDL;
} }
else if (marker_code > 0 && marker_code < (S32)LAST_EXEC_COUNT)
{
gLastExecEvent = (eLastExecEvent)marker_code;
LL_INFOS("MarkerFile") << "Error marker '"<< error_marker_file << "' crashed, setting LastExecEvent to " << gLastExecEvent << LL_ENDL;
}
else else
{ {
gLastExecEvent = LAST_EXEC_OTHER_CRASH; gLastExecEvent = LAST_EXEC_OTHER_CRASH;
@ -6059,6 +6172,24 @@ void LLAppViewer::postToMainCoro(const LL::WorkQueue::Work& work)
gMainloopWork.post(work); gMainloopWork.post(work);
} }
void LLAppViewer::createErrorMarker(eLastExecEvent error_code) const
{
if (!mSecondInstance)
{
std::string error_marker = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ERROR_MARKER_FILE_NAME);
LLAPRFile file;
file.open(error_marker, LL_APR_WB);
if (file.getFileHandle())
{
recordMarkerVersion(file);
std::string data = "\n" + std::to_string((S32)error_code);
file.write(data.data(), static_cast<S32>(data.length()));
file.close();
}
}
}
void LLAppViewer::outOfMemorySoftQuit() void LLAppViewer::outOfMemorySoftQuit()
{ {
if (!mQuitRequested) if (!mQuitRequested)

View File

@ -66,6 +66,20 @@ class LLViewerRegion;
extern LLTrace::BlockTimerStatHandle FTM_FRAME; extern LLTrace::BlockTimerStatHandle FTM_FRAME;
typedef enum
{
LAST_EXEC_NORMAL = 0,
LAST_EXEC_FROZE,
LAST_EXEC_LLERROR_CRASH,
LAST_EXEC_OTHER_CRASH,
LAST_EXEC_LOGOUT_FROZE,
LAST_EXEC_LOGOUT_CRASH,
LAST_EXEC_BAD_ALLOC,
LAST_EXEC_MISSING_FILES,
LAST_EXEC_GRAPHICS_INIT,
LAST_EXEC_COUNT
} eLastExecEvent;
class LLAppViewer : public LLApp class LLAppViewer : public LLApp
{ {
public: public:
@ -144,6 +158,7 @@ public:
void saveNameCache(); void saveNameCache();
void removeMarkerFiles(); void removeMarkerFiles();
void recordSessionToMarker();
void removeDumpDir(); void removeDumpDir();
// LLAppViewer testing helpers. // LLAppViewer testing helpers.
@ -239,6 +254,9 @@ public:
// post given work to the "mainloop" work queue for handling on the main thread // post given work to the "mainloop" work queue for handling on the main thread
void postToMainCoro(const LL::WorkQueue::Work& work); void postToMainCoro(const LL::WorkQueue::Work& work);
// Writes an error code into the error_marker file for use on next startup.
void createErrorMarker(eLastExecEvent error_code) const;
// Attempt a 'soft' quit with disconnect and saving of settings/cache. // Attempt a 'soft' quit with disconnect and saving of settings/cache.
// Intended to be thread safe. // Intended to be thread safe.
// Good chance of viewer crashing either way, but better than alternatives. // Good chance of viewer crashing either way, but better than alternatives.
@ -286,6 +304,9 @@ private:
void processMarkerFiles(); void processMarkerFiles();
static void recordMarkerVersion(LLAPRFile& marker_file); static void recordMarkerVersion(LLAPRFile& marker_file);
bool markerIsSameVersion(const std::string& marker_name) const; bool markerIsSameVersion(const std::string& marker_name) const;
LLUUID getMarkerSessionId(const std::string& marker_name) const;
S32 getMarkerErrorCode(const std::string& marker_name) const;
bool getMarkerData(const std::string& marker_name, std::string &data) const;
void idle(); void idle();
void idleShutdown(); void idleShutdown();
@ -380,18 +401,9 @@ private:
extern LLSD gDebugInfo; extern LLSD gDebugInfo;
extern bool gShowObjectUpdates; extern bool gShowObjectUpdates;
typedef enum
{
LAST_EXEC_NORMAL = 0,
LAST_EXEC_FROZE,
LAST_EXEC_LLERROR_CRASH,
LAST_EXEC_OTHER_CRASH,
LAST_EXEC_LOGOUT_FROZE,
LAST_EXEC_LOGOUT_CRASH
} eLastExecEvent;
extern eLastExecEvent gLastExecEvent; // llstartup extern eLastExecEvent gLastExecEvent; // llstartup
extern S32 gLastExecDuration; ///< the duration of the previous run in seconds (<0 indicates unknown) extern S32 gLastExecDuration; ///< the duration of the previous run in seconds (<0 indicates unknown)
extern LLUUID gLastAgentSessionId; // will be set if agent logged in
extern const char* gPlatform; extern const char* gPlatform;

View File

@ -919,7 +919,7 @@ LLVector2 LLFace::surfaceToTexture(LLVector2 surface_coord, const LLVector4a& po
//VECTORIZE THIS //VECTORIZE THIS
// see if we have a non-default mapping // see if we have a non-default mapping
U8 texgen = getTextureEntry()->getTexGen(); U8 texgen = tep->getTexGen();
if (texgen != LLTextureEntry::TEX_GEN_DEFAULT) if (texgen != LLTextureEntry::TEX_GEN_DEFAULT)
{ {
LLVector4a& center = *(mDrawablep->getVOVolume()->getVolume()->getVolumeFace(mTEOffset).mCenter); LLVector4a& center = *(mDrawablep->getVOVolume()->getVolume()->getVolumeFace(mTEOffset).mCenter);
@ -1026,8 +1026,17 @@ bool LLFace::calcAlignedPlanarTE(const LLFace* align_to, LLVector2* res_st_offs
return false; return false;
} }
const LLTextureEntry *orig_tep = align_to->getTextureEntry(); const LLTextureEntry *orig_tep = align_to->getTextureEntry();
if (!orig_tep)
{
return false;
}
const LLTextureEntry* tep = getTextureEntry();
if (!tep)
{
return false;
}
if ((orig_tep->getTexGen() != LLTextureEntry::TEX_GEN_PLANAR) || if ((orig_tep->getTexGen() != LLTextureEntry::TEX_GEN_PLANAR) ||
(getTextureEntry()->getTexGen() != LLTextureEntry::TEX_GEN_PLANAR)) (tep->getTexGen() != LLTextureEntry::TEX_GEN_PLANAR))
{ {
return false; return false;
} }
@ -1634,11 +1643,8 @@ bool LLFace::getGeometryVolume(const LLVolume& volume,
bump_t_primary_light_ray.load3((offset_multiple * t_scale * primary_light_ray).mV); bump_t_primary_light_ray.load3((offset_multiple * t_scale * primary_light_ray).mV);
} }
// <FS:ND> FIRE-14261 Guard against null textures const LLTextureEntry* tep = getTextureEntry();
// U8 texgen = getTextureEntry()->getTexGen(); U8 texgen = tep ? tep->getTexGen() : LLTextureEntry::TEX_GEN_DEFAULT;
U8 texgen = getTextureEntry() ? getTextureEntry()->getTexGen() : LLTextureEntry::TEX_GEN_DEFAULT;
// </FS:ND>
if (rebuild_tcoord && texgen != LLTextureEntry::TEX_GEN_DEFAULT) if (rebuild_tcoord && texgen != LLTextureEntry::TEX_GEN_DEFAULT)
{ //planar texgen needs binormals { //planar texgen needs binormals
mVObjp->getVolume()->genTangents(face_index); mVObjp->getVolume()->genTangents(face_index);
@ -2182,7 +2188,12 @@ bool LLFace::getGeometryVolume(const LLVolume& volume,
LLStrider<LLColor4U> emissive; LLStrider<LLColor4U> emissive;
mVertexBuffer->getEmissiveStrider(emissive, mGeomIndex, mGeomCount); mVertexBuffer->getEmissiveStrider(emissive, mGeomIndex, mGeomCount);
U8 glow = (U8) llclamp((S32) (getTextureEntry()->getGlow()*255), 0, 255); const LLTextureEntry* tep = getTextureEntry();
U8 glow = 0;
if (tep)
{
glow = (U8)llclamp((S32)(tep->getGlow() * 255), 0, 255);
}
LLVector4a src; LLVector4a src;

View File

@ -67,6 +67,10 @@ LLPanelSnapshot* LLFloaterSnapshot::Impl::getActivePanel(LLFloaterSnapshotBase*
{ {
LLSideTrayPanelContainer* panel_container = floater->getChild<LLSideTrayPanelContainer>("panel_container"); LLSideTrayPanelContainer* panel_container = floater->getChild<LLSideTrayPanelContainer>("panel_container");
LLPanelSnapshot* active_panel = dynamic_cast<LLPanelSnapshot*>(panel_container->getCurrentPanel()); LLPanelSnapshot* active_panel = dynamic_cast<LLPanelSnapshot*>(panel_container->getCurrentPanel());
if (!active_panel)
{
LL_WARNS() << "No snapshot active panel, current panel index: " << panel_container->getCurrentPanelIndex() << LL_ENDL;
}
if (!ok_if_not_found) if (!ok_if_not_found)
{ {
llassert_always(active_panel != NULL); llassert_always(active_panel != NULL);
@ -746,20 +750,18 @@ void LLFloaterSnapshotBase::ImplBase::setWorking(bool working)
working_lbl->setVisible(working); working_lbl->setVisible(working);
mFloater->getChild<LLUICtrl>("working_indicator")->setVisible(working); mFloater->getChild<LLUICtrl>("working_indicator")->setVisible(working);
// All controls should be disabled while posting.
mFloater->setCtrlsEnabled(!working);
if (LLPanelSnapshot* active_panel = getActivePanel(mFloater))
{
active_panel->enableControls(!working);
if (working) if (working)
{ {
const std::string panel_name = getActivePanel(mFloater, false)->getName(); const std::string panel_name = active_panel->getName();
const std::string prefix = panel_name.substr(getSnapshotPanelPrefix().size()); const std::string prefix = panel_name.substr(getSnapshotPanelPrefix().size());
std::string progress_text = mFloater->getString(prefix + "_" + "progress_str"); std::string progress_text = mFloater->getString(prefix + "_" + "progress_str");
working_lbl->setValue(progress_text); working_lbl->setValue(progress_text);
} }
// All controls should be disabled while posting.
mFloater->setCtrlsEnabled(!working);
LLPanelSnapshot* active_panel = getActivePanel(mFloater);
if (active_panel)
{
active_panel->enableControls(!working);
} }
} }

View File

@ -472,9 +472,9 @@ bool LLGLTFPreviewTexture::render()
gPipeline.setupHWLights(); gPipeline.setupHWLights();
glm::mat4 mat = get_current_modelview(); glm::mat4 mat = get_current_modelview();
glm::vec4 transformed_light_dir = glm::make_vec4(light_dir.mV); glm::vec4 transformed_light_dir(light_dir);
transformed_light_dir = mat * transformed_light_dir; transformed_light_dir = mat * transformed_light_dir;
SetTemporarily<LLVector4> force_sun_direction_high_graphics(&gPipeline.mTransformedSunDir, LLVector4(glm::value_ptr(transformed_light_dir))); SetTemporarily<LLVector4> force_sun_direction_high_graphics(&gPipeline.mTransformedSunDir, LLVector4(transformed_light_dir));
// Override lights to ensure the sun is always shining from a certain direction (low graphics) // Override lights to ensure the sun is always shining from a certain direction (low graphics)
// See also force_sun_direction_high_graphics and fixup_shader_constants // See also force_sun_direction_high_graphics and fixup_shader_constants
{ {

View File

@ -106,7 +106,7 @@ void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent,
LLRect world_view_rect = gViewerWindow->getWorldViewRectRaw(); LLRect world_view_rect = gViewerWindow->getWorldViewRectRaw();
glm::ivec4 viewport(world_view_rect.mLeft, world_view_rect.mBottom, world_view_rect.getWidth(), world_view_rect.getHeight()); glm::ivec4 viewport(world_view_rect.mLeft, world_view_rect.mBottom, world_view_rect.getWidth(), world_view_rect.getHeight());
glm::vec3 win_coord = glm::project(glm::make_vec3(render_pos.mV), get_current_modelview(), get_current_projection(), viewport); glm::vec3 win_coord = glm::project(glm::vec3(render_pos), get_current_modelview(), get_current_projection(), viewport);
//fonts all render orthographically, set up projection`` //fonts all render orthographically, set up projection``
gGL.matrixMode(LLRender::MM_PROJECTION); gGL.matrixMode(LLRender::MM_PROJECTION);

View File

@ -227,6 +227,7 @@ void LLLoginInstance::constructAuthParams(LLPointer<LLCredential> user_credentia
request_params["read_critical"] = false; // handleTOSResponse request_params["read_critical"] = false; // handleTOSResponse
request_params["last_exec_event"] = mLastExecEvent; request_params["last_exec_event"] = mLastExecEvent;
request_params["last_exec_duration"] = mLastExecDuration; request_params["last_exec_duration"] = mLastExecDuration;
request_params["last_exec_session_id"] = mLastAgentSessionId.asString();
request_params["mac"] = (char*)hashed_unique_id_string; request_params["mac"] = (char*)hashed_unique_id_string;
request_params["version"] = LLVersionInfo::instance().getVersion(); request_params["version"] = LLVersionInfo::instance().getVersion();
request_params["channel"] = LLVersionInfo::instance().getChannel(); request_params["channel"] = LLVersionInfo::instance().getChannel();

View File

@ -67,6 +67,7 @@ public:
void setSerialNumber(const std::string& sn) { mSerialNumber = sn; } void setSerialNumber(const std::string& sn) { mSerialNumber = sn; }
void setLastExecEvent(int lee) { mLastExecEvent = lee; } void setLastExecEvent(int lee) { mLastExecEvent = lee; }
void setLastExecDuration(S32 duration) { mLastExecDuration = duration; } void setLastExecDuration(S32 duration) { mLastExecDuration = duration; }
void setLastAgentSessionId(const LLUUID& id) { mLastAgentSessionId = id; }
void setPlatformInfo(const std::string platform, const std::string platform_version, const std::string platform_name); void setPlatformInfo(const std::string platform, const std::string platform_version, const std::string platform_name);
void setNotificationsInterface(LLNotificationsInterface* ni) { mNotifications = ni; } void setNotificationsInterface(LLNotificationsInterface* ni) { mNotifications = ni; }
@ -104,6 +105,7 @@ private:
std::string mSerialNumber; std::string mSerialNumber;
int mLastExecEvent; int mLastExecEvent;
S32 mLastExecDuration; S32 mLastExecDuration;
LLUUID mLastAgentSessionId;
std::string mPlatform; std::string mPlatform;
std::string mPlatformVersion; std::string mPlatformVersion;
std::string mPlatformVersionName; std::string mPlatformVersionName;

View File

@ -943,6 +943,10 @@ struct LLPanelFaceGetIsAlignedTEFunctor : public LLSelectedTEFunctor
if (facep->calcAlignedPlanarTE(mCenterFace, &aligned_st_offset, &aligned_st_scale, &aligned_st_rot)) if (facep->calcAlignedPlanarTE(mCenterFace, &aligned_st_offset, &aligned_st_scale, &aligned_st_rot))
{ {
const LLTextureEntry* tep = facep->getTextureEntry(); const LLTextureEntry* tep = facep->getTextureEntry();
if (!tep)
{
return false;
}
LLVector2 st_offset, st_scale; LLVector2 st_offset, st_scale;
tep->getOffset(&st_offset.mV[VX], &st_offset.mV[VY]); tep->getOffset(&st_offset.mV[VX], &st_offset.mV[VY]);
tep->getScale(&st_scale.mV[VX], &st_scale.mV[VY]); tep->getScale(&st_scale.mV[VX], &st_scale.mV[VY]);

View File

@ -662,11 +662,11 @@ void LLPanelPrimMediaControls::updateShape()
for(; vert_it != vert_end; ++vert_it) for(; vert_it != vert_end; ++vert_it)
{ {
// project silhouette vertices into screen space // project silhouette vertices into screen space
glm::vec3 screen_vert(glm::make_vec3(vert_it->mV)); glm::vec3 screen_vert(*vert_it);
screen_vert = mul_mat4_vec3(mat, screen_vert); screen_vert = mul_mat4_vec3(mat, screen_vert);
// add to screenspace bounding box // add to screenspace bounding box
update_min_max(min, max, LLVector3(glm::value_ptr(screen_vert))); update_min_max(min, max, LLVector3(screen_vert));
} }
// convert screenspace bbox to pixels (in screen coords) // convert screenspace bbox to pixels (in screen coords)

View File

@ -259,7 +259,7 @@ bool LLReflectionMap::getBox(LLMatrix4& box)
glm::mat4 mv(get_current_modelview()); glm::mat4 mv(get_current_modelview());
LLVector3 s = mViewerObject->getScale().scaledVec(LLVector3(0.5f, 0.5f, 0.5f)); LLVector3 s = mViewerObject->getScale().scaledVec(LLVector3(0.5f, 0.5f, 0.5f));
mRadius = s.magVec(); mRadius = s.magVec();
glm::mat4 scale = glm::scale(glm::make_vec3(s.mV)); glm::mat4 scale = glm::scale(glm::vec3(s));
if (mViewerObject->mDrawable != nullptr) if (mViewerObject->mDrawable != nullptr)
{ {
// object to agent space (no scale) // object to agent space (no scale)

View File

@ -1093,8 +1093,8 @@ void LLSettingsVOWater::applySpecial(void *ptarget, bool force)
LLVector4 waterPlane(enorm.x, enorm.y, enorm.z, -glm::dot(ep, enorm)); LLVector4 waterPlane(enorm.x, enorm.y, enorm.z, -glm::dot(ep, enorm));
norm = glm::make_vec3(gPipeline.mHeroProbeManager.mMirrorNormal.mV); norm = glm::vec3(gPipeline.mHeroProbeManager.mMirrorNormal);
p = glm::make_vec3(gPipeline.mHeroProbeManager.mMirrorPosition.mV); p = glm::vec3(gPipeline.mHeroProbeManager.mMirrorPosition);
enorm = mul_mat4_vec3(invtrans, norm); enorm = mul_mat4_vec3(invtrans, norm);
enorm = glm::normalize(enorm); enorm = glm::normalize(enorm);
ep = mul_mat4_vec3(mat, p); ep = mul_mat4_vec3(mat, p);

View File

@ -2712,12 +2712,8 @@ void renderTexturePriority(LLDrawable* drawable)
LLGLDisable blend(GL_BLEND); LLGLDisable blend(GL_BLEND);
//LLViewerTexture* imagep = facep->getTexture();
//if (imagep)
if (facep) if (facep)
{ {
//F32 vsize = imagep->mMaxVirtualSize;
F32 vsize = facep->getPixelArea(); F32 vsize = facep->getPixelArea();
if (vsize > sCurMaxTexPriority) if (vsize > sCurMaxTexPriority)
@ -2743,18 +2739,6 @@ void renderTexturePriority(LLDrawable* drawable)
size.mul(0.5f); size.mul(0.5f);
size.add(LLVector4a(0.01f)); size.add(LLVector4a(0.01f));
drawBox(center, size); drawBox(center, size);
/*S32 boost = imagep->getBoostLevel();
if (boost>LLGLTexture::BOOST_NONE)
{
F32 t = (F32) boost / (F32) (LLGLTexture::BOOST_MAX_LEVEL-1);
LLVector4 col = lerp(boost_cold, boost_hot, t);
LLGLEnable blend_on(GL_BLEND);
gGL.blendFunc(GL_SRC_ALPHA, GL_ONE);
gGL.diffuseColor4fv(col.mV);
drawBox(center, size);
gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}*/
} }
} }

View File

@ -1676,7 +1676,7 @@ bool idle_startup()
login->setLastExecDuration(gLastExecDuration); login->setLastExecDuration(gLastExecDuration);
login->setLastExecEvent(last_exec_event); login->setLastExecEvent(last_exec_event);
// </AW: crash report grid correctness> // </AW: crash report grid correctness>
login->setLastAgentSessionId(gLastAgentSessionId);
// This call to LLLoginInstance::connect() starts the // This call to LLLoginInstance::connect() starts the
// authentication process. // authentication process.
@ -2084,7 +2084,7 @@ bool idle_startup()
} }
else if (regionp->capabilitiesError()) else if (regionp->capabilitiesError())
{ {
LL_WARNS("AppInit") << "Failed to get capabilities. Backing up to login screen!" << LL_ENDL; LL_WARNS("AppInit") << "Failed to get capabilities. Logging out and backing up to login screen!" << LL_ENDL;
if (gRememberPassword) if (gRememberPassword)
{ {
LLNotificationsUtil::add("LoginPacketNeverReceived", LLSD(), LLSD(), login_alert_status); LLNotificationsUtil::add("LoginPacketNeverReceived", LLSD(), LLSD(), login_alert_status);
@ -2093,6 +2093,15 @@ bool idle_startup()
{ {
LLNotificationsUtil::add("LoginPacketNeverReceivedNoTP", LLSD(), LLSD(), login_alert_status); LLNotificationsUtil::add("LoginPacketNeverReceivedNoTP", LLSD(), LLSD(), login_alert_status);
} }
// Session was created, don't just hang up on server, send a logout request
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_LogoutRequest);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
gAgent.sendReliableMessage();
reset_login(); reset_login();
} }
else else
@ -2100,7 +2109,7 @@ bool idle_startup()
U32 num_retries = regionp->getNumSeedCapRetries(); U32 num_retries = regionp->getNumSeedCapRetries();
if (num_retries > MAX_SEED_CAP_ATTEMPTS_BEFORE_ABORT) if (num_retries > MAX_SEED_CAP_ATTEMPTS_BEFORE_ABORT)
{ {
LL_WARNS("AppInit") << "Failed to get capabilities. Backing up to login screen!" << LL_ENDL; LL_WARNS("AppInit") << "Failed to get capabilities. Logging out and backing up to login screen!" << LL_ENDL;
if (gRememberPassword) if (gRememberPassword)
{ {
LLNotificationsUtil::add("LoginPacketNeverReceived", LLSD(), LLSD(), login_alert_status); LLNotificationsUtil::add("LoginPacketNeverReceived", LLSD(), LLSD(), login_alert_status);
@ -2109,6 +2118,15 @@ bool idle_startup()
{ {
LLNotificationsUtil::add("LoginPacketNeverReceivedNoTP", LLSD(), LLSD(), login_alert_status); LLNotificationsUtil::add("LoginPacketNeverReceivedNoTP", LLSD(), LLSD(), login_alert_status);
} }
// Session was created, don't just hang up on server, send a logout request
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_LogoutRequest);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
gAgent.sendReliableMessage();
reset_login(); reset_login();
} }
else if (num_retries > 0) else if (num_retries > 0)
@ -2474,7 +2492,7 @@ bool idle_startup()
if (!gAgentMovementCompleted && timeout.getElapsedTimeF32() > STATE_AGENT_WAIT_TIMEOUT) if (!gAgentMovementCompleted && timeout.getElapsedTimeF32() > STATE_AGENT_WAIT_TIMEOUT)
{ {
LL_WARNS("AppInit") << "Backing up to login screen!" << LL_ENDL; LL_WARNS("AppInit") << "Timeout on agent movement. Sending logout and backing up to login screen!" << LL_ENDL;
if (gRememberPassword) if (gRememberPassword)
{ {
LLNotificationsUtil::add("LoginPacketNeverReceived", LLSD(), LLSD(), login_alert_status); LLNotificationsUtil::add("LoginPacketNeverReceived", LLSD(), LLSD(), login_alert_status);
@ -2483,6 +2501,15 @@ bool idle_startup()
{ {
LLNotificationsUtil::add("LoginPacketNeverReceivedNoTP", LLSD(), LLSD(), login_alert_status); LLNotificationsUtil::add("LoginPacketNeverReceivedNoTP", LLSD(), LLSD(), login_alert_status);
} }
// Session was created, don't just hang up on server, send a logout request
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_LogoutRequest);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
gAgent.sendReliableMessage();
reset_login(); reset_login();
} }
return false; return false;
@ -4554,6 +4581,7 @@ bool process_login_success_response(U32 &first_sim_size_x, U32 &first_sim_size_y
text = response["session_id"].asString(); text = response["session_id"].asString();
if(!text.empty()) gAgentSessionID.set(text); if(!text.empty()) gAgentSessionID.set(text);
// gDebugInfo["SessionID"] = text; // gDebugInfo["SessionID"] = text;
LLAppViewer::instance()->recordSessionToMarker();
// Session id needed for parcel info request in LLUrlEntryParcel // Session id needed for parcel info request in LLUrlEntryParcel
// to resolve parcel name. // to resolve parcel name.

View File

@ -434,7 +434,7 @@ bool LLViewerCamera::projectPosAgentToScreen(const LLVector3 &pos_agent, LLCoord
LLRect world_view_rect = gViewerWindow->getWorldViewRectRaw(); LLRect world_view_rect = gViewerWindow->getWorldViewRectRaw();
glm::ivec4 viewport(world_view_rect.mLeft, world_view_rect.mBottom, world_view_rect.getWidth(), world_view_rect.getHeight()); glm::ivec4 viewport(world_view_rect.mLeft, world_view_rect.mBottom, world_view_rect.getWidth(), world_view_rect.getHeight());
glm::vec3 win_coord = glm::project(glm::make_vec3(pos_agent.mV), get_current_modelview(), get_current_projection(), viewport); glm::vec3 win_coord = glm::project(glm::vec3(pos_agent), get_current_modelview(), get_current_projection(), viewport);
{ {
// convert screen coordinates to virtual UI coordinates // convert screen coordinates to virtual UI coordinates
@ -528,7 +528,7 @@ bool LLViewerCamera::projectPosAgentToScreenEdge(const LLVector3 &pos_agent,
LLRect world_view_rect = gViewerWindow->getWorldViewRectRaw(); LLRect world_view_rect = gViewerWindow->getWorldViewRectRaw();
glm::ivec4 viewport(world_view_rect.mLeft, world_view_rect.mBottom, world_view_rect.getWidth(), world_view_rect.getHeight()); glm::ivec4 viewport(world_view_rect.mLeft, world_view_rect.mBottom, world_view_rect.getWidth(), world_view_rect.getHeight());
glm::vec3 win_coord = glm::project(glm::make_vec3(pos_agent.mV), get_current_modelview(), get_current_projection(), viewport); glm::vec3 win_coord = glm::project(glm::vec3(pos_agent), get_current_modelview(), get_current_projection(), viewport);
{ {
win_coord.x /= gViewerWindow->getDisplayScale().mV[VX]; win_coord.x /= gViewerWindow->getDisplayScale().mV[VX];

View File

@ -627,6 +627,8 @@ void LLViewerShaderMgr::setShaders()
else else
{ {
// "ShaderLoading" and "Shader" need to be logged // "ShaderLoading" and "Shader" need to be logged
LL_WARNS("Shader") << "Failed loading basic shaders. Retrying with increased log level..." << LL_ENDL;
LLError::ELevel lvl = LLError::getDefaultLevel(); LLError::ELevel lvl = LLError::getDefaultLevel();
LLError::setDefaultLevel(LLError::LEVEL_DEBUG); LLError::setDefaultLevel(LLError::LEVEL_DEBUG);
loadBasicShaders(); loadBasicShaders();
@ -847,7 +849,7 @@ std::string LLViewerShaderMgr::loadBasicShaders()
// Note usage of GL_VERTEX_SHADER // Note usage of GL_VERTEX_SHADER
if (loadShaderFile(shaders[i].first, shaders[i].second, GL_VERTEX_SHADER, &attribs) == 0) if (loadShaderFile(shaders[i].first, shaders[i].second, GL_VERTEX_SHADER, &attribs) == 0)
{ {
LL_WARNS("Shader") << "Failed to load vertex shader " << shaders[i].first << LL_ENDL; LL_WARNS("Shader") << "Failed to load basic vertex shader " << i << ": " << shaders[i].first << LL_ENDL;
return shaders[i].first; return shaders[i].first;
} }
} }

View File

@ -3005,8 +3005,6 @@ LLViewerLODTexture::LLViewerLODTexture(const std::string& url, FTType f_type, co
void LLViewerLODTexture::init(bool firstinit) void LLViewerLODTexture::init(bool firstinit)
{ {
mTexelsPerImage = 64*64; mTexelsPerImage = 64*64;
mDiscardVirtualSize = 0.f;
mCalculatedDiscardLevel = -1.f;
} }
//virtual //virtual
@ -3087,8 +3085,6 @@ void LLViewerLODTexture::processTextureStats()
{ {
// Calculate the required scale factor of the image using pixels per texel // Calculate the required scale factor of the image using pixels per texel
discard_level = (F32)(log(mTexelsPerImage / mMaxVirtualSize) / log_4); discard_level = (F32)(log(mTexelsPerImage / mMaxVirtualSize) / log_4);
mDiscardVirtualSize = mMaxVirtualSize;
mCalculatedDiscardLevel = discard_level;
} }
discard_level = floorf(discard_level); discard_level = floorf(discard_level);
@ -3666,7 +3662,7 @@ void LLViewerMediaTexture::setPlaying(bool playing)
{ {
LLFace* facep = *iter; LLFace* facep = *iter;
const LLTextureEntry* te = facep->getTextureEntry(); const LLTextureEntry* te = facep->getTextureEntry();
if (te->getGLTFMaterial()) if (te && te->getGLTFMaterial())
{ {
// PBR material, switch emissive and basecolor // PBR material, switch emissive and basecolor
switchTexture(LLRender::EMISSIVE_MAP, *iter); switchTexture(LLRender::EMISSIVE_MAP, *iter);

View File

@ -578,10 +578,6 @@ public:
private: private:
void init(bool firstinit) ; void init(bool firstinit) ;
private:
F32 mDiscardVirtualSize; // Virtual size used to calculate desired discard
F32 mCalculatedDiscardLevel; // Last calculated discard level
}; };
// //

View File

@ -2053,8 +2053,8 @@ bool LLVOAvatar::lineSegmentIntersect(const LLVector4a& start, const LLVector4a&
glm::mat4 inverse = glm::inverse(mat); glm::mat4 inverse = glm::inverse(mat);
glm::mat4 norm_mat = glm::transpose(inverse); glm::mat4 norm_mat = glm::transpose(inverse);
glm::vec3 p1(glm::make_vec3(start.getF32ptr())); glm::vec3 p1(start);
glm::vec3 p2(glm::make_vec3(end.getF32ptr())); glm::vec3 p2(end);
p1 = mul_mat4_vec3(inverse, p1); p1 = mul_mat4_vec3(inverse, p1);
p2 = mul_mat4_vec3(inverse, p2); p2 = mul_mat4_vec3(inverse, p2);
@ -2062,12 +2062,12 @@ bool LLVOAvatar::lineSegmentIntersect(const LLVector4a& start, const LLVector4a&
LLVector3 position; LLVector3 position;
LLVector3 norm; LLVector3 norm;
if (linesegment_sphere(LLVector3(glm::value_ptr(p1)), LLVector3(glm::value_ptr(p2)), LLVector3(0,0,0), 1.f, position, norm)) if (linesegment_sphere(LLVector3(p1), LLVector3(p2), LLVector3(0,0,0), 1.f, position, norm))
{ {
glm::vec3 res_pos(glm::make_vec3(position.mV)); glm::vec3 res_pos(position);
res_pos = mul_mat4_vec3(mat, res_pos); res_pos = mul_mat4_vec3(mat, res_pos);
glm::vec3 res_norm(glm::make_vec3(norm.mV)); glm::vec3 res_norm(norm);
res_norm = glm::normalize(res_norm); res_norm = glm::normalize(res_norm);
res_norm = glm::mat3(norm_mat) * res_norm; res_norm = glm::mat3(norm_mat) * res_norm;

View File

@ -6066,15 +6066,13 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
{ {
continue; continue;
} }
// <FS:Beq> FIRE-34589 - OpenSim crashes due to null facep. Only opensim, not sure why.
// LLFetchedGLTFMaterial *gltf_mat = (LLFetchedGLTFMaterial*) facep->getTextureEntry()->getGLTFRenderMaterial();
auto te = facep->getTextureEntry();
LLFetchedGLTFMaterial* gltf_mat = nullptr; LLFetchedGLTFMaterial* gltf_mat = nullptr;
const LLTextureEntry* te = facep->getTextureEntry();
if (te) if (te)
{ {
gltf_mat = (LLFetchedGLTFMaterial*)te->getGLTFRenderMaterial(); gltf_mat = (LLFetchedGLTFMaterial*)te->getGLTFRenderMaterial();
} } // if not te, continue?
// </FS:Beq>
bool is_pbr = gltf_mat != nullptr; bool is_pbr = gltf_mat != nullptr;
if (is_pbr) if (is_pbr)
@ -6136,13 +6134,9 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
{ {
cur_total += facep->getGeomCount(); cur_total += facep->getGeomCount();
const LLTextureEntry* te = facep->getTextureEntry();
LLViewerTexture* tex = facep->getTexture(); LLViewerTexture* tex = facep->getTexture();
// <FS:ND> More crash avoding ...
// if (te->getGlow() > 0.f)
if (te && te->getGlow() > 0.f) if (te && te->getGlow() > 0.f)
// </FS:ND>
{ {
emissive = true; emissive = true;
} }
@ -6241,6 +6235,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
facep->mLastUpdateTime = gFrameTimeSeconds; facep->mLastUpdateTime = gFrameTimeSeconds;
} }
if (te)
{ {
// <FS> Skip if no te entry // <FS> Skip if no te entry
if (!te) if (!te)
@ -6309,6 +6304,11 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
add_face(sFullbrightFaces, fullbright_count, facep); add_face(sFullbrightFaces, fullbright_count, facep);
} }
} }
else // no texture entry
{
facep->setState(LLFace::FULLBRIGHT);
add_face(sFullbrightFaces, fullbright_count, facep);
}
} }
} }
else else

View File

@ -8654,13 +8654,13 @@ void LLPipeline::renderDeferredLighting()
setupHWLights(); // to set mSun/MoonDir; setupHWLights(); // to set mSun/MoonDir;
glm::vec4 tc(glm::make_vec4(mSunDir.mV)); glm::vec4 tc(mSunDir);
tc = mat * tc; tc = mat * tc;
mTransformedSunDir.set(glm::value_ptr(tc)); mTransformedSunDir.set(tc);
glm::vec4 tc_moon(glm::make_vec4(mMoonDir.mV)); glm::vec4 tc_moon(mMoonDir);
tc_moon = mat * tc_moon; tc_moon = mat * tc_moon;
mTransformedMoonDir.set(glm::value_ptr(tc_moon)); mTransformedMoonDir.set(tc_moon);
if ((RenderDeferredSSAO && !gCubeSnapshot) || RenderShadowDetail > 0) if ((RenderDeferredSSAO && !gCubeSnapshot) || RenderShadowDetail > 0)
{ {
@ -8919,7 +8919,7 @@ void LLPipeline::renderDeferredLighting()
continue; continue;
} }
glm::vec3 tc(glm::make_vec3(c)); glm::vec3 tc(center);
tc = mul_mat4_vec3(mat, tc); tc = mul_mat4_vec3(mat, tc);
fullscreen_lights.push_back(LLVector4(tc.x, tc.y, tc.z, s)); fullscreen_lights.push_back(LLVector4(tc.x, tc.y, tc.z, s));
@ -9026,13 +9026,12 @@ void LLPipeline::renderDeferredLighting()
LLDrawable* drawablep = *iter; LLDrawable* drawablep = *iter;
LLVOVolume* volume = drawablep->getVOVolume(); LLVOVolume* volume = drawablep->getVOVolume();
LLVector3 center = drawablep->getPositionAgent(); LLVector3 center = drawablep->getPositionAgent();
F32* c = center.mV;
F32 light_size_final = volume->getLightRadius() * 1.5f; F32 light_size_final = volume->getLightRadius() * 1.5f;
F32 light_falloff_final = volume->getLightFalloff(DEFERRED_LIGHT_FALLOFF); F32 light_falloff_final = volume->getLightFalloff(DEFERRED_LIGHT_FALLOFF);
sVisibleLightCount++; sVisibleLightCount++;
glm::vec3 tc(glm::make_vec3(c)); glm::vec3 tc(center);
tc = mul_mat4_vec3(mat, tc); tc = mul_mat4_vec3(mat, tc);
setupSpotLight(gDeferredMultiSpotLightProgram, drawablep); setupSpotLight(gDeferredMultiSpotLightProgram, drawablep);
@ -10167,10 +10166,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
LLVector3 lightDir = -caster_dir; LLVector3 lightDir = -caster_dir;
lightDir.normVec(); lightDir.normVec();
glm::vec3 light_dir(glm::make_vec3(lightDir.mV));
//create light space camera matrix //create light space camera matrix
LLVector3 at = lightDir; LLVector3 at = lightDir;
LLVector3 up = camera.getAtAxis(); LLVector3 up = camera.getAtAxis();
@ -10222,9 +10218,9 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
//get good split distances for frustum //get good split distances for frustum
for (U32 i = 0; i < fp.size(); ++i) for (U32 i = 0; i < fp.size(); ++i)
{ {
glm::vec3 v(glm::make_vec3(fp[i].mV)); glm::vec3 v(fp[i]);
v = mul_mat4_vec3(saved_view, v); v = mul_mat4_vec3(saved_view, v);
fp[i].setVec(glm::value_ptr(v)); fp[i] = LLVector3(v);
} }
min = fp[0]; min = fp[0];
@ -10373,9 +10369,9 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
for (U32 i = 0; i < fp.size(); i++) for (U32 i = 0; i < fp.size(); i++)
{ {
glm::vec3 p = glm::make_vec3(fp[i].mV); glm::vec3 p(fp[i]);
p = mul_mat4_vec3(view[j], p); p = mul_mat4_vec3(view[j], p);
wpf.push_back(LLVector3(glm::value_ptr(p))); wpf.push_back(LLVector3(p));
} }
min = wpf[0]; min = wpf[0];
@ -10576,19 +10572,19 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
view[j] = glm::inverse(view[j]); view[j] = glm::inverse(view[j]);
//llassert(origin.isFinite()); //llassert(origin.isFinite());
glm::vec3 origin_agent(glm::make_vec3(origin.mV)); glm::vec3 origin_agent(origin);
//translate view to origin //translate view to origin
origin_agent = mul_mat4_vec3(view[j], origin_agent); origin_agent = mul_mat4_vec3(view[j], origin_agent);
eye = LLVector3(glm::value_ptr(origin_agent)); eye = LLVector3(origin_agent);
//llassert(eye.isFinite()); //llassert(eye.isFinite());
if (!hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA) && !gCubeSnapshot) if (!hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA) && !gCubeSnapshot)
{ {
mShadowFrustOrigin[j] = eye; mShadowFrustOrigin[j] = eye;
} }
view[j] = look(LLVector3(glm::value_ptr(origin_agent)), lightDir, -up); view[j] = look(LLVector3(origin_agent), lightDir, -up);
F32 fx = 1.f/tanf(fovx); F32 fx = 1.f/tanf(fovx);
F32 fz = 1.f/tanf(fovz); F32 fz = 1.f/tanf(fovz);

View File

@ -126,7 +126,7 @@
layout="topleft" layout="topleft"
top_delta="16" top_delta="16"
left="30" left="30"
width="130" width="160"
name="MaxTextureResolutionLabel" name="MaxTextureResolutionLabel"
text_readonly_color="LabelDisabledColor"> text_readonly_color="LabelDisabledColor">
Maximum LOD resolution: Maximum LOD resolution:
@ -135,7 +135,7 @@
control_name="RenderMaxTextureResolution" control_name="RenderMaxTextureResolution"
height="19" height="19"
layout="topleft" layout="topleft"
left_pad="40" left_pad="10"
top_delta="0" top_delta="0"
name="MaxTextureResolution" name="MaxTextureResolution"
tool_tip="Maximum resolution for 'level of detail' textures" tool_tip="Maximum resolution for 'level of detail' textures"