Merge branch 'viewer/build' into rlva/maintenance
commit
10b2b1bb99
|
|
@ -2187,18 +2187,18 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>c541838a933e0714a954e9ef6c89345d</string>
|
||||
<string>40a87f5d505a141b2ec79513a6197c35</string>
|
||||
<key>hash_algorithm</key>
|
||||
<string>md5</string>
|
||||
<key>url</key>
|
||||
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/73387/708088/llca-202012011600.553112-common-553112.tar.bz2</string>
|
||||
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/76516/728250/llca-202102021657.555615-common-555615.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>common</string>
|
||||
</map>
|
||||
</map>
|
||||
<key>version</key>
|
||||
<string>202012011600.553112</string>
|
||||
<string>202102021657.555615</string>
|
||||
</map>
|
||||
<key>llphysicsextensions_source</key>
|
||||
<map>
|
||||
|
|
@ -3128,9 +3128,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>d463360491b6b5cb7a57cd67a90ececb</string>
|
||||
<string>60f008c5fd31641ad4e61ac751ce15d1</string>
|
||||
<key>url</key>
|
||||
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/54838/510050/uriparser-0.8.0.1-darwin64-538968.tar.bz2</string>
|
||||
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/75748/723495/uriparser-0.9.4-darwin64-555117.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>darwin64</string>
|
||||
|
|
@ -3164,9 +3164,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>57a88be57694de6cf9f516125af2c4c9</string>
|
||||
<string>00aff37a6f5e1fe08456702d28706cf6</string>
|
||||
<key>url</key>
|
||||
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/54963/511746/uriparser-0.8.0.1-windows-538968.tar.bz2</string>
|
||||
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/75751/723507/uriparser-0.9.4-windows-555117.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>windows</string>
|
||||
|
|
@ -3176,16 +3176,16 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>f39cc91f2a5dad13790ec18269844ae4</string>
|
||||
<string>ff27a91f3941c7bef5e1613a064cb048</string>
|
||||
<key>url</key>
|
||||
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/54962/511739/uriparser-0.8.0.1-windows64-538968.tar.bz2</string>
|
||||
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/75750/723506/uriparser-0.9.4-windows64-555117.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>windows64</string>
|
||||
</map>
|
||||
</map>
|
||||
<key>version</key>
|
||||
<string>0.8.0.1</string>
|
||||
<string>0.9.4</string>
|
||||
</map>
|
||||
<key>viewer-manager</key>
|
||||
<map>
|
||||
|
|
@ -3206,9 +3206,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>c5ab9d9d7482e48cd76f4bf391900a8c</string>
|
||||
<string>6989053898b8e81e904e75553e378820</string>
|
||||
<key>url</key>
|
||||
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/43369/385585/viewer_manager-2.0.531000-darwin64-531000.tar.bz2</string>
|
||||
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/77523/735051/viewer_manager-2.0.556340-darwin64-556340.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>darwin64</string>
|
||||
|
|
@ -3230,9 +3230,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>6b10d7407686d9e12e63576256581e3e</string>
|
||||
<string>3446c1e54bb32542677caad0ec0d42ac</string>
|
||||
<key>url</key>
|
||||
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/43370/385592/viewer_manager-2.0.531000-windows-531000.tar.bz2</string>
|
||||
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/77525/735058/viewer_manager-2.0.556340-windows-556340.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>windows</string>
|
||||
|
|
@ -3243,7 +3243,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
|
|||
<key>source_type</key>
|
||||
<string>hg</string>
|
||||
<key>version</key>
|
||||
<string>2.0.531000</string>
|
||||
<string>2.0.556340</string>
|
||||
</map>
|
||||
<key>vlc-bin</key>
|
||||
<map>
|
||||
|
|
|
|||
|
|
@ -226,6 +226,7 @@ Ansariel Hiller
|
|||
SL-13364
|
||||
SL-13858
|
||||
SL-13697
|
||||
SL-3136
|
||||
Aralara Rajal
|
||||
Arare Chantilly
|
||||
CHUIBUG-191
|
||||
|
|
@ -263,10 +264,11 @@ Benja Kepler
|
|||
Benjamin Bigdipper
|
||||
Beq Janus
|
||||
BUG-227094
|
||||
Beth Walcher
|
||||
Beq Janus
|
||||
SL-10288
|
||||
SL-11300
|
||||
SL-13583
|
||||
SL-14766
|
||||
Beth Walcher
|
||||
Bezilon Kasei
|
||||
Biancaluce Robbiani
|
||||
CT-225
|
||||
|
|
@ -358,6 +360,8 @@ Chaser Zaks
|
|||
BUG-227485
|
||||
Cherry Cheevers
|
||||
ChickyBabes Zuzu
|
||||
Chorazin Allen
|
||||
BUG-229753
|
||||
Christopher Organiser
|
||||
Ciaran Laval
|
||||
Cinder Roxley
|
||||
|
|
@ -1353,6 +1357,12 @@ Sovereign Engineer
|
|||
SL-11079
|
||||
OPEN-343
|
||||
SL-11625
|
||||
SL-14705
|
||||
SL-14706
|
||||
SL-14707
|
||||
SL-14731
|
||||
SL-14732
|
||||
SL-15096
|
||||
SpacedOut Frye
|
||||
VWR-34
|
||||
VWR-45
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ if(WINDOWS)
|
|||
nghttp2.dll
|
||||
glod.dll
|
||||
libhunspell.dll
|
||||
uriparser.dll
|
||||
)
|
||||
|
||||
# Filenames are different for 32/64 bit BugSplat file and we don't
|
||||
|
|
@ -94,7 +95,7 @@ if(WINDOWS)
|
|||
MESSAGE(STATUS "MSVC_VERSION ${MSVC_VERSION}")
|
||||
elseif (MSVC_VERSION EQUAL 1800) # VisualStudio 2013, which is (sigh) VS 12
|
||||
set(MSVC_VER 120)
|
||||
elseif (MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1930) # Visual Studio 2017 + 2019
|
||||
elseif (MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1940) # Visual Studio 2017 through 2022
|
||||
set(MSVC_VER 140)
|
||||
else (MSVC80)
|
||||
MESSAGE(WARNING "New MSVC_VERSION ${MSVC_VERSION} of MSVC: adapt Copy3rdPartyLibs.cmake")
|
||||
|
|
@ -165,6 +166,9 @@ elseif(DARWIN)
|
|||
libnghttp2.dylib
|
||||
libnghttp2.14.dylib
|
||||
libnghttp2.14.19.0.dylib
|
||||
liburiparser.dylib
|
||||
liburiparser.1.dylib
|
||||
liburiparser.1.0.27.dylib
|
||||
)
|
||||
|
||||
if (FMODSTUDIO)
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ else (USESYSTEMLIBS)
|
|||
set(URIPARSER_PRELOAD_ARCHIVES -Wl,--whole-archive uriparser -Wl,--no-whole-archive)
|
||||
set(URIPARSER_LIBRARIES uriparser)
|
||||
elseif (DARWIN)
|
||||
set(URIPARSER_LIBRARIES uriparser)
|
||||
set(URIPARSER_LIBRARIES liburiparser.dylib)
|
||||
endif (WINDOWS)
|
||||
set(URIPARSER_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/uriparser)
|
||||
endif (USESYSTEMLIBS)
|
||||
|
|
|
|||
|
|
@ -1 +1,3 @@
|
|||
12
|
||||
euclid 5/29/2020
|
||||
euclid 7/23/2020
|
||||
euclid 4/29/2021
|
||||
|
|
@ -103,7 +103,7 @@ void LLAvatarJoint::setValid( BOOL valid, BOOL recursive )
|
|||
for (joints_t::iterator iter = mChildren.begin();
|
||||
iter != mChildren.end(); ++iter)
|
||||
{
|
||||
LLAvatarJoint* joint = (LLAvatarJoint*)(*iter);
|
||||
LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(*iter);
|
||||
joint->setValid(valid, TRUE);
|
||||
}
|
||||
}
|
||||
|
|
@ -136,7 +136,7 @@ void LLAvatarJoint::setVisible(BOOL visible, BOOL recursive)
|
|||
for (joints_t::iterator iter = mChildren.begin();
|
||||
iter != mChildren.end(); ++iter)
|
||||
{
|
||||
LLAvatarJoint* joint = (LLAvatarJoint*)(*iter);
|
||||
LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(*iter);
|
||||
joint->setVisible(visible, recursive);
|
||||
}
|
||||
}
|
||||
|
|
@ -167,7 +167,7 @@ void LLAvatarJoint::updateJointGeometry()
|
|||
for (joints_t::iterator iter = mChildren.begin();
|
||||
iter != mChildren.end(); ++iter)
|
||||
{
|
||||
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
||||
LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(*iter);
|
||||
joint->updateJointGeometry();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
#ifndef LL_LLAPR_H
|
||||
#define LL_LLAPR_H
|
||||
|
||||
#if LL_LINUX || LL_SOLARIS
|
||||
#if LL_LINUX
|
||||
#include <sys/param.h> // Need PATH_MAX in APR headers...
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -56,10 +56,6 @@
|
|||
#include "stringize.h"
|
||||
#include "llexception.h"
|
||||
|
||||
#if LL_WINDOWS
|
||||
#include <excpt.h>
|
||||
#endif
|
||||
|
||||
// static
|
||||
LLCoros::CoroData& LLCoros::get_CoroData(const std::string& caller)
|
||||
{
|
||||
|
|
@ -253,29 +249,13 @@ std::string LLCoros::launch(const std::string& prefix, const callable_t& callabl
|
|||
|
||||
#if LL_WINDOWS
|
||||
|
||||
static const U32 STATUS_MSC_EXCEPTION = 0xE06D7363; // compiler specific
|
||||
|
||||
U32 exception_filter(U32 code, struct _EXCEPTION_POINTERS *exception_infop)
|
||||
{
|
||||
if (code == STATUS_MSC_EXCEPTION)
|
||||
{
|
||||
// C++ exception, go on
|
||||
return EXCEPTION_CONTINUE_SEARCH;
|
||||
}
|
||||
else
|
||||
{
|
||||
// handle it
|
||||
return EXCEPTION_EXECUTE_HANDLER;
|
||||
}
|
||||
}
|
||||
|
||||
void LLCoros::winlevel(const callable_t& callable)
|
||||
{
|
||||
__try
|
||||
{
|
||||
callable();
|
||||
}
|
||||
__except (exception_filter(GetExceptionCode(), GetExceptionInformation()))
|
||||
__except (msc_exception_filter(GetExceptionCode(), GetExceptionInformation()))
|
||||
{
|
||||
// convert to C++ styled exception
|
||||
// Note: it might be better to use _se_set_translator
|
||||
|
|
|
|||
|
|
@ -24,11 +24,14 @@
|
|||
// `_GNU_SOURCE` macro or `BOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED` if
|
||||
// _Unwind_Backtrace is available without `_GNU_SOURCE`."
|
||||
#define BOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED
|
||||
|
||||
#if LL_WINDOWS
|
||||
// On Windows, header-only implementation causes macro collisions -- use
|
||||
// prebuilt library
|
||||
#define BOOST_STACKTRACE_LINK
|
||||
#include <excpt.h>
|
||||
#endif // LL_WINDOWS
|
||||
|
||||
#include <boost/stacktrace.hpp>
|
||||
// other Linden headers
|
||||
#include "llerror.h"
|
||||
|
|
@ -85,3 +88,25 @@ void annotate_exception_(boost::exception& exc)
|
|||
// Anyway, which of us is really going to examine more than 100 frames?
|
||||
exc << errinfo_stacktrace(boost::stacktrace::stacktrace(1, 100));
|
||||
}
|
||||
|
||||
#if LL_WINDOWS
|
||||
|
||||
// For windows SEH exception handling we sometimes need a filter that will
|
||||
// separate C++ exceptions from C SEH exceptions
|
||||
static const U32 STATUS_MSC_EXCEPTION = 0xE06D7363; // compiler specific
|
||||
|
||||
U32 msc_exception_filter(U32 code, struct _EXCEPTION_POINTERS *exception_infop)
|
||||
{
|
||||
if (code == STATUS_MSC_EXCEPTION)
|
||||
{
|
||||
// C++ exception, go on
|
||||
return EXCEPTION_CONTINUE_SEARCH;
|
||||
}
|
||||
else
|
||||
{
|
||||
// handle it
|
||||
return EXCEPTION_EXECUTE_HANDLER;
|
||||
}
|
||||
}
|
||||
|
||||
#endif //LL_WINDOWS
|
||||
|
|
|
|||
|
|
@ -102,4 +102,14 @@ void crash_on_unhandled_exception_(const char*, int, const char*, const std::str
|
|||
log_unhandled_exception_(__FILE__, __LINE__, BOOST_CURRENT_FUNCTION, CONTEXT)
|
||||
void log_unhandled_exception_(const char*, int, const char*, const std::string&);
|
||||
|
||||
|
||||
#if LL_WINDOWS
|
||||
|
||||
// SEH exception filtering for use in __try __except
|
||||
// Separates C++ exceptions from C SEH exceptions
|
||||
// Todo: might be good idea to do some kind of seh_to_msc_wrapper(function, ARGS&&);
|
||||
U32 msc_exception_filter(U32 code, struct _EXCEPTION_POINTERS *exception_infop);
|
||||
|
||||
#endif //LL_WINDOWS
|
||||
|
||||
#endif /* ! defined(LL_LLEXCEPTION_H) */
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
|
||||
#if LL_WINDOWS
|
||||
#include "lltimer.h"
|
||||
#elif LL_LINUX || LL_SOLARIS
|
||||
#elif LL_LINUX
|
||||
#include <sys/time.h>
|
||||
#include <sched.h>
|
||||
#include "lltimer.h"
|
||||
|
|
@ -64,7 +64,7 @@ bool BlockTimer::sLog = false;
|
|||
std::string BlockTimer::sLogName = "";
|
||||
bool BlockTimer::sMetricLog = false;
|
||||
|
||||
#if LL_LINUX || LL_SOLARIS
|
||||
#if LL_LINUX
|
||||
U64 BlockTimer::sClockResolution = 1000000000; // Nanosecond resolution
|
||||
#else
|
||||
U64 BlockTimer::sClockResolution = 1000000; // Microsecond resolution
|
||||
|
|
@ -151,12 +151,12 @@ void BlockTimer::setLogLock(LLMutex* lock)
|
|||
|
||||
|
||||
//static
|
||||
#if (LL_DARWIN || LL_LINUX || LL_SOLARIS) && !(defined(__i386__) || defined(__amd64__))
|
||||
#if (LL_DARWIN || LL_LINUX) && !(defined(__i386__) || defined(__amd64__))
|
||||
U64 BlockTimer::countsPerSecond()
|
||||
{
|
||||
return sClockResolution;
|
||||
}
|
||||
#else // windows or x86-mac or x86-linux or x86-solaris
|
||||
#else // windows or x86-mac or x86-linux
|
||||
U64 BlockTimer::countsPerSecond()
|
||||
{
|
||||
#if LL_FASTTIMER_USE_RDTSC || !LL_WINDOWS
|
||||
|
|
|
|||
|
|
@ -125,9 +125,9 @@ public:
|
|||
#endif
|
||||
|
||||
|
||||
#if (LL_LINUX || LL_SOLARIS) && !(defined(__i386__) || defined(__amd64__))
|
||||
#if (LL_LINUX) && !(defined(__i386__) || defined(__amd64__))
|
||||
//
|
||||
// Linux and Solaris implementation of CPU clock - non-x86.
|
||||
// Linux implementation of CPU clock - non-x86.
|
||||
// This is accurate but SLOW! Only use out of desperation.
|
||||
//
|
||||
// Try to use the MONOTONIC clock if available, this is a constant time counter
|
||||
|
|
@ -153,12 +153,12 @@ public:
|
|||
return (U32)(getCPUClockCount64() >> 8);
|
||||
}
|
||||
|
||||
#endif // (LL_LINUX || LL_SOLARIS) && !(defined(__i386__) || defined(__amd64__))
|
||||
#endif // (LL_LINUX) && !(defined(__i386__) || defined(__amd64__))
|
||||
|
||||
|
||||
#if (LL_LINUX || LL_SOLARIS || LL_DARWIN) && (defined(__i386__) || defined(__amd64__))
|
||||
#if (LL_LINUX || LL_DARWIN) && (defined(__i386__) || defined(__amd64__))
|
||||
//
|
||||
// Mac+Linux+Solaris FAST x86 implementation of CPU clock
|
||||
// Mac+Linux FAST x86 implementation of CPU clock
|
||||
static U32 getCPUClockCount32()
|
||||
{
|
||||
U32 low(0),high(0);
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
# include <sys/types.h>
|
||||
# include <mach/task.h>
|
||||
# include <mach/mach_init.h>
|
||||
#elif LL_LINUX || LL_SOLARIS
|
||||
#elif LL_LINUX
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
|
|
@ -55,7 +55,6 @@ static LLTrace::SampleStatHandle<F64Megabytes> sVirtualMem("virtual_mem", "virtu
|
|||
U32Kilobytes LLMemory::sAllocatedMemInKB(0);
|
||||
U32Kilobytes LLMemory::sAllocatedPageSizeInKB(0);
|
||||
U32Kilobytes LLMemory::sMaxHeapSizeInKB(U32_MAX);
|
||||
BOOL LLMemory::sEnableMemoryFailurePrevention = FALSE;
|
||||
|
||||
void ll_assert_aligned_func(uintptr_t ptr,U32 alignment)
|
||||
{
|
||||
|
|
@ -75,10 +74,9 @@ void ll_assert_aligned_func(uintptr_t ptr,U32 alignment)
|
|||
}
|
||||
|
||||
//static
|
||||
void LLMemory::initMaxHeapSizeGB(F32Gigabytes max_heap_size, BOOL prevent_heap_failure)
|
||||
void LLMemory::initMaxHeapSizeGB(F32Gigabytes max_heap_size)
|
||||
{
|
||||
sMaxHeapSizeInKB = U32Kilobytes::convert(max_heap_size);
|
||||
sEnableMemoryFailurePrevention = prevent_heap_failure ;
|
||||
}
|
||||
|
||||
//static
|
||||
|
|
@ -158,56 +156,6 @@ void LLMemory::logMemoryInfo(BOOL update)
|
|||
LL_INFOS() << "Current max usable memory(KB): " << sMaxPhysicalMemInKB << LL_ENDL ;
|
||||
}
|
||||
|
||||
//return 0: everything is normal;
|
||||
//return 1: the memory pool is low, but not in danger;
|
||||
//return -1: the memory pool is in danger, is about to crash.
|
||||
//static
|
||||
bool LLMemory::isMemoryPoolLow()
|
||||
{
|
||||
static const U32Megabytes LOW_MEMORY_POOL_THRESHOLD(64);
|
||||
const static U32Megabytes MAX_SIZE_CHECKED_MEMORY_BLOCK(64);
|
||||
static void* last_reserved_address = NULL ;
|
||||
|
||||
if(!sEnableMemoryFailurePrevention)
|
||||
{
|
||||
return false ; //no memory failure prevention.
|
||||
}
|
||||
|
||||
if(sAvailPhysicalMemInKB < (LOW_MEMORY_POOL_THRESHOLD / 4)) //out of physical memory
|
||||
{
|
||||
return true ;
|
||||
}
|
||||
|
||||
if(sAllocatedPageSizeInKB + (LOW_MEMORY_POOL_THRESHOLD / 4) > sMaxHeapSizeInKB) //out of virtual address space.
|
||||
{
|
||||
return true ;
|
||||
}
|
||||
|
||||
bool is_low = (S32)(sAvailPhysicalMemInKB < LOW_MEMORY_POOL_THRESHOLD
|
||||
|| sAllocatedPageSizeInKB + LOW_MEMORY_POOL_THRESHOLD > sMaxHeapSizeInKB) ;
|
||||
|
||||
//check the virtual address space fragmentation
|
||||
if(!is_low)
|
||||
{
|
||||
if(!last_reserved_address)
|
||||
{
|
||||
last_reserved_address = LLMemory::tryToAlloc(last_reserved_address, MAX_SIZE_CHECKED_MEMORY_BLOCK.value()) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
last_reserved_address = LLMemory::tryToAlloc(last_reserved_address, MAX_SIZE_CHECKED_MEMORY_BLOCK.value()) ;
|
||||
if(!last_reserved_address) //failed, try once more
|
||||
{
|
||||
last_reserved_address = LLMemory::tryToAlloc(last_reserved_address, MAX_SIZE_CHECKED_MEMORY_BLOCK.value()) ;
|
||||
}
|
||||
}
|
||||
|
||||
is_low = !last_reserved_address ; //allocation failed
|
||||
}
|
||||
|
||||
return is_low ;
|
||||
}
|
||||
|
||||
//static
|
||||
U32Kilobytes LLMemory::getAvailableMemKB()
|
||||
{
|
||||
|
|
@ -309,35 +257,6 @@ U64 LLMemory::getCurrentRSS()
|
|||
return rss;
|
||||
}
|
||||
|
||||
#elif LL_SOLARIS
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#define _STRUCTURED_PROC 1
|
||||
#include <sys/procfs.h>
|
||||
|
||||
U64 LLMemory::getCurrentRSS()
|
||||
{
|
||||
char path [LL_MAX_PATH]; /* Flawfinder: ignore */
|
||||
|
||||
sprintf(path, "/proc/%d/psinfo", (int)getpid());
|
||||
int proc_fd = -1;
|
||||
if((proc_fd = open(path, O_RDONLY)) == -1){
|
||||
LL_WARNS() << "LLmemory::getCurrentRSS() unable to open " << path << ". Returning 0 RSS!" << LL_ENDL;
|
||||
return 0;
|
||||
}
|
||||
psinfo_t proc_psinfo;
|
||||
if(read(proc_fd, &proc_psinfo, sizeof(psinfo_t)) != sizeof(psinfo_t)){
|
||||
LL_WARNS() << "LLmemory::getCurrentRSS() Unable to read from " << path << ". Returning 0 RSS!" << LL_ENDL;
|
||||
close(proc_fd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
close(proc_fd);
|
||||
|
||||
return((U64)proc_psinfo.pr_rssize * 1024);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
U64 LLMemory::getCurrentRSS()
|
||||
|
|
|
|||
|
|
@ -344,10 +344,9 @@ public:
|
|||
// Return value is zero if not known.
|
||||
static U64 getCurrentRSS();
|
||||
static void* tryToAlloc(void* address, U32 size);
|
||||
static void initMaxHeapSizeGB(F32Gigabytes max_heap_size, BOOL prevent_heap_failure);
|
||||
static void initMaxHeapSizeGB(F32Gigabytes max_heap_size);
|
||||
static void updateMemoryInfo() ;
|
||||
static void logMemoryInfo(BOOL update = FALSE);
|
||||
static bool isMemoryPoolLow();
|
||||
|
||||
static U32Kilobytes getAvailableMemKB() ;
|
||||
static U32Kilobytes getMaxMemKB() ;
|
||||
|
|
@ -359,7 +358,6 @@ private:
|
|||
static U32Kilobytes sAllocatedPageSizeInKB ;
|
||||
|
||||
static U32Kilobytes sMaxHeapSizeInKB;
|
||||
static BOOL sEnableMemoryFailurePrevention;
|
||||
};
|
||||
|
||||
// LLRefCount moved to llrefcount.h
|
||||
|
|
|
|||
|
|
@ -34,16 +34,7 @@
|
|||
#include <endian.h>
|
||||
#endif // LL_LINUX
|
||||
|
||||
#if LL_SOLARIS
|
||||
# ifdef __sparc // Since we're talking Solaris 10 and up, only 64 bit is supported.
|
||||
# define LL_BIG_ENDIAN 1
|
||||
# define LL_SOLARIS_ALIGNED_CPU 1 // used to designate issues where SPARC alignment is addressed
|
||||
# define LL_SOLARIS_NON_MESA_GL 1 // The SPARC GL does not provide a MESA-based GL API
|
||||
# endif
|
||||
# include <sys/isa_defs.h> // ensure we know which end is up
|
||||
#endif // LL_SOLARIS
|
||||
|
||||
#if (defined(LL_WINDOWS) || (defined(LL_LINUX) && (__BYTE_ORDER == __LITTLE_ENDIAN)) || (defined(LL_DARWIN) && defined(__LITTLE_ENDIAN__)) || (defined(LL_SOLARIS) && defined(__i386)))
|
||||
#if (defined(LL_WINDOWS) || (defined(LL_LINUX) && (__BYTE_ORDER == __LITTLE_ENDIAN)) || (defined(LL_DARWIN) && defined(__LITTLE_ENDIAN__)))
|
||||
#define LL_LITTLE_ENDIAN 1
|
||||
#else
|
||||
#define LL_BIG_ENDIAN 1
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
#if LL_WINDOWS
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <winsock2.h> // for htonl
|
||||
#elif LL_LINUX || LL_SOLARIS
|
||||
#elif LL_LINUX
|
||||
# include <netinet/in.h>
|
||||
#elif LL_DARWIN
|
||||
# include <arpa/inet.h>
|
||||
|
|
|
|||
|
|
@ -388,7 +388,7 @@ LLSingletonBase::vec_t LLSingletonBase::dep_sort()
|
|||
// extracts just the first (key) element from each sorted_iterator, then
|
||||
// uses vec_t's range constructor... but frankly this is more
|
||||
// straightforward, as long as we remember the above reserve() call!
|
||||
for (const SingletonDeps::sorted_iterator::value_type& pair : sdeps.sort())
|
||||
for (const SingletonDeps::sorted_iterator::value_type pair : sdeps.sort())
|
||||
{
|
||||
ret.push_back(pair.first);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
#include <list>
|
||||
// [/RLVa:KB]
|
||||
|
||||
#if LL_LINUX || LL_SOLARIS
|
||||
#if LL_LINUX
|
||||
#include <wctype.h>
|
||||
#include <wchar.h>
|
||||
#endif
|
||||
|
|
@ -48,16 +48,10 @@
|
|||
#include <string.h>
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
#if LL_SOLARIS
|
||||
// stricmp and strnicmp do not exist on Solaris:
|
||||
#define stricmp strcasecmp
|
||||
#define strnicmp strncasecmp
|
||||
#endif
|
||||
|
||||
const char LL_UNKNOWN_CHAR = '?';
|
||||
class LLSD;
|
||||
|
||||
#if LL_DARWIN || LL_LINUX || LL_SOLARIS
|
||||
#if LL_DARWIN || LL_LINUX
|
||||
// Template specialization of char_traits for U16s. Only necessary on Mac and Linux (exists on Windows already)
|
||||
#include <cstring>
|
||||
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@
|
|||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/type_traits/is_integral.hpp>
|
||||
#include <boost/type_traits/is_float.hpp>
|
||||
#include "llfasttimer.h"
|
||||
|
||||
using namespace llsd;
|
||||
|
||||
|
|
@ -87,17 +88,6 @@ using namespace llsd;
|
|||
# include <stdexcept>
|
||||
const char MEMINFO_FILE[] = "/proc/meminfo";
|
||||
# include <gnu/libc-version.h>
|
||||
#elif LL_SOLARIS
|
||||
# include <stdio.h>
|
||||
# include <unistd.h>
|
||||
# include <sys/utsname.h>
|
||||
# define _STRUCTURED_PROC 1
|
||||
# include <sys/procfs.h>
|
||||
# include <sys/types.h>
|
||||
# include <sys/stat.h>
|
||||
# include <fcntl.h>
|
||||
# include <errno.h>
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
LLCPUInfo gSysCPU;
|
||||
|
|
@ -543,8 +533,6 @@ const std::string& LLOSInfo::getOSVersionString() const
|
|||
U32 LLOSInfo::getProcessVirtualSizeKB()
|
||||
{
|
||||
U32 virtual_size = 0;
|
||||
#if LL_WINDOWS
|
||||
#endif
|
||||
#if LL_LINUX
|
||||
# define STATUS_SIZE 2048
|
||||
LLFILE* status_filep = LLFile::fopen("/proc/self/status", "rb");
|
||||
|
|
@ -564,24 +552,6 @@ U32 LLOSInfo::getProcessVirtualSizeKB()
|
|||
}
|
||||
fclose(status_filep);
|
||||
}
|
||||
#elif LL_SOLARIS
|
||||
char proc_ps[LL_MAX_PATH];
|
||||
sprintf(proc_ps, "/proc/%d/psinfo", (int)getpid());
|
||||
int proc_fd = -1;
|
||||
if((proc_fd = open(proc_ps, O_RDONLY)) == -1){
|
||||
LL_WARNS() << "unable to open " << proc_ps << LL_ENDL;
|
||||
return 0;
|
||||
}
|
||||
psinfo_t proc_psinfo;
|
||||
if(read(proc_fd, &proc_psinfo, sizeof(psinfo_t)) != sizeof(psinfo_t)){
|
||||
LL_WARNS() << "Unable to read " << proc_ps << LL_ENDL;
|
||||
close(proc_fd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
close(proc_fd);
|
||||
|
||||
virtual_size = proc_psinfo.pr_size;
|
||||
#endif
|
||||
return virtual_size;
|
||||
}
|
||||
|
|
@ -590,8 +560,6 @@ U32 LLOSInfo::getProcessVirtualSizeKB()
|
|||
U32 LLOSInfo::getProcessResidentSizeKB()
|
||||
{
|
||||
U32 resident_size = 0;
|
||||
#if LL_WINDOWS
|
||||
#endif
|
||||
#if LL_LINUX
|
||||
LLFILE* status_filep = LLFile::fopen("/proc/self/status", "rb");
|
||||
if (status_filep != NULL)
|
||||
|
|
@ -610,24 +578,6 @@ U32 LLOSInfo::getProcessResidentSizeKB()
|
|||
}
|
||||
fclose(status_filep);
|
||||
}
|
||||
#elif LL_SOLARIS
|
||||
char proc_ps[LL_MAX_PATH];
|
||||
sprintf(proc_ps, "/proc/%d/psinfo", (int)getpid());
|
||||
int proc_fd = -1;
|
||||
if((proc_fd = open(proc_ps, O_RDONLY)) == -1){
|
||||
LL_WARNS() << "unable to open " << proc_ps << LL_ENDL;
|
||||
return 0;
|
||||
}
|
||||
psinfo_t proc_psinfo;
|
||||
if(read(proc_fd, &proc_psinfo, sizeof(psinfo_t)) != sizeof(psinfo_t)){
|
||||
LL_WARNS() << "Unable to read " << proc_ps << LL_ENDL;
|
||||
close(proc_fd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
close(proc_fd);
|
||||
|
||||
resident_size = proc_psinfo.pr_rssize;
|
||||
#endif
|
||||
return resident_size;
|
||||
}
|
||||
|
|
@ -772,11 +722,6 @@ U32Kilobytes LLMemoryInfo::getPhysicalMemoryKB() const
|
|||
phys = (U64)(getpagesize()) * (U64)(get_phys_pages());
|
||||
return U64Bytes(phys);
|
||||
|
||||
#elif LL_SOLARIS
|
||||
U64 phys = 0;
|
||||
phys = (U64)(getpagesize()) * (U64)(sysconf(_SC_PHYS_PAGES));
|
||||
return U64Bytes(phys);
|
||||
|
||||
#else
|
||||
return 0;
|
||||
|
||||
|
|
@ -925,8 +870,12 @@ LLMemoryInfo& LLMemoryInfo::refresh()
|
|||
return *this;
|
||||
}
|
||||
|
||||
static LLTrace::BlockTimerStatHandle FTM_MEMINFO_LOAD_STATS("MemInfo Load Stats");
|
||||
|
||||
LLSD LLMemoryInfo::loadStatsMap()
|
||||
{
|
||||
LL_RECORD_BLOCK_TIME(FTM_MEMINFO_LOAD_STATS);
|
||||
|
||||
// This implementation is derived from stream() code (as of 2011-06-29).
|
||||
Stats stats;
|
||||
|
||||
|
|
@ -948,24 +897,11 @@ LLSD LLMemoryInfo::loadStatsMap()
|
|||
stats.add("Total Virtual KB", state.ullTotalVirtual/div);
|
||||
stats.add("Avail Virtual KB", state.ullAvailVirtual/div);
|
||||
|
||||
PERFORMANCE_INFORMATION perf;
|
||||
perf.cb = sizeof(perf);
|
||||
GetPerformanceInfo(&perf, sizeof(perf));
|
||||
|
||||
SIZE_T pagekb(perf.PageSize/1024);
|
||||
stats.add("CommitTotal KB", perf.CommitTotal * pagekb);
|
||||
stats.add("CommitLimit KB", perf.CommitLimit * pagekb);
|
||||
stats.add("CommitPeak KB", perf.CommitPeak * pagekb);
|
||||
stats.add("PhysicalTotal KB", perf.PhysicalTotal * pagekb);
|
||||
stats.add("PhysicalAvail KB", perf.PhysicalAvailable * pagekb);
|
||||
stats.add("SystemCache KB", perf.SystemCache * pagekb);
|
||||
stats.add("KernelTotal KB", perf.KernelTotal * pagekb);
|
||||
stats.add("KernelPaged KB", perf.KernelPaged * pagekb);
|
||||
stats.add("KernelNonpaged KB", perf.KernelNonpaged * pagekb);
|
||||
stats.add("PageSize KB", pagekb);
|
||||
stats.add("HandleCount", perf.HandleCount);
|
||||
stats.add("ProcessCount", perf.ProcessCount);
|
||||
stats.add("ThreadCount", perf.ThreadCount);
|
||||
// SL-12122 - Call to GetPerformanceInfo() was removed here. Took
|
||||
// on order of 10 ms, causing unacceptable frame time spike every
|
||||
// second, and results were never used. If this is needed in the
|
||||
// future, must find a way to avoid frame time impact (e.g. move
|
||||
// to another thread, call much less often).
|
||||
|
||||
PROCESS_MEMORY_COUNTERS_EX pmem;
|
||||
pmem.cb = sizeof(pmem);
|
||||
|
|
@ -1074,13 +1010,6 @@ LLSD LLMemoryInfo::loadStatsMap()
|
|||
}
|
||||
}
|
||||
|
||||
#elif LL_SOLARIS
|
||||
U64 phys = 0;
|
||||
|
||||
phys = (U64)(sysconf(_SC_PHYS_PAGES)) * (U64)(sysconf(_SC_PAGESIZE)/1024);
|
||||
|
||||
stats.add("Total Physical KB", phys);
|
||||
|
||||
#elif LL_LINUX
|
||||
std::ifstream meminfo(MEMINFO_FILE);
|
||||
if (meminfo.is_open())
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
#include "lltracethreadrecorder.h"
|
||||
#include "llexception.h"
|
||||
|
||||
#if LL_LINUX || LL_SOLARIS
|
||||
#if LL_LINUX
|
||||
#include <sched.h>
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
#if LL_WINDOWS
|
||||
# include "llwin32headerslean.h"
|
||||
#elif LL_LINUX || LL_SOLARIS || LL_DARWIN
|
||||
#elif LL_LINUX || LL_DARWIN
|
||||
# include <errno.h>
|
||||
# include <sys/time.h>
|
||||
#else
|
||||
|
|
@ -74,7 +74,7 @@ U32 micro_sleep(U64 us, U32 max_yields)
|
|||
ms_sleep((U32)(us / 1000));
|
||||
return 0;
|
||||
}
|
||||
#elif LL_LINUX || LL_SOLARIS || LL_DARWIN
|
||||
#elif LL_LINUX || LL_DARWIN
|
||||
static void _sleep_loop(struct timespec& thiswait)
|
||||
{
|
||||
struct timespec nextwait;
|
||||
|
|
@ -187,7 +187,7 @@ F64 calc_clock_frequency()
|
|||
#endif // LL_WINDOWS
|
||||
|
||||
|
||||
#if LL_LINUX || LL_DARWIN || LL_SOLARIS
|
||||
#if LL_LINUX || LL_DARWIN
|
||||
// Both Linux and Mac use gettimeofday for accurate time
|
||||
F64 calc_clock_frequency()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
#ifndef LL_TIMER_H
|
||||
#define LL_TIMER_H
|
||||
|
||||
#if LL_LINUX || LL_DARWIN || LL_SOLARIS
|
||||
#if LL_LINUX || LL_DARWIN
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
#include <limits.h>
|
||||
|
|
|
|||
|
|
@ -29,10 +29,13 @@
|
|||
#include "linden_common.h"
|
||||
#include "lluriparser.h"
|
||||
|
||||
#if LL_DARWIN
|
||||
#include <signal.h>
|
||||
#include <setjmp.h>
|
||||
#endif
|
||||
|
||||
LLUriParser::LLUriParser(const std::string& u) : mTmpScheme(false), mNormalizedTmp(false), mRes(0)
|
||||
{
|
||||
mState.uri = &mUri;
|
||||
|
||||
if (u.find("://") == std::string::npos)
|
||||
{
|
||||
mNormalizedUri = "http://";
|
||||
|
|
@ -51,7 +54,7 @@ LLUriParser::~LLUriParser()
|
|||
|
||||
S32 LLUriParser::parse()
|
||||
{
|
||||
mRes = uriParseUriA(&mState, mNormalizedUri.c_str());
|
||||
mRes = uriParseSingleUriA(&mUri, mNormalizedUri.c_str(), NULL);
|
||||
return mRes;
|
||||
}
|
||||
|
||||
|
|
@ -158,31 +161,69 @@ void LLUriParser::extractParts()
|
|||
}
|
||||
}
|
||||
|
||||
#if LL_DARWIN
|
||||
typedef void(*sighandler_t)(int);
|
||||
jmp_buf return_to_normalize;
|
||||
void uri_signal_handler(int signal)
|
||||
{
|
||||
// Apparently signal handler throwing an exception doesn't work.
|
||||
// This is ugly and unsafe due to not unwinding content of uriparser library,
|
||||
// but unless we have a way to catch this as NSexception, jump appears to be the only option.
|
||||
longjmp(return_to_normalize, 1 /*setjmp will return this value*/);
|
||||
}
|
||||
#endif
|
||||
|
||||
S32 LLUriParser::normalize()
|
||||
{
|
||||
mNormalizedTmp = mTmpScheme;
|
||||
if (!mRes)
|
||||
{
|
||||
mRes = uriNormalizeSyntaxExA(&mUri, URI_NORMALIZE_SCHEME | URI_NORMALIZE_HOST);
|
||||
#if LL_DARWIN
|
||||
sighandler_t last_handler;
|
||||
last_handler = signal(SIGILL, &uri_signal_handler); // illegal instruction
|
||||
if (setjmp(return_to_normalize))
|
||||
{
|
||||
// Issue: external library crashed via signal
|
||||
// If you encountered this, please try to figure out what's wrong:
|
||||
// 1. Verify that library's input is 'sane'
|
||||
// 2. Check if we have an NSexception to work with (unlikely)
|
||||
// 3. See if passing same string causes exception to repeat
|
||||
//
|
||||
// Crash happens at uriNormalizeSyntaxExA
|
||||
// Warning!!! This does not properly unwind stack,
|
||||
// if this can be handled by NSexception, it needs to be remade
|
||||
llassert(0);
|
||||
|
||||
if (!mRes)
|
||||
{
|
||||
S32 chars_required;
|
||||
mRes = uriToStringCharsRequiredA(&mUri, &chars_required);
|
||||
LL_WARNS() << "Uriparser crashed with SIGILL, while processing: " << mNormalizedUri << LL_ENDL;
|
||||
signal(SIGILL, last_handler);
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!mRes)
|
||||
{
|
||||
chars_required++;
|
||||
std::vector<char> label_buf(chars_required);
|
||||
mRes = uriToStringA(&label_buf[0], &mUri, chars_required, NULL);
|
||||
mRes = uriNormalizeSyntaxExA(&mUri, URI_NORMALIZE_SCHEME | URI_NORMALIZE_HOST);
|
||||
|
||||
if (!mRes)
|
||||
{
|
||||
mNormalizedUri = &label_buf[mTmpScheme ? 7 : 0];
|
||||
mTmpScheme = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#if LL_DARWIN
|
||||
signal(SIGILL, last_handler);
|
||||
#endif
|
||||
|
||||
if (!mRes)
|
||||
{
|
||||
S32 chars_required;
|
||||
mRes = uriToStringCharsRequiredA(&mUri, &chars_required);
|
||||
|
||||
if (!mRes)
|
||||
{
|
||||
chars_required++;
|
||||
std::vector<char> label_buf(chars_required);
|
||||
mRes = uriToStringA(&label_buf[0], &mUri, chars_required, NULL);
|
||||
|
||||
if (!mRes)
|
||||
{
|
||||
mNormalizedUri = &label_buf[mTmpScheme ? 7 : 0];
|
||||
mTmpScheme = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(mTmpScheme)
|
||||
|
|
|
|||
|
|
@ -76,7 +76,6 @@ private:
|
|||
std::string mFragment;
|
||||
std::string mNormalizedUri;
|
||||
|
||||
UriParserStateA mState;
|
||||
UriUriA mUri;
|
||||
|
||||
S32 mRes;
|
||||
|
|
|
|||
|
|
@ -601,9 +601,7 @@ S32 LLUUID::getNodeID(unsigned char *node_id)
|
|||
#define HAVE_NETINET_IN_H
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#if LL_SOLARIS
|
||||
#include <sys/sockio.h>
|
||||
#elif !LL_DARWIN
|
||||
#if !LL_DARWIN
|
||||
#include <linux/sockios.h>
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ typedef unsigned __int64 U64;
|
|||
#else
|
||||
typedef long long int S64;
|
||||
typedef long long unsigned int U64;
|
||||
#if LL_DARWIN || LL_LINUX || LL_SOLARIS
|
||||
#if LL_DARWIN || LL_LINUX
|
||||
#define S64L(a) (a##LL)
|
||||
#define U64L(a) (a##ULL)
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -178,6 +178,7 @@ if (DARWIN)
|
|||
libaprutil-1.0.dylib
|
||||
libexception_handler.dylib
|
||||
libnghttp2*.dylib
|
||||
liburiparser*.dylib
|
||||
${EXPAT_COPY}
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -295,7 +295,6 @@ public:
|
|||
void setAllowTerraform(BOOL b){setParcelFlag(PF_ALLOW_TERRAFORM, b); }
|
||||
void setAllowDamage(BOOL b) { setParcelFlag(PF_ALLOW_DAMAGE, b); }
|
||||
void setAllowFly(BOOL b) { setParcelFlag(PF_ALLOW_FLY, b); }
|
||||
void setAllowLandmark(BOOL b){ setParcelFlag(PF_ALLOW_LANDMARK, b); }
|
||||
void setAllowGroupScripts(BOOL b) { setParcelFlag(PF_ALLOW_GROUP_SCRIPTS, b); }
|
||||
void setAllowOtherScripts(BOOL b) { setParcelFlag(PF_ALLOW_OTHER_SCRIPTS, b); }
|
||||
void setAllowDeedToGroup(BOOL b) { setParcelFlag(PF_ALLOW_DEED_TO_GROUP, b); }
|
||||
|
|
@ -476,11 +475,6 @@ public:
|
|||
BOOL getAllowFly() const
|
||||
{ return (mParcelFlags & PF_ALLOW_FLY) ? TRUE : FALSE; }
|
||||
|
||||
// Remove permission restrictions for creating landmarks.
|
||||
// We should eventually remove this flag completely.
|
||||
BOOL getAllowLandmark() const
|
||||
{ return TRUE; }
|
||||
|
||||
BOOL getAllowGroupScripts() const
|
||||
{ return (mParcelFlags & PF_ALLOW_GROUP_SCRIPTS) ? TRUE : FALSE; }
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ const U32 PF_ALLOW_FLY = 1 << 0;// Can start flying
|
|||
const U32 PF_ALLOW_OTHER_SCRIPTS= 1 << 1;// Scripts by others can run.
|
||||
const U32 PF_FOR_SALE = 1 << 2;// Can buy this land
|
||||
const U32 PF_FOR_SALE_OBJECTS = 1 << 7;// Can buy all objects on this land
|
||||
const U32 PF_ALLOW_LANDMARK = 1 << 3;
|
||||
const U32 PF_ALLOW_LANDMARK = 1 << 3;// Always true/deprecated
|
||||
const U32 PF_ALLOW_TERRAFORM = 1 << 4;
|
||||
const U32 PF_ALLOW_DAMAGE = 1 << 5;
|
||||
const U32 PF_CREATE_OBJECTS = 1 << 6;
|
||||
|
|
|
|||
|
|
@ -47,9 +47,6 @@
|
|||
#elif (LL_LINUX && __GNUC__ <= 2)
|
||||
#define llisnan(val) isnan(val)
|
||||
#define llfinite(val) isfinite(val)
|
||||
#elif LL_SOLARIS
|
||||
#define llisnan(val) isnan(val)
|
||||
#define llfinite(val) (val <= std::numeric_limits<double>::max())
|
||||
#else
|
||||
#define llisnan(val) std::isnan(val)
|
||||
#define llfinite(val) std::isfinite(val)
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
#if LL_WINDOWS
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <winsock2.h> // for htonl
|
||||
#elif LL_LINUX || LL_SOLARIS
|
||||
#elif LL_LINUX
|
||||
# include <netinet/in.h>
|
||||
#elif LL_DARWIN
|
||||
# include <arpa/inet.h>
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@ public:
|
|||
|
||||
virtual void logAssetStorageInfo() = 0;
|
||||
|
||||
void checkForTimeouts();
|
||||
virtual void checkForTimeouts();
|
||||
|
||||
void getEstateAsset(const LLHost &object_sim, const LLUUID &agent_id, const LLUUID &session_id,
|
||||
const LLUUID &asset_id, LLAssetType::EType atype, EstateAssetType etype,
|
||||
|
|
|
|||
|
|
@ -144,10 +144,10 @@ void LLAvatarNameCache::requestAvatarNameCache_(std::string url, std::vector<LLU
|
|||
}
|
||||
|
||||
LLSD httpResults;
|
||||
bool success = true;
|
||||
|
||||
try
|
||||
{
|
||||
bool success = true;
|
||||
|
||||
LLCoreHttpUtil::HttpCoroutineAdapter httpAdapter("NameCache", sHttpPolicy);
|
||||
LLSD results = httpAdapter.getAndSuspend(sHttpRequest, url);
|
||||
|
|
@ -162,35 +162,47 @@ void LLAvatarNameCache::requestAvatarNameCache_(std::string url, std::vector<LLU
|
|||
else
|
||||
{
|
||||
httpResults = results["http_result"];
|
||||
success = httpResults["success"].asBoolean();
|
||||
if (!httpResults.isMap())
|
||||
{
|
||||
success = false;
|
||||
LL_WARNS("AvNameCache") << " Invalid http_result returned from LLCoreHttpUtil::HttpCoroHandler." << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
success = httpResults["success"].asBoolean();
|
||||
if (!success)
|
||||
{
|
||||
LL_WARNS("AvNameCache") << "Error result from LLCoreHttpUtil::HttpCoroHandler. Code "
|
||||
<< httpResults["status"] << ": '" << httpResults["message"] << "'" << LL_ENDL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (LLAvatarNameCache::instanceExists())
|
||||
{
|
||||
if (!success)
|
||||
{
|
||||
LL_WARNS("AvNameCache") << "Error result from LLCoreHttpUtil::HttpCoroHandler. Code "
|
||||
<< httpResults["status"] << ": '" << httpResults["message"] << "'" << LL_ENDL;
|
||||
{ // on any sort of failure add dummy records for any agent IDs
|
||||
// in this request that we do not have cached already
|
||||
std::vector<LLUUID>::const_iterator it = agentIds.begin();
|
||||
for (; it != agentIds.end(); ++it)
|
||||
{
|
||||
const LLUUID& agent_id = *it;
|
||||
LLAvatarNameCache::getInstance()->handleAgentError(agent_id);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
LLAvatarNameCache::getInstance()->handleAvNameCacheSuccess(results, httpResults);
|
||||
}
|
||||
|
||||
if (!success)
|
||||
{ // on any sort of failure add dummy records for any agent IDs
|
||||
// in this request that we do not have cached already
|
||||
std::vector<LLUUID>::const_iterator it = agentIds.begin();
|
||||
for ( ; it != agentIds.end(); ++it)
|
||||
{
|
||||
const LLUUID& agent_id = *it;
|
||||
LLAvatarNameCache::getInstance()->handleAgentError(agent_id);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
LLAvatarNameCache::getInstance()->handleAvNameCacheSuccess(results, httpResults);
|
||||
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
LOG_UNHANDLED_EXCEPTION(STRINGIZE("coroutine " << LLCoros::getName()
|
||||
<< "('" << url << "', " << agentIds.size()
|
||||
<< " http result: " << httpResults.asString()
|
||||
<< " Agent Ids)"));
|
||||
<< "('" << url << "', "
|
||||
<< agentIds.size() << "Agent Ids,"
|
||||
<< " http result: " << S32(success)
|
||||
<< " has response: " << S32(httpResults.size())
|
||||
<< ")"));
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ static const std::map<std::string, U32> DefaultPoolSizes{
|
|||
};
|
||||
|
||||
static const U32 DEFAULT_POOL_SIZE = 5;
|
||||
static const U32 DEFAULT_QUEUE_SIZE = 4096;
|
||||
const U32 LLCoprocedureManager::DEFAULT_QUEUE_SIZE = 4096;
|
||||
|
||||
//=========================================================================
|
||||
class LLCoprocedurePool: private boost::noncopyable
|
||||
|
|
@ -194,7 +194,7 @@ void LLCoprocedureManager::setPropertyMethods(SettingQuery_t queryfn, SettingUpd
|
|||
mPropertyDefineFn = updatefn;
|
||||
|
||||
// workaround until we get mutex into initializePool
|
||||
initializePool("VAssetStorage");
|
||||
initializePool("AssetStorage");
|
||||
initializePool("Upload");
|
||||
}
|
||||
|
||||
|
|
@ -281,7 +281,7 @@ LLCoprocedurePool::LLCoprocedurePool(const std::string &poolName, size_t size):
|
|||
mPoolSize(size),
|
||||
mActiveCoprocsCount(0),
|
||||
mPending(0),
|
||||
mPendingCoprocs(boost::make_shared<CoprocQueue_t>(DEFAULT_QUEUE_SIZE)),
|
||||
mPendingCoprocs(boost::make_shared<CoprocQueue_t>(LLCoprocedureManager::DEFAULT_QUEUE_SIZE)),
|
||||
mHTTPPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID),
|
||||
mCoroMapping()
|
||||
{
|
||||
|
|
@ -332,7 +332,7 @@ LLCoprocedurePool::LLCoprocedurePool(const std::string &poolName, size_t size):
|
|||
mCoroMapping.insert(CoroAdapterMap_t::value_type(pooledCoro, httpAdapter));
|
||||
}
|
||||
|
||||
LL_INFOS("CoProcMgr") << "Created coprocedure pool named \"" << mPoolName << "\" with " << size << " items, queue max " << DEFAULT_QUEUE_SIZE << LL_ENDL;
|
||||
LL_INFOS("CoProcMgr") << "Created coprocedure pool named \"" << mPoolName << "\" with " << size << " items, queue max " << LLCoprocedureManager::DEFAULT_QUEUE_SIZE << LL_ENDL;
|
||||
}
|
||||
|
||||
LLCoprocedurePool::~LLCoprocedurePool()
|
||||
|
|
|
|||
|
|
@ -91,6 +91,9 @@ private:
|
|||
|
||||
SettingQuery_t mPropertyQueryFn;
|
||||
SettingUpdate_t mPropertyDefineFn;
|
||||
|
||||
public:
|
||||
static const U32 DEFAULT_QUEUE_SIZE;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -35,10 +35,6 @@
|
|||
#include <netinet/in.h>
|
||||
#endif
|
||||
|
||||
#if LL_SOLARIS
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
|
||||
#if LL_WINDOWS
|
||||
#include "winsock2.h" // htons etc.
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ LLMatrix4 gGLObliqueProjectionInverse;
|
|||
|
||||
std::list<LLGLUpdate*> LLGLUpdate::sGLQ;
|
||||
|
||||
#if (LL_WINDOWS || LL_LINUX || LL_SOLARIS) && !LL_MESA_HEADLESS
|
||||
#if (LL_WINDOWS || LL_LINUX) && !LL_MESA_HEADLESS
|
||||
// ATI prototypes
|
||||
|
||||
#if LL_WINDOWS
|
||||
|
|
@ -328,7 +328,7 @@ PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB = NULL;
|
|||
#endif
|
||||
|
||||
// vertex shader prototypes
|
||||
#if LL_LINUX || LL_SOLARIS
|
||||
#if LL_LINUX
|
||||
PFNGLVERTEXATTRIB1DARBPROC glVertexAttrib1dARB = NULL;
|
||||
PFNGLVERTEXATTRIB1DVARBPROC glVertexAttrib1dvARB = NULL;
|
||||
PFNGLVERTEXATTRIB1FARBPROC glVertexAttrib1fARB = NULL;
|
||||
|
|
@ -347,7 +347,7 @@ PFNGLVERTEXATTRIB3FARBPROC glVertexAttrib3fARB = NULL;
|
|||
PFNGLVERTEXATTRIB3FVARBPROC glVertexAttrib3fvARB = NULL;
|
||||
PFNGLVERTEXATTRIB3SARBPROC glVertexAttrib3sARB = NULL;
|
||||
PFNGLVERTEXATTRIB3SVARBPROC glVertexAttrib3svARB = NULL;
|
||||
#endif // LL_LINUX || LL_SOLARIS
|
||||
#endif // LL_LINUX
|
||||
PFNGLVERTEXATTRIB4NBVARBPROC glVertexAttrib4nbvARB = NULL;
|
||||
PFNGLVERTEXATTRIB4NIVARBPROC glVertexAttrib4nivARB = NULL;
|
||||
PFNGLVERTEXATTRIB4NSVARBPROC glVertexAttrib4nsvARB = NULL;
|
||||
|
|
@ -355,7 +355,7 @@ PFNGLVERTEXATTRIB4NUBARBPROC glVertexAttrib4nubARB = NULL;
|
|||
PFNGLVERTEXATTRIB4NUBVARBPROC glVertexAttrib4nubvARB = NULL;
|
||||
PFNGLVERTEXATTRIB4NUIVARBPROC glVertexAttrib4nuivARB = NULL;
|
||||
PFNGLVERTEXATTRIB4NUSVARBPROC glVertexAttrib4nusvARB = NULL;
|
||||
#if LL_LINUX || LL_SOLARIS
|
||||
#if LL_LINUX
|
||||
PFNGLVERTEXATTRIB4BVARBPROC glVertexAttrib4bvARB = NULL;
|
||||
PFNGLVERTEXATTRIB4DARBPROC glVertexAttrib4dARB = NULL;
|
||||
PFNGLVERTEXATTRIB4DVARBPROC glVertexAttrib4dvARB = NULL;
|
||||
|
|
@ -393,7 +393,7 @@ PFNGLGETVERTEXATTRIBFVARBPROC glGetVertexAttribfvARB = NULL;
|
|||
PFNGLGETVERTEXATTRIBIVARBPROC glGetVertexAttribivARB = NULL;
|
||||
PFNGLGETVERTEXATTRIBPOINTERVARBPROC glGetVertexAttribPointervARB = NULL;
|
||||
PFNGLISPROGRAMARBPROC glIsProgramARB = NULL;
|
||||
#endif // LL_LINUX || LL_SOLARIS
|
||||
#endif // LL_LINUX
|
||||
PFNGLBINDATTRIBLOCATIONARBPROC glBindAttribLocationARB = NULL;
|
||||
PFNGLGETACTIVEATTRIBARBPROC glGetActiveAttribARB = NULL;
|
||||
PFNGLGETATTRIBLOCATIONARBPROC glGetAttribLocationARB = NULL;
|
||||
|
|
@ -471,8 +471,6 @@ LLGLManager::LLGLManager() :
|
|||
|
||||
mHasSeparateSpecularColor(FALSE),
|
||||
|
||||
mDebugGPU(FALSE),
|
||||
|
||||
mDriverVersionMajor(1),
|
||||
mDriverVersionMinor(0),
|
||||
mDriverVersionRelease(0),
|
||||
|
|
@ -854,10 +852,6 @@ bool LLGLManager::initGL()
|
|||
|
||||
stop_glerror();
|
||||
|
||||
setToDebugGPU();
|
||||
|
||||
stop_glerror();
|
||||
|
||||
initGLStates();
|
||||
|
||||
stop_glerror();
|
||||
|
|
@ -865,17 +859,6 @@ bool LLGLManager::initGL()
|
|||
return true;
|
||||
}
|
||||
|
||||
void LLGLManager::setToDebugGPU()
|
||||
{
|
||||
//"MOBILE INTEL(R) 965 EXPRESS CHIP",
|
||||
if (mGLRenderer.find("INTEL") != std::string::npos && mGLRenderer.find("965") != std::string::npos)
|
||||
{
|
||||
mDebugGPU = TRUE ;
|
||||
}
|
||||
|
||||
return ;
|
||||
}
|
||||
|
||||
void LLGLManager::getGLInfo(LLSD& info)
|
||||
{
|
||||
if (gHeadlessClient)
|
||||
|
|
@ -1032,7 +1015,6 @@ void LLGLManager::asLLSD(LLSD& info)
|
|||
// Other fields
|
||||
info["has_requirements"] = mHasRequirements;
|
||||
info["has_separate_specular_color"] = mHasSeparateSpecularColor;
|
||||
info["debug_gpu"] = mDebugGPU;
|
||||
info["max_vertex_range"] = mGLMaxVertexRange;
|
||||
info["max_index_range"] = mGLMaxIndexRange;
|
||||
info["max_texture_size"] = mGLMaxTextureSize;
|
||||
|
|
@ -1167,7 +1149,7 @@ void LLGLManager::initExtensions()
|
|||
mHasFragmentShader = ExtensionExists("GL_ARB_fragment_shader", gGLHExts.mSysExts) && (LLRender::sGLCoreProfile || ExtensionExists("GL_ARB_shading_language_100", gGLHExts.mSysExts));
|
||||
#endif
|
||||
|
||||
#if LL_LINUX || LL_SOLARIS
|
||||
#if LL_LINUX
|
||||
LL_INFOS() << "initExtensions() checking shell variables to adjust features..." << LL_ENDL;
|
||||
// Our extension support for the Linux Client is very young with some
|
||||
// potential driver gotchas, so offer a semi-secret way to turn it off.
|
||||
|
|
@ -1237,7 +1219,7 @@ void LLGLManager::initExtensions()
|
|||
if (strchr(blacklist,'u')) mHasDepthClamp = FALSE;
|
||||
|
||||
}
|
||||
#endif // LL_LINUX || LL_SOLARIS
|
||||
#endif // LL_LINUX
|
||||
|
||||
if (!mHasMultitexture)
|
||||
{
|
||||
|
|
@ -1315,7 +1297,7 @@ void LLGLManager::initExtensions()
|
|||
glGetIntegerv(GL_MAX_ELEMENTS_INDICES, (GLint*) &mGLMaxIndexRange);
|
||||
glGetIntegerv(GL_MAX_TEXTURE_SIZE, (GLint*) &mGLMaxTextureSize);
|
||||
|
||||
#if (LL_WINDOWS || LL_LINUX || LL_SOLARIS) && !LL_MESA_HEADLESS
|
||||
#if (LL_WINDOWS || LL_LINUX) && !LL_MESA_HEADLESS
|
||||
LL_DEBUGS("RenderInit") << "GL Probe: Getting symbols" << LL_ENDL;
|
||||
if (mHasVertexBufferObject)
|
||||
{
|
||||
|
|
@ -1414,7 +1396,7 @@ void LLGLManager::initExtensions()
|
|||
glDebugMessageCallbackARB = (PFNGLDEBUGMESSAGECALLBACKARBPROC) GLH_EXT_GET_PROC_ADDRESS("glDebugMessageCallbackARB");
|
||||
glGetDebugMessageLogARB = (PFNGLGETDEBUGMESSAGELOGARBPROC) GLH_EXT_GET_PROC_ADDRESS("glGetDebugMessageLogARB");
|
||||
}
|
||||
#if (!LL_LINUX && !LL_SOLARIS) || LL_LINUX_NV_GL_HEADERS
|
||||
#if (!LL_LINUX) || LL_LINUX_NV_GL_HEADERS
|
||||
// This is expected to be a static symbol on Linux GL implementations, except if we use the nvidia headers - bah
|
||||
glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawRangeElements");
|
||||
if (!glDrawRangeElements)
|
||||
|
|
@ -2775,8 +2757,9 @@ LLGLSPipelineBlendSkyBox::LLGLSPipelineBlendSkyBox(bool depth_test, bool depth_w
|
|||
|
||||
#if LL_WINDOWS
|
||||
// Expose desired use of high-performance graphics processor to Optimus driver and to AMD driver
|
||||
// https://docs.nvidia.com/gameworks/content/technologies/desktop/optimus.htm
|
||||
extern "C"
|
||||
{
|
||||
{
|
||||
__declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
|
||||
__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -142,9 +142,6 @@ public:
|
|||
// Misc extensions
|
||||
BOOL mHasSeparateSpecularColor;
|
||||
|
||||
//whether this GPU is in the debug list.
|
||||
BOOL mDebugGPU;
|
||||
|
||||
S32 mDriverVersionMajor;
|
||||
S32 mDriverVersionMinor;
|
||||
S32 mDriverVersionRelease;
|
||||
|
|
@ -178,7 +175,6 @@ private:
|
|||
void initExtensions();
|
||||
void initGLStates();
|
||||
void initGLImages();
|
||||
void setToDebugGPU();
|
||||
};
|
||||
|
||||
extern LLGLManager gGLManager;
|
||||
|
|
|
|||
|
|
@ -27,242 +27,7 @@
|
|||
#ifndef LL_LLGLHEADERS_H
|
||||
#define LL_LLGLHEADERS_H
|
||||
|
||||
#if LL_SOLARIS
|
||||
# if defined(__sparc)
|
||||
# define I_NEED_OS2_H // avoiding BOOL conflicts
|
||||
# endif
|
||||
# include "GL/gl.h"
|
||||
# if defined(__sparc)
|
||||
# undef I_NEED_OS2_H
|
||||
# ifdef BOOL
|
||||
# undef BOOL // now get rid of Xmd.h crap
|
||||
# endif
|
||||
# endif
|
||||
# include "GL/glx.h"
|
||||
# define GL_GLEXT_PROTOTYPES 1
|
||||
# include "GL/glext.h"
|
||||
# include "GL/glu.h"
|
||||
# include "GL/glx.h"
|
||||
# define GLX_GLXEXT_PROTOTYPES 1
|
||||
# include "GL/glxext.h"
|
||||
//# define GLH_EXT_GET_PROC_ADDRESS(p) glXGetProcAddressARB((const GLubyte*)(p))
|
||||
# define GLH_EXT_GET_PROC_ADDRESS(p) glXGetProcAddress((const GLubyte*)(p))
|
||||
|
||||
// The __APPLE__ kludge is to make glh_extensions.h not symbol-clash horribly
|
||||
// This header is distributed with SL. You'll find it in linden/libraries/include/GL/
|
||||
# define __APPLE__
|
||||
# include "GL/glh_extensions.h"
|
||||
# undef __APPLE__
|
||||
|
||||
|
||||
// GL_ARB_vertex_buffer_object
|
||||
extern PFNGLBINDBUFFERARBPROC glBindBufferARB;
|
||||
extern PFNGLDELETEBUFFERSARBPROC glDeleteBuffersARB;
|
||||
extern PFNGLGENBUFFERSARBPROC glGenBuffersARB;
|
||||
extern PFNGLISBUFFERARBPROC glIsBufferARB;
|
||||
extern PFNGLBUFFERDATAARBPROC glBufferDataARB;
|
||||
extern PFNGLBUFFERSUBDATAARBPROC glBufferSubDataARB;
|
||||
extern PFNGLGETBUFFERSUBDATAARBPROC glGetBufferSubDataARB;
|
||||
extern PFNGLMAPBUFFERARBPROC glMapBufferARB;
|
||||
extern PFNGLUNMAPBUFFERARBPROC glUnmapBufferARB;
|
||||
extern PFNGLGETBUFFERPARAMETERIVARBPROC glGetBufferParameterivARB;
|
||||
extern PFNGLGETBUFFERPOINTERVARBPROC glGetBufferPointervARB;
|
||||
|
||||
// GL_ARB_vertex_array_object
|
||||
extern PFNGLBINDVERTEXARRAYPROC glBindVertexArray;
|
||||
extern PFNGLDELETEVERTEXARRAYSPROC glDeleteVertexArrays;
|
||||
extern PFNGLGENVERTEXARRAYSPROC glGenVertexArrays;
|
||||
extern PFNGLISVERTEXARRAYPROC glIsVertexArray;
|
||||
|
||||
// GL_ARB_sync
|
||||
extern PFNGLFENCESYNCPROC glFenceSync;
|
||||
extern PFNGLISSYNCPROC glIsSync;
|
||||
extern PFNGLDELETESYNCPROC glDeleteSync;
|
||||
extern PFNGLCLIENTWAITSYNCPROC glClientWaitSync;
|
||||
extern PFNGLWAITSYNCPROC glWaitSync;
|
||||
extern PFNGLGETINTEGER64VPROC glGetInteger64v;
|
||||
extern PFNGLGETSYNCIVPROC glGetSynciv;
|
||||
|
||||
// GL_APPLE_flush_buffer_range
|
||||
extern PFNGLBUFFERPARAMETERIAPPLEPROC glBufferParameteriAPPLE;
|
||||
extern PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC glFlushMappedBufferRangeAPPLE;
|
||||
|
||||
// GL_ARB_map_buffer_range
|
||||
extern PFNGLMAPBUFFERRANGEPROC glMapBufferRange;
|
||||
extern PFNGLFLUSHMAPPEDBUFFERRANGEPROC glFlushMappedBufferRange;
|
||||
|
||||
// GL_ATI_vertex_array_object
|
||||
extern PFNGLNEWOBJECTBUFFERATIPROC glNewObjectBufferATI;
|
||||
extern PFNGLISOBJECTBUFFERATIPROC glIsObjectBufferATI;
|
||||
extern PFNGLUPDATEOBJECTBUFFERATIPROC glUpdateObjectBufferATI;
|
||||
extern PFNGLGETOBJECTBUFFERFVATIPROC glGetObjectBufferfvATI;
|
||||
extern PFNGLGETOBJECTBUFFERIVATIPROC glGetObjectBufferivATI;
|
||||
extern PFNGLFREEOBJECTBUFFERATIPROC glFreeObjectBufferATI;
|
||||
extern PFNGLARRAYOBJECTATIPROC glArrayObjectATI;
|
||||
extern PFNGLVERTEXATTRIBARRAYOBJECTATIPROC glVertexAttribArrayObjectATI;
|
||||
extern PFNGLGETARRAYOBJECTFVATIPROC glGetArrayObjectfvATI;
|
||||
extern PFNGLGETARRAYOBJECTIVATIPROC glGetArrayObjectivATI;
|
||||
extern PFNGLVARIANTARRAYOBJECTATIPROC glVariantObjectArrayATI;
|
||||
extern PFNGLGETVARIANTARRAYOBJECTFVATIPROC glGetVariantArrayObjectfvATI;
|
||||
extern PFNGLGETVARIANTARRAYOBJECTIVATIPROC glGetVariantArrayObjectivATI;
|
||||
|
||||
// GL_ARB_occlusion_query
|
||||
extern PFNGLGENQUERIESARBPROC glGenQueriesARB;
|
||||
extern PFNGLDELETEQUERIESARBPROC glDeleteQueriesARB;
|
||||
extern PFNGLISQUERYARBPROC glIsQueryARB;
|
||||
extern PFNGLBEGINQUERYARBPROC glBeginQueryARB;
|
||||
extern PFNGLENDQUERYARBPROC glEndQueryARB;
|
||||
extern PFNGLGETQUERYIVARBPROC glGetQueryivARB;
|
||||
extern PFNGLGETQUERYOBJECTIVARBPROC glGetQueryObjectivARB;
|
||||
extern PFNGLGETQUERYOBJECTUIVARBPROC glGetQueryObjectuivARB;
|
||||
|
||||
// GL_ARB_timer_query
|
||||
extern PFNGLQUERYCOUNTERPROC glQueryCounter;
|
||||
extern PFNGLGETQUERYOBJECTI64VPROC glGetQueryObjecti64v;
|
||||
extern PFNGLGETQUERYOBJECTUI64VPROC glGetQueryObjectui64v;
|
||||
|
||||
// GL_ARB_point_parameters
|
||||
extern PFNGLPOINTPARAMETERFARBPROC glPointParameterfARB;
|
||||
extern PFNGLPOINTPARAMETERFVARBPROC glPointParameterfvARB;
|
||||
|
||||
// GL_ARB_shader_objects
|
||||
extern PFNGLDELETEOBJECTARBPROC glDeleteObjectARB;
|
||||
extern PFNGLGETHANDLEARBPROC glGetHandleARB;
|
||||
extern PFNGLDETACHOBJECTARBPROC glDetachObjectARB;
|
||||
extern PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB;
|
||||
extern PFNGLSHADERSOURCEARBPROC glShaderSourceARB;
|
||||
extern PFNGLCOMPILESHADERARBPROC glCompileShaderARB;
|
||||
extern PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB;
|
||||
extern PFNGLATTACHOBJECTARBPROC glAttachObjectARB;
|
||||
extern PFNGLLINKPROGRAMARBPROC glLinkProgramARB;
|
||||
extern PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB;
|
||||
extern PFNGLVALIDATEPROGRAMARBPROC glValidateProgramARB;
|
||||
extern PFNGLUNIFORM1FARBPROC glUniform1fARB;
|
||||
extern PFNGLUNIFORM2FARBPROC glUniform2fARB;
|
||||
extern PFNGLUNIFORM3FARBPROC glUniform3fARB;
|
||||
extern PFNGLUNIFORM4FARBPROC glUniform4fARB;
|
||||
extern PFNGLUNIFORM1IARBPROC glUniform1iARB;
|
||||
extern PFNGLUNIFORM2IARBPROC glUniform2iARB;
|
||||
extern PFNGLUNIFORM3IARBPROC glUniform3iARB;
|
||||
extern PFNGLUNIFORM4IARBPROC glUniform4iARB;
|
||||
extern PFNGLUNIFORM1FVARBPROC glUniform1fvARB;
|
||||
extern PFNGLUNIFORM2FVARBPROC glUniform2fvARB;
|
||||
extern PFNGLUNIFORM3FVARBPROC glUniform3fvARB;
|
||||
extern PFNGLUNIFORM4FVARBPROC glUniform4fvARB;
|
||||
extern PFNGLUNIFORM1IVARBPROC glUniform1ivARB;
|
||||
extern PFNGLUNIFORM2IVARBPROC glUniform2ivARB;
|
||||
extern PFNGLUNIFORM3IVARBPROC glUniform3ivARB;
|
||||
extern PFNGLUNIFORM4IVARBPROC glUniform4ivARB;
|
||||
extern PFNGLUNIFORMMATRIX2FVARBPROC glUniformMatrix2fvARB;
|
||||
extern PFNGLUNIFORMMATRIX3FVARBPROC glUniformMatrix3fvARB;
|
||||
extern PFNGLUNIFORMMATRIX3X4FVPROC glUniformMatrix3x4fv;
|
||||
extern PFNGLUNIFORMMATRIX4FVARBPROC glUniformMatrix4fvARB;
|
||||
extern PFNGLGETOBJECTPARAMETERFVARBPROC glGetObjectParameterfvARB;
|
||||
extern PFNGLGETOBJECTPARAMETERIVARBPROC glGetObjectParameterivARB;
|
||||
extern PFNGLGETINFOLOGARBPROC glGetInfoLogARB;
|
||||
extern PFNGLGETATTACHEDOBJECTSARBPROC glGetAttachedObjectsARB;
|
||||
extern PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB;
|
||||
extern PFNGLGETACTIVEUNIFORMARBPROC glGetActiveUniformARB;
|
||||
extern PFNGLGETUNIFORMFVARBPROC glGetUniformfvARB;
|
||||
extern PFNGLGETUNIFORMIVARBPROC glGetUniformivARB;
|
||||
extern PFNGLGETSHADERSOURCEARBPROC glGetShaderSourceARB;
|
||||
|
||||
// GL_ARB_vertex_shader
|
||||
extern PFNGLVERTEXATTRIB1DARBPROC glVertexAttrib1dARB;
|
||||
extern PFNGLVERTEXATTRIB1DVARBPROC glVertexAttrib1dvARB;
|
||||
extern PFNGLVERTEXATTRIB1FARBPROC glVertexAttrib1fARB;
|
||||
extern PFNGLVERTEXATTRIB1FVARBPROC glVertexAttrib1fvARB;
|
||||
extern PFNGLVERTEXATTRIB1SARBPROC glVertexAttrib1sARB;
|
||||
extern PFNGLVERTEXATTRIB1SVARBPROC glVertexAttrib1svARB;
|
||||
extern PFNGLVERTEXATTRIB2DARBPROC glVertexAttrib2dARB;
|
||||
extern PFNGLVERTEXATTRIB2DVARBPROC glVertexAttrib2dvARB;
|
||||
extern PFNGLVERTEXATTRIB2FARBPROC glVertexAttrib2fARB;
|
||||
extern PFNGLVERTEXATTRIB2FVARBPROC glVertexAttrib2fvARB;
|
||||
extern PFNGLVERTEXATTRIB2SARBPROC glVertexAttrib2sARB;
|
||||
extern PFNGLVERTEXATTRIB2SVARBPROC glVertexAttrib2svARB;
|
||||
extern PFNGLVERTEXATTRIB3DARBPROC glVertexAttrib3dARB;
|
||||
extern PFNGLVERTEXATTRIB3DVARBPROC glVertexAttrib3dvARB;
|
||||
extern PFNGLVERTEXATTRIB3FARBPROC glVertexAttrib3fARB;
|
||||
extern PFNGLVERTEXATTRIB3FVARBPROC glVertexAttrib3fvARB;
|
||||
extern PFNGLVERTEXATTRIB3SARBPROC glVertexAttrib3sARB;
|
||||
extern PFNGLVERTEXATTRIB3SVARBPROC glVertexAttrib3svARB;
|
||||
extern PFNGLVERTEXATTRIB4NBVARBPROC glVertexAttrib4nbvARB;
|
||||
extern PFNGLVERTEXATTRIB4NIVARBPROC glVertexAttrib4nivARB;
|
||||
extern PFNGLVERTEXATTRIB4NSVARBPROC glVertexAttrib4nsvARB;
|
||||
extern PFNGLVERTEXATTRIB4NUBARBPROC glVertexAttrib4nubARB;
|
||||
extern PFNGLVERTEXATTRIB4NUBVARBPROC glVertexAttrib4nubvARB;
|
||||
extern PFNGLVERTEXATTRIB4NUIVARBPROC glVertexAttrib4nuivARB;
|
||||
extern PFNGLVERTEXATTRIB4NUSVARBPROC glVertexAttrib4nusvARB;
|
||||
extern PFNGLVERTEXATTRIB4BVARBPROC glVertexAttrib4bvARB;
|
||||
extern PFNGLVERTEXATTRIB4DARBPROC glVertexAttrib4dARB;
|
||||
extern PFNGLVERTEXATTRIB4DVARBPROC glVertexAttrib4dvARB;
|
||||
extern PFNGLVERTEXATTRIB4FARBPROC glVertexAttrib4fARB;
|
||||
extern PFNGLVERTEXATTRIB4FVARBPROC glVertexAttrib4fvARB;
|
||||
extern PFNGLVERTEXATTRIB4IVARBPROC glVertexAttrib4ivARB;
|
||||
extern PFNGLVERTEXATTRIB4SARBPROC glVertexAttrib4sARB;
|
||||
extern PFNGLVERTEXATTRIB4SVARBPROC glVertexAttrib4svARB;
|
||||
extern PFNGLVERTEXATTRIB4UBVARBPROC glVertexAttrib4ubvARB;
|
||||
extern PFNGLVERTEXATTRIB4UIVARBPROC glVertexAttrib4uivARB;
|
||||
extern PFNGLVERTEXATTRIB4USVARBPROC glVertexAttrib4usvARB;
|
||||
extern PFNGLVERTEXATTRIBPOINTERARBPROC glVertexAttribPointerARB;
|
||||
extern PFNGLVERTEXATTRIBIPOINTERPROC glVertexAttribIPointer;
|
||||
extern PFNGLENABLEVERTEXATTRIBARRAYARBPROC glEnableVertexAttribArrayARB;
|
||||
extern PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glDisableVertexAttribArrayARB;
|
||||
extern PFNGLPROGRAMSTRINGARBPROC glProgramStringARB;
|
||||
extern PFNGLBINDPROGRAMARBPROC glBindProgramARB;
|
||||
extern PFNGLDELETEPROGRAMSARBPROC glDeleteProgramsARB;
|
||||
extern PFNGLGENPROGRAMSARBPROC glGenProgramsARB;
|
||||
extern PFNGLPROGRAMENVPARAMETER4DARBPROC glProgramEnvParameter4dARB;
|
||||
extern PFNGLPROGRAMENVPARAMETER4DVARBPROC glProgramEnvParameter4dvARB;
|
||||
extern PFNGLPROGRAMENVPARAMETER4FARBPROC glProgramEnvParameter4fARB;
|
||||
extern PFNGLPROGRAMENVPARAMETER4FVARBPROC glProgramEnvParameter4fvARB;
|
||||
extern PFNGLPROGRAMLOCALPARAMETER4DARBPROC glProgramLocalParameter4dARB;
|
||||
extern PFNGLPROGRAMLOCALPARAMETER4DVARBPROC glProgramLocalParameter4dvARB;
|
||||
extern PFNGLPROGRAMLOCALPARAMETER4FARBPROC glProgramLocalParameter4fARB;
|
||||
extern PFNGLPROGRAMLOCALPARAMETER4FVARBPROC glProgramLocalParameter4fvARB;
|
||||
extern PFNGLGETPROGRAMENVPARAMETERDVARBPROC glGetProgramEnvParameterdvARB;
|
||||
extern PFNGLGETPROGRAMENVPARAMETERFVARBPROC glGetProgramEnvParameterfvARB;
|
||||
extern PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC glGetProgramLocalParameterdvARB;
|
||||
extern PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC glGetProgramLocalParameterfvARB;
|
||||
extern PFNGLGETPROGRAMIVARBPROC glGetProgramivARB;
|
||||
extern PFNGLGETPROGRAMSTRINGARBPROC glGetProgramStringARB;
|
||||
extern PFNGLGETVERTEXATTRIBDVARBPROC glGetVertexAttribdvARB;
|
||||
extern PFNGLGETVERTEXATTRIBFVARBPROC glGetVertexAttribfvARB;
|
||||
extern PFNGLGETVERTEXATTRIBIVARBPROC glGetVertexAttribivARB;
|
||||
extern PFNGLGETVERTEXATTRIBPOINTERVARBPROC glGetVertexAttribPointervARB;
|
||||
extern PFNGLISPROGRAMARBPROC glIsProgramARB;
|
||||
extern PFNGLBINDATTRIBLOCATIONARBPROC glBindAttribLocationARB;
|
||||
extern PFNGLGETACTIVEATTRIBARBPROC glGetActiveAttribARB;
|
||||
extern PFNGLGETATTRIBLOCATIONARBPROC glGetAttribLocationARB;
|
||||
|
||||
extern PFNGLCOMPRESSEDTEXIMAGE2DARBPROC glCompressedTexImage2DARB;
|
||||
extern PFNGLGETCOMPRESSEDTEXIMAGEARBPROC glGetCompressedTexImageARB;
|
||||
|
||||
extern PFNGLCOLORTABLEEXTPROC glColorTableEXT;
|
||||
|
||||
//GL_EXT_blend_func_separate
|
||||
extern PFNGLBLENDFUNCSEPARATEEXTPROC glBlendFuncSeparateEXT;
|
||||
|
||||
//GL_EXT_framebuffer_object
|
||||
extern PFNGLISRENDERBUFFEREXTPROC glIsRenderbufferEXT;
|
||||
extern PFNGLBINDRENDERBUFFEREXTPROC glBindRenderbufferEXT;
|
||||
extern PFNGLDELETERENDERBUFFERSEXTPROC glDeleteRenderbuffersEXT;
|
||||
extern PFNGLGENRENDERBUFFERSEXTPROC glGenRenderbuffersEXT;
|
||||
extern PFNGLRENDERBUFFERSTORAGEEXTPROC glRenderbufferStorageEXT;
|
||||
extern PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC glGetRenderbufferParameterivEXT;
|
||||
extern PFNGLISFRAMEBUFFEREXTPROC glIsFramebufferEXT;
|
||||
extern PFNGLBINDFRAMEBUFFEREXTPROC glBindFramebufferEXT;
|
||||
extern PFNGLDELETEFRAMEBUFFERSEXTPROC glDeleteFramebuffersEXT;
|
||||
extern PFNGLGENFRAMEBUFFERSEXTPROC glGenFramebuffersEXT;
|
||||
extern PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glCheckFramebufferStatusEXT;
|
||||
extern PFNGLFRAMEBUFFERTEXTURE1DEXTPROC glFramebufferTexture1DEXT;
|
||||
extern PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glFramebufferTexture2DEXT;
|
||||
extern PFNGLFRAMEBUFFERTEXTURE3DEXTPROC glFramebufferTexture3DEXT;
|
||||
extern PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glFramebufferRenderbufferEXT;
|
||||
extern PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glGetFramebufferAttachmentParameterivEXT;
|
||||
extern PFNGLGENERATEMIPMAPEXTPROC glGenerateMipmapEXT;
|
||||
|
||||
#elif LL_MESA
|
||||
#if LL_MESA
|
||||
//----------------------------------------------------------------------------
|
||||
// MESA headers
|
||||
// quotes so we get libraries/.../GL/ version
|
||||
|
|
|
|||
|
|
@ -37,6 +37,10 @@
|
|||
#include "OpenGL/OpenGL.h"
|
||||
#endif
|
||||
|
||||
// Print-print list of shader included source files that are linked together via glAttachObjectARB()
|
||||
// i.e. On macOS / OSX the AMD GLSL linker will display an error if a varying is left in an undefined state.
|
||||
#define DEBUG_SHADER_INCLUDES 0
|
||||
|
||||
// Lots of STL stuff in here, using namespace std to keep things more readable
|
||||
using std::vector;
|
||||
using std::pair;
|
||||
|
|
@ -392,16 +396,28 @@ BOOL LLGLSLShader::createShader(std::vector<LLStaticHashedString> * attributes,
|
|||
mLightHash = 0xFFFFFFFF;
|
||||
|
||||
llassert_always(!mShaderFiles.empty());
|
||||
BOOL success = TRUE;
|
||||
|
||||
// Create program
|
||||
mProgramObject = glCreateProgramObjectARB();
|
||||
if (mProgramObject == 0)
|
||||
{
|
||||
// Shouldn't happen if shader related extensions, like ARB_vertex_shader, exist.
|
||||
LL_SHADER_LOADING_WARNS() << "Failed to create handle for shader: " << mName << LL_ENDL;
|
||||
unloadInternal();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL success = TRUE;
|
||||
|
||||
#if LL_DARWIN
|
||||
// work-around missing mix(vec3,vec3,bvec3)
|
||||
mDefines["OLD_SELECT"] = "1";
|
||||
#endif
|
||||
|
||||
#if DEBUG_SHADER_INCLUDES
|
||||
fprintf(stderr, "--- %s ---\n", mName.c_str());
|
||||
#endif // DEBUG_SHADER_INCLUDES
|
||||
|
||||
//compile new source
|
||||
vector< pair<string,GLenum> >::iterator fileIter = mShaderFiles.begin();
|
||||
for ( ; fileIter != mShaderFiles.end(); fileIter++ )
|
||||
|
|
@ -485,11 +501,36 @@ BOOL LLGLSLShader::createShader(std::vector<LLStaticHashedString> * attributes,
|
|||
return success;
|
||||
}
|
||||
|
||||
BOOL LLGLSLShader::attachVertexObject(std::string object_path) {
|
||||
#if DEBUG_SHADER_INCLUDES
|
||||
void dumpAttachObject( const char *func_name, GLhandleARB program_object, const std::string &object_path )
|
||||
{
|
||||
GLcharARB* info_log;
|
||||
GLint info_len_expect = 0;
|
||||
GLint info_len_actual = 0;
|
||||
|
||||
glGetObjectParameterivARB(program_object, GL_OBJECT_INFO_LOG_LENGTH_ARB, &info_len_expect);
|
||||
fprintf(stderr, " * %-20s(), log size: %d, %s\n", func_name, info_len_expect, object_path.c_str());
|
||||
|
||||
if (info_len_expect > 0)
|
||||
{
|
||||
fprintf(stderr, " ========== %s() ========== \n", func_name);
|
||||
info_log = new GLcharARB [ info_len_expect ];
|
||||
glGetInfoLogARB(program_object, info_len_expect, &info_len_actual, info_log);
|
||||
fprintf(stderr, "%s\n", info_log);
|
||||
delete [] info_log;
|
||||
}
|
||||
}
|
||||
#endif // DEBUG_SHADER_INCLUDES
|
||||
|
||||
BOOL LLGLSLShader::attachVertexObject(std::string object_path)
|
||||
{
|
||||
if (LLShaderMgr::instance()->mVertexShaderObjects.count(object_path) > 0)
|
||||
{
|
||||
stop_glerror();
|
||||
glAttachObjectARB(mProgramObject, LLShaderMgr::instance()->mVertexShaderObjects[object_path]);
|
||||
#if DEBUG_SHADER_INCLUDES
|
||||
dumpAttachObject("attachVertexObject", mProgramObject, object_path);
|
||||
#endif // DEBUG_SHADER_INCLUDES
|
||||
stop_glerror();
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -506,6 +547,9 @@ BOOL LLGLSLShader::attachFragmentObject(std::string object_path)
|
|||
{
|
||||
stop_glerror();
|
||||
glAttachObjectARB(mProgramObject, LLShaderMgr::instance()->mFragmentShaderObjects[object_path]);
|
||||
#if DEBUG_SHADER_INCLUDES
|
||||
dumpAttachObject("attachFragmentObject", mProgramObject, object_path);
|
||||
#endif // DEBUG_SHADER_INCLUDES
|
||||
stop_glerror();
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -522,6 +566,10 @@ void LLGLSLShader::attachObject(GLhandleARB object)
|
|||
{
|
||||
stop_glerror();
|
||||
glAttachObjectARB(mProgramObject, object);
|
||||
#if DEBUG_SHADER_INCLUDES
|
||||
std::string object_path("???");
|
||||
dumpAttachObject("attachObject", mProgramObject, object_path);
|
||||
#endif // DEBUG_SHADER_INCLUDES
|
||||
stop_glerror();
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -871,10 +871,10 @@ void LLTexUnit::setTextureColorSpace(eTextureColorSpace space)
|
|||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
glTexParameteri(sGLTextureType[mCurrTexType], GL_TEXTURE_SRGB_DECODE_EXT, GL_SKIP_DECODE_EXT);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
LLLightState::LLLightState(S32 index)
|
||||
|
|
|
|||
|
|
@ -611,13 +611,11 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
|
|||
#endif
|
||||
|
||||
GLenum error = GL_NO_ERROR;
|
||||
if (gDebugGL)
|
||||
|
||||
error = glGetError();
|
||||
if (error != GL_NO_ERROR)
|
||||
{
|
||||
error = glGetError();
|
||||
if (error != GL_NO_ERROR)
|
||||
{
|
||||
LL_SHADER_LOADING_WARNS() << "GL ERROR entering loadShaderFile(): " << error << LL_ENDL;
|
||||
}
|
||||
LL_SHADER_LOADING_WARNS() << "GL ERROR entering loadShaderFile(): " << error << " for file: " << filename << LL_ENDL;
|
||||
}
|
||||
|
||||
if (filename.empty())
|
||||
|
|
@ -966,55 +964,45 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
|
|||
|
||||
//create shader object
|
||||
GLhandleARB ret = glCreateShaderObjectARB(type);
|
||||
if (gDebugGL)
|
||||
|
||||
error = glGetError();
|
||||
if (error != GL_NO_ERROR)
|
||||
{
|
||||
error = glGetError();
|
||||
if (error != GL_NO_ERROR)
|
||||
{
|
||||
LL_WARNS("ShaderLoading") << "GL ERROR in glCreateShaderObjectARB: " << error << LL_ENDL;
|
||||
}
|
||||
LL_WARNS("ShaderLoading") << "GL ERROR in glCreateShaderObjectARB: " << error << " for file: " << open_file_name << LL_ENDL;
|
||||
}
|
||||
|
||||
|
||||
//load source
|
||||
glShaderSourceARB(ret, shader_code_count, (const GLcharARB**) shader_code_text, NULL);
|
||||
|
||||
if (gDebugGL)
|
||||
error = glGetError();
|
||||
if (error != GL_NO_ERROR)
|
||||
{
|
||||
error = glGetError();
|
||||
if (error != GL_NO_ERROR)
|
||||
{
|
||||
LL_WARNS("ShaderLoading") << "GL ERROR in glShaderSourceARB: " << error << LL_ENDL;
|
||||
}
|
||||
LL_WARNS("ShaderLoading") << "GL ERROR in glShaderSourceARB: " << error << " for file: " << open_file_name << LL_ENDL;
|
||||
}
|
||||
|
||||
//compile source
|
||||
glCompileShaderARB(ret);
|
||||
|
||||
if (gDebugGL)
|
||||
error = glGetError();
|
||||
if (error != GL_NO_ERROR)
|
||||
{
|
||||
error = glGetError();
|
||||
if (error != GL_NO_ERROR)
|
||||
{
|
||||
LL_WARNS("ShaderLoading") << "GL ERROR in glCompileShaderARB: " << error << LL_ENDL;
|
||||
}
|
||||
LL_WARNS("ShaderLoading") << "GL ERROR in glCompileShaderARB: " << error << " for file: " << open_file_name << LL_ENDL;
|
||||
}
|
||||
|
||||
|
||||
if (error == GL_NO_ERROR)
|
||||
{
|
||||
//check for errors
|
||||
GLint success = GL_TRUE;
|
||||
glGetObjectParameterivARB(ret, GL_OBJECT_COMPILE_STATUS_ARB, &success);
|
||||
if (gDebugGL || success == GL_FALSE)
|
||||
|
||||
error = glGetError();
|
||||
if (error != GL_NO_ERROR || success == GL_FALSE)
|
||||
{
|
||||
error = glGetError();
|
||||
if (error != GL_NO_ERROR || success == GL_FALSE)
|
||||
{
|
||||
//an error occured, print log
|
||||
LL_WARNS("ShaderLoading") << "GLSL Compilation Error:" << LL_ENDL;
|
||||
dumpObjectLog(ret, TRUE, open_file_name);
|
||||
dumpShaderSource(shader_code_count, shader_code_text);
|
||||
ret = 0;
|
||||
}
|
||||
//an error occured, print log
|
||||
LL_WARNS("ShaderLoading") << "GLSL Compilation Error:" << LL_ENDL;
|
||||
dumpObjectLog(ret, TRUE, open_file_name);
|
||||
dumpShaderSource(shader_code_count, shader_code_text);
|
||||
ret = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -36,175 +36,176 @@ public:
|
|||
LLShaderMgr();
|
||||
virtual ~LLShaderMgr();
|
||||
|
||||
typedef enum
|
||||
{
|
||||
MODELVIEW_MATRIX = 0,
|
||||
PROJECTION_MATRIX,
|
||||
INVERSE_PROJECTION_MATRIX,
|
||||
MODELVIEW_PROJECTION_MATRIX,
|
||||
INVERSE_MODELVIEW_MATRIX,
|
||||
NORMAL_MATRIX,
|
||||
TEXTURE_MATRIX0,
|
||||
TEXTURE_MATRIX1,
|
||||
TEXTURE_MATRIX2,
|
||||
TEXTURE_MATRIX3,
|
||||
OBJECT_PLANE_S,
|
||||
OBJECT_PLANE_T,
|
||||
VIEWPORT,
|
||||
LIGHT_POSITION,
|
||||
LIGHT_DIRECTION,
|
||||
LIGHT_ATTENUATION,
|
||||
LIGHT_DIFFUSE,
|
||||
LIGHT_AMBIENT,
|
||||
MULTI_LIGHT_COUNT,
|
||||
MULTI_LIGHT,
|
||||
MULTI_LIGHT_COL,
|
||||
MULTI_LIGHT_FAR_Z,
|
||||
PROJECTOR_MATRIX,
|
||||
PROJECTOR_NEAR,
|
||||
PROJECTOR_P,
|
||||
PROJECTOR_N,
|
||||
PROJECTOR_ORIGIN,
|
||||
PROJECTOR_RANGE,
|
||||
PROJECTOR_AMBIANCE,
|
||||
PROJECTOR_SHADOW_INDEX,
|
||||
PROJECTOR_SHADOW_FADE,
|
||||
PROJECTOR_FOCUS,
|
||||
PROJECTOR_LOD,
|
||||
PROJECTOR_AMBIENT_LOD,
|
||||
DIFFUSE_COLOR,
|
||||
DIFFUSE_MAP,
|
||||
ALTERNATE_DIFFUSE_MAP,
|
||||
SPECULAR_MAP,
|
||||
BUMP_MAP,
|
||||
BUMP_MAP2,
|
||||
ENVIRONMENT_MAP,
|
||||
CLOUD_NOISE_MAP,
|
||||
CLOUD_NOISE_MAP_NEXT,
|
||||
FULLBRIGHT,
|
||||
LIGHTNORM,
|
||||
SUNLIGHT_COLOR,
|
||||
AMBIENT,
|
||||
BLUE_HORIZON,
|
||||
BLUE_DENSITY,
|
||||
HAZE_HORIZON,
|
||||
HAZE_DENSITY,
|
||||
CLOUD_SHADOW,
|
||||
DENSITY_MULTIPLIER,
|
||||
DISTANCE_MULTIPLIER,
|
||||
MAX_Y,
|
||||
GLOW,
|
||||
CLOUD_COLOR,
|
||||
CLOUD_POS_DENSITY1,
|
||||
CLOUD_POS_DENSITY2,
|
||||
CLOUD_SCALE,
|
||||
GAMMA,
|
||||
SCENE_LIGHT_STRENGTH,
|
||||
LIGHT_CENTER,
|
||||
LIGHT_SIZE,
|
||||
LIGHT_FALLOFF,
|
||||
BOX_CENTER,
|
||||
BOX_SIZE,
|
||||
// clang-format off
|
||||
typedef enum
|
||||
{ // Shader uniform name, set in LLShaderMgr::initAttribsAndUniforms()
|
||||
MODELVIEW_MATRIX = 0, // "modelview_matrix"
|
||||
PROJECTION_MATRIX, // "projection_matrix"
|
||||
INVERSE_PROJECTION_MATRIX, // "inv_proj"
|
||||
MODELVIEW_PROJECTION_MATRIX, // "modelview_projection_matrix"
|
||||
INVERSE_MODELVIEW_MATRIX, // "inv_modelview"
|
||||
NORMAL_MATRIX, // "normal_matrix"
|
||||
TEXTURE_MATRIX0, // "texture_matrix0"
|
||||
TEXTURE_MATRIX1, // "texture_matrix1"
|
||||
TEXTURE_MATRIX2, // "texture_matrix2"
|
||||
TEXTURE_MATRIX3, // "texture_matrix3"
|
||||
OBJECT_PLANE_S, // "object_plane_s"
|
||||
OBJECT_PLANE_T, // "object_plane_t"
|
||||
VIEWPORT, // "viewport"
|
||||
LIGHT_POSITION, // "light_position"
|
||||
LIGHT_DIRECTION, // "light_direction"
|
||||
LIGHT_ATTENUATION, // "light_attenuation"
|
||||
LIGHT_DIFFUSE, // "light_diffuse"
|
||||
LIGHT_AMBIENT, // "light_ambient"
|
||||
MULTI_LIGHT_COUNT, // "light_count"
|
||||
MULTI_LIGHT, // "light"
|
||||
MULTI_LIGHT_COL, // "light_col"
|
||||
MULTI_LIGHT_FAR_Z, // "far_z"
|
||||
PROJECTOR_MATRIX, // "proj_mat"
|
||||
PROJECTOR_NEAR, // "proj_near"
|
||||
PROJECTOR_P, // "proj_p"
|
||||
PROJECTOR_N, // "proj_n"
|
||||
PROJECTOR_ORIGIN, // "proj_origin"
|
||||
PROJECTOR_RANGE, // "proj_range"
|
||||
PROJECTOR_AMBIANCE, // "proj_ambiance"
|
||||
PROJECTOR_SHADOW_INDEX, // "proj_shadow_idx"
|
||||
PROJECTOR_SHADOW_FADE, // "shadow_fade"
|
||||
PROJECTOR_FOCUS, // "proj_focus"
|
||||
PROJECTOR_LOD, // "proj_lod"
|
||||
PROJECTOR_AMBIENT_LOD, // "proj_ambient_lod"
|
||||
DIFFUSE_COLOR, // "color"
|
||||
DIFFUSE_MAP, // "diffuseMap"
|
||||
ALTERNATE_DIFFUSE_MAP, // "altDiffuseMap"
|
||||
SPECULAR_MAP, // "specularMap"
|
||||
BUMP_MAP, // "bumpMap"
|
||||
BUMP_MAP2, // "bumpMap2"
|
||||
ENVIRONMENT_MAP, // "environmentMap"
|
||||
CLOUD_NOISE_MAP, // "cloud_noise_texture"
|
||||
CLOUD_NOISE_MAP_NEXT, // "cloud_noise_texture_next"
|
||||
FULLBRIGHT, // "fullbright"
|
||||
LIGHTNORM, // "lightnorm"
|
||||
SUNLIGHT_COLOR, // "sunlight_color"
|
||||
AMBIENT, // "ambient_color"
|
||||
BLUE_HORIZON, // "blue_horizon"
|
||||
BLUE_DENSITY, // "blue_density"
|
||||
HAZE_HORIZON, // "haze_horizon"
|
||||
HAZE_DENSITY, // "haze_density"
|
||||
CLOUD_SHADOW, // "cloud_shadow"
|
||||
DENSITY_MULTIPLIER, // "density_multiplier"
|
||||
DISTANCE_MULTIPLIER, // "distance_multiplier"
|
||||
MAX_Y, // "max_y"
|
||||
GLOW, // "glow"
|
||||
CLOUD_COLOR, // "cloud_color"
|
||||
CLOUD_POS_DENSITY1, // "cloud_pos_density1"
|
||||
CLOUD_POS_DENSITY2, // "cloud_pos_density2"
|
||||
CLOUD_SCALE, // "cloud_scale"
|
||||
GAMMA, // "gamma"
|
||||
SCENE_LIGHT_STRENGTH, // "scene_light_strength"
|
||||
LIGHT_CENTER, // "center"
|
||||
LIGHT_SIZE, // "size"
|
||||
LIGHT_FALLOFF, // "falloff"
|
||||
BOX_CENTER, // "box_center"
|
||||
BOX_SIZE, // "box_size"
|
||||
|
||||
GLOW_MIN_LUMINANCE,
|
||||
GLOW_MAX_EXTRACT_ALPHA,
|
||||
GLOW_LUM_WEIGHTS,
|
||||
GLOW_WARMTH_WEIGHTS,
|
||||
GLOW_WARMTH_AMOUNT,
|
||||
GLOW_STRENGTH,
|
||||
GLOW_DELTA,
|
||||
GLOW_MIN_LUMINANCE, // "minLuminance"
|
||||
GLOW_MAX_EXTRACT_ALPHA, // "maxExtractAlpha"
|
||||
GLOW_LUM_WEIGHTS, // "lumWeights"
|
||||
GLOW_WARMTH_WEIGHTS, // "warmthWeights"
|
||||
GLOW_WARMTH_AMOUNT, // "warmthAmount"
|
||||
GLOW_STRENGTH, // "glowStrength"
|
||||
GLOW_DELTA, // "glowDelta"
|
||||
|
||||
MINIMUM_ALPHA,
|
||||
EMISSIVE_BRIGHTNESS,
|
||||
MINIMUM_ALPHA, // "minimum_alpha"
|
||||
EMISSIVE_BRIGHTNESS, // "emissive_brightness"
|
||||
|
||||
DEFERRED_SHADOW_MATRIX,
|
||||
DEFERRED_ENV_MAT,
|
||||
DEFERRED_SHADOW_CLIP,
|
||||
DEFERRED_SUN_WASH,
|
||||
DEFERRED_SHADOW_NOISE,
|
||||
DEFERRED_BLUR_SIZE,
|
||||
DEFERRED_SSAO_RADIUS,
|
||||
DEFERRED_SSAO_MAX_RADIUS,
|
||||
DEFERRED_SSAO_FACTOR,
|
||||
DEFERRED_SSAO_FACTOR_INV,
|
||||
DEFERRED_SSAO_EFFECT_MAT,
|
||||
DEFERRED_SCREEN_RES,
|
||||
DEFERRED_NEAR_CLIP,
|
||||
DEFERRED_SHADOW_OFFSET,
|
||||
DEFERRED_SHADOW_BIAS,
|
||||
DEFERRED_SPOT_SHADOW_BIAS,
|
||||
DEFERRED_SPOT_SHADOW_OFFSET,
|
||||
DEFERRED_SUN_DIR,
|
||||
DEFERRED_MOON_DIR,
|
||||
DEFERRED_SHADOW_RES,
|
||||
DEFERRED_PROJ_SHADOW_RES,
|
||||
DEFERRED_DEPTH_CUTOFF,
|
||||
DEFERRED_NORM_CUTOFF,
|
||||
DEFERRED_SHADOW_TARGET_WIDTH,
|
||||
DEFERRED_SHADOW_MATRIX, // "shadow_matrix"
|
||||
DEFERRED_ENV_MAT, // "env_mat"
|
||||
DEFERRED_SHADOW_CLIP, // "shadow_clip"
|
||||
DEFERRED_SUN_WASH, // "sun_wash"
|
||||
DEFERRED_SHADOW_NOISE, // "shadow_noise"
|
||||
DEFERRED_BLUR_SIZE, // "blur_size"
|
||||
DEFERRED_SSAO_RADIUS, // "ssao_radius"
|
||||
DEFERRED_SSAO_MAX_RADIUS, // "ssao_max_radius"
|
||||
DEFERRED_SSAO_FACTOR, // "ssao_factor"
|
||||
DEFERRED_SSAO_FACTOR_INV, // "ssao_factor_inv"
|
||||
DEFERRED_SSAO_EFFECT_MAT, // "ssao_effect_mat"
|
||||
DEFERRED_SCREEN_RES, // "screen_res"
|
||||
DEFERRED_NEAR_CLIP, // "near_clip"
|
||||
DEFERRED_SHADOW_OFFSET, // "shadow_offset"
|
||||
DEFERRED_SHADOW_BIAS, // "shadow_bias"
|
||||
DEFERRED_SPOT_SHADOW_BIAS, // "spot_shadow_bias"
|
||||
DEFERRED_SPOT_SHADOW_OFFSET, // "spot_shadow_offset"
|
||||
DEFERRED_SUN_DIR, // "sun_dir"
|
||||
DEFERRED_MOON_DIR, // "moon_dir"
|
||||
DEFERRED_SHADOW_RES, // "shadow_res"
|
||||
DEFERRED_PROJ_SHADOW_RES, // "proj_shadow_res"
|
||||
DEFERRED_DEPTH_CUTOFF, // "depth_cutoff"
|
||||
DEFERRED_NORM_CUTOFF, // "norm_cutoff"
|
||||
DEFERRED_SHADOW_TARGET_WIDTH, // "shadow_target_width"
|
||||
|
||||
FXAA_TC_SCALE,
|
||||
FXAA_RCP_SCREEN_RES,
|
||||
FXAA_RCP_FRAME_OPT,
|
||||
FXAA_RCP_FRAME_OPT2,
|
||||
FXAA_TC_SCALE, // "tc_scale"
|
||||
FXAA_RCP_SCREEN_RES, // "rcp_screen_res"
|
||||
FXAA_RCP_FRAME_OPT, // "rcp_frame_opt"
|
||||
FXAA_RCP_FRAME_OPT2, // "rcp_frame_opt2"
|
||||
|
||||
DOF_FOCAL_DISTANCE,
|
||||
DOF_BLUR_CONSTANT,
|
||||
DOF_TAN_PIXEL_ANGLE,
|
||||
DOF_MAGNIFICATION,
|
||||
DOF_MAX_COF,
|
||||
DOF_RES_SCALE,
|
||||
DOF_WIDTH,
|
||||
DOF_HEIGHT,
|
||||
DOF_FOCAL_DISTANCE, // "focal_distance"
|
||||
DOF_BLUR_CONSTANT, // "blur_constant"
|
||||
DOF_TAN_PIXEL_ANGLE, // "tan_pixel_angle"
|
||||
DOF_MAGNIFICATION, // "magnification"
|
||||
DOF_MAX_COF, // "max_cof"
|
||||
DOF_RES_SCALE, // "res_scale"
|
||||
DOF_WIDTH, // "dof_width"
|
||||
DOF_HEIGHT, // "dof_height"
|
||||
|
||||
DEFERRED_DEPTH,
|
||||
DEFERRED_SHADOW0,
|
||||
DEFERRED_SHADOW1,
|
||||
DEFERRED_SHADOW2,
|
||||
DEFERRED_SHADOW3,
|
||||
DEFERRED_SHADOW4,
|
||||
DEFERRED_SHADOW5,
|
||||
DEFERRED_NORMAL,
|
||||
DEFERRED_POSITION,
|
||||
DEFERRED_DIFFUSE,
|
||||
DEFERRED_SPECULAR,
|
||||
DEFERRED_NOISE,
|
||||
DEFERRED_LIGHTFUNC,
|
||||
DEFERRED_LIGHT,
|
||||
DEFERRED_BLOOM,
|
||||
DEFERRED_PROJECTION,
|
||||
DEFERRED_NORM_MATRIX,
|
||||
TEXTURE_GAMMA,
|
||||
SPECULAR_COLOR,
|
||||
ENVIRONMENT_INTENSITY,
|
||||
|
||||
AVATAR_MATRIX,
|
||||
AVATAR_TRANSLATION,
|
||||
DEFERRED_DEPTH, // "depthMap"
|
||||
DEFERRED_SHADOW0, // "shadowMap0"
|
||||
DEFERRED_SHADOW1, // "shadowMap1"
|
||||
DEFERRED_SHADOW2, // "shadowMap2"
|
||||
DEFERRED_SHADOW3, // "shadowMap3"
|
||||
DEFERRED_SHADOW4, // "shadowMap4"
|
||||
DEFERRED_SHADOW5, // "shadowMap5"
|
||||
DEFERRED_NORMAL, // "normalMap"
|
||||
DEFERRED_POSITION, // "positionMap"
|
||||
DEFERRED_DIFFUSE, // "diffuseRect"
|
||||
DEFERRED_SPECULAR, // "specularRect"
|
||||
DEFERRED_NOISE, // "noiseMap"
|
||||
DEFERRED_LIGHTFUNC, // "lightFunc"
|
||||
DEFERRED_LIGHT, // "lightMap"
|
||||
DEFERRED_BLOOM, // "bloomMap"
|
||||
DEFERRED_PROJECTION, // "projectionMap"
|
||||
DEFERRED_NORM_MATRIX, // "norm_mat"
|
||||
TEXTURE_GAMMA, // "texture_gamma"
|
||||
SPECULAR_COLOR, // "specular_color"
|
||||
ENVIRONMENT_INTENSITY, // "env_intensity"
|
||||
|
||||
WATER_SCREENTEX,
|
||||
WATER_SCREENDEPTH,
|
||||
WATER_REFTEX,
|
||||
WATER_EYEVEC,
|
||||
WATER_TIME,
|
||||
WATER_WAVE_DIR1,
|
||||
WATER_WAVE_DIR2,
|
||||
WATER_LIGHT_DIR,
|
||||
WATER_SPECULAR,
|
||||
WATER_SPECULAR_EXP,
|
||||
WATER_FOGCOLOR,
|
||||
WATER_FOGDENSITY,
|
||||
WATER_FOGKS,
|
||||
WATER_REFSCALE,
|
||||
WATER_WATERHEIGHT,
|
||||
WATER_WATERPLANE,
|
||||
WATER_NORM_SCALE,
|
||||
WATER_FRESNEL_SCALE,
|
||||
WATER_FRESNEL_OFFSET,
|
||||
WATER_BLUR_MULTIPLIER,
|
||||
WATER_SUN_ANGLE,
|
||||
WATER_SCALED_ANGLE,
|
||||
WATER_SUN_ANGLE2,
|
||||
|
||||
WL_CAMPOSLOCAL,
|
||||
AVATAR_MATRIX, // "matrixPalette"
|
||||
AVATAR_TRANSLATION, // "translationPalette"
|
||||
|
||||
WATER_SCREENTEX, // "screenTex"
|
||||
WATER_SCREENDEPTH, // "screenDepth"
|
||||
WATER_REFTEX, // "refTex"
|
||||
WATER_EYEVEC, // "eyeVec"
|
||||
WATER_TIME, // "time"
|
||||
WATER_WAVE_DIR1, // "waveDir1"
|
||||
WATER_WAVE_DIR2, // "waveDir2"
|
||||
WATER_LIGHT_DIR, // "lightDir"
|
||||
WATER_SPECULAR, // "specular"
|
||||
WATER_SPECULAR_EXP, // "lightExp"
|
||||
WATER_FOGCOLOR, // "waterFogColor"
|
||||
WATER_FOGDENSITY, // "waterFogDensity"
|
||||
WATER_FOGKS, // "waterFogKS"
|
||||
WATER_REFSCALE, // "refScale"
|
||||
WATER_WATERHEIGHT, // "waterHeight"
|
||||
WATER_WATERPLANE, // "waterPlane"
|
||||
WATER_NORM_SCALE, // "normScale"
|
||||
WATER_FRESNEL_SCALE, // "fresnelScale"
|
||||
WATER_FRESNEL_OFFSET, // "fresnelOffset"
|
||||
WATER_BLUR_MULTIPLIER, // "blurMultiplier"
|
||||
WATER_SUN_ANGLE, // "sunAngle"
|
||||
WATER_SCALED_ANGLE, // "scaledAngle"
|
||||
WATER_SUN_ANGLE2, // "sunAngle2"
|
||||
|
||||
WL_CAMPOSLOCAL, // "camPosLocal"
|
||||
// [RLVa:KB] - @setsphere
|
||||
RLV_EFFECT_MODE,
|
||||
RLV_EFFECT_PARAM1,
|
||||
|
|
@ -214,51 +215,52 @@ public:
|
|||
RLV_EFFECT_PARAM5,
|
||||
// [/RLVa:KB]
|
||||
|
||||
AVATAR_WIND,
|
||||
AVATAR_SINWAVE,
|
||||
AVATAR_GRAVITY,
|
||||
AVATAR_WIND, // "gWindDir"
|
||||
AVATAR_SINWAVE, // "gSinWaveParams"
|
||||
AVATAR_GRAVITY, // "gGravity"
|
||||
|
||||
TERRAIN_DETAIL0,
|
||||
TERRAIN_DETAIL1,
|
||||
TERRAIN_DETAIL2,
|
||||
TERRAIN_DETAIL3,
|
||||
TERRAIN_ALPHARAMP,
|
||||
|
||||
SHINY_ORIGIN,
|
||||
DISPLAY_GAMMA,
|
||||
TERRAIN_DETAIL0, // "detail_0"
|
||||
TERRAIN_DETAIL1, // "detail_1"
|
||||
TERRAIN_DETAIL2, // "detail_2"
|
||||
TERRAIN_DETAIL3, // "detail_3"
|
||||
TERRAIN_ALPHARAMP, // "alpha_ramp"
|
||||
|
||||
INSCATTER_RT,
|
||||
SUN_SIZE,
|
||||
FOG_COLOR,
|
||||
SHINY_ORIGIN, // "origin"
|
||||
DISPLAY_GAMMA, // "display_gamma"
|
||||
|
||||
INSCATTER_RT, // "inscatter"
|
||||
SUN_SIZE, // "sun_size"
|
||||
FOG_COLOR, // "fog_color"
|
||||
|
||||
// precomputed textures
|
||||
TRANSMITTANCE_TEX,
|
||||
SCATTER_TEX,
|
||||
SINGLE_MIE_SCATTER_TEX,
|
||||
ILLUMINANCE_TEX,
|
||||
BLEND_FACTOR,
|
||||
TRANSMITTANCE_TEX, // "transmittance_texture"
|
||||
SCATTER_TEX, // "scattering_texture"
|
||||
SINGLE_MIE_SCATTER_TEX, // "single_mie_scattering_texture"
|
||||
ILLUMINANCE_TEX, // "irradiance_texture"
|
||||
BLEND_FACTOR, // "blend_factor"
|
||||
|
||||
NO_ATMO,
|
||||
MOISTURE_LEVEL,
|
||||
DROPLET_RADIUS,
|
||||
ICE_LEVEL,
|
||||
RAINBOW_MAP,
|
||||
HALO_MAP,
|
||||
NO_ATMO, // "no_atmo"
|
||||
MOISTURE_LEVEL, // "moisture_level"
|
||||
DROPLET_RADIUS, // "droplet_radius"
|
||||
ICE_LEVEL, // "ice_level"
|
||||
RAINBOW_MAP, // "rainbow_map"
|
||||
HALO_MAP, // "halo_map"
|
||||
|
||||
MOON_BRIGHTNESS,
|
||||
MOON_BRIGHTNESS, // "moon_brightness"
|
||||
|
||||
CLOUD_VARIANCE,
|
||||
CLOUD_VARIANCE, // "cloud_variance"
|
||||
|
||||
SH_INPUT_L1R,
|
||||
SH_INPUT_L1G,
|
||||
SH_INPUT_L1B,
|
||||
SH_INPUT_L1R, // "sh_input_r"
|
||||
SH_INPUT_L1G, // "sh_input_g"
|
||||
SH_INPUT_L1B, // "sh_input_b"
|
||||
|
||||
SUN_MOON_GLOW_FACTOR,
|
||||
WATER_EDGE_FACTOR,
|
||||
SUN_UP_FACTOR,
|
||||
MOONLIGHT_COLOR,
|
||||
END_RESERVED_UNIFORMS
|
||||
} eGLSLReservedUniforms;
|
||||
SUN_MOON_GLOW_FACTOR, // "sun_moon_glow_factor"
|
||||
WATER_EDGE_FACTOR, // "water_edge"
|
||||
SUN_UP_FACTOR, // "sun_up_factor"
|
||||
MOONLIGHT_COLOR, // "moonlight_color"
|
||||
END_RESERVED_UNIFORMS
|
||||
} eGLSLReservedUniforms;
|
||||
// clang-format on
|
||||
|
||||
// singleton pattern implementation
|
||||
static LLShaderMgr * instance();
|
||||
|
|
|
|||
|
|
@ -155,9 +155,8 @@ public:
|
|||
//get the size of a buffer with the given typemask and vertex count
|
||||
//fill offsets with the offset of each vertex component array into the buffer
|
||||
// indexed by the following enum
|
||||
static S32 calcOffsets(const U32& typemask, S32* offsets, S32 num_vertices);
|
||||
static S32 calcOffsets(const U32& typemask, S32* offsets, S32 num_vertices);
|
||||
|
||||
|
||||
//WARNING -- when updating these enums you MUST
|
||||
// 1 - update LLVertexBuffer::sTypeSize
|
||||
// 2 - add a strider accessor
|
||||
|
|
@ -165,24 +164,28 @@ public:
|
|||
// 4 - modify LLVertexBuffer::setupClientArray
|
||||
// 5 - modify LLViewerShaderMgr::mReservedAttribs
|
||||
// 6 - update LLVertexBuffer::setupVertexArray
|
||||
enum {
|
||||
TYPE_VERTEX = 0,
|
||||
TYPE_NORMAL,
|
||||
TYPE_TEXCOORD0,
|
||||
TYPE_TEXCOORD1,
|
||||
TYPE_TEXCOORD2,
|
||||
TYPE_TEXCOORD3,
|
||||
TYPE_COLOR,
|
||||
TYPE_EMISSIVE,
|
||||
TYPE_TANGENT,
|
||||
TYPE_WEIGHT,
|
||||
TYPE_WEIGHT4,
|
||||
TYPE_CLOTHWEIGHT,
|
||||
TYPE_TEXTURE_INDEX,
|
||||
TYPE_MAX, // TYPE_MAX is the size/boundary marker for attributes that go in the vertex buffer
|
||||
TYPE_INDEX, // TYPE_INDEX is beyond _MAX because it lives in a separate (index) buffer
|
||||
};
|
||||
enum {
|
||||
|
||||
// clang-format off
|
||||
enum { // Shader attribute name, set in LLShaderMgr::initAttribsAndUniforms()
|
||||
TYPE_VERTEX = 0, // "position"
|
||||
TYPE_NORMAL, // "normal"
|
||||
TYPE_TEXCOORD0, // "texcoord0"
|
||||
TYPE_TEXCOORD1, // "texcoord1"
|
||||
TYPE_TEXCOORD2, // "texcoord2"
|
||||
TYPE_TEXCOORD3, // "texcoord3"
|
||||
TYPE_COLOR, // "diffuse_color"
|
||||
TYPE_EMISSIVE, // "emissive"
|
||||
TYPE_TANGENT, // "tangent"
|
||||
TYPE_WEIGHT, // "weight"
|
||||
TYPE_WEIGHT4, // "weight4"
|
||||
TYPE_CLOTHWEIGHT, // "clothing"
|
||||
TYPE_TEXTURE_INDEX, // "texture_index"
|
||||
TYPE_MAX, // TYPE_MAX is the size/boundary marker for attributes that go in the vertex buffer
|
||||
TYPE_INDEX, // TYPE_INDEX is beyond _MAX because it lives in a separate (index) buffer
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
enum {
|
||||
MAP_VERTEX = (1<<TYPE_VERTEX),
|
||||
MAP_NORMAL = (1<<TYPE_NORMAL),
|
||||
MAP_TEXCOORD0 = (1<<TYPE_TEXCOORD0),
|
||||
|
|
|
|||
|
|
@ -122,6 +122,7 @@ set(llui_SOURCE_FILES
|
|||
lluictrl.cpp
|
||||
lluictrlfactory.cpp
|
||||
lluistring.cpp
|
||||
lluiusage.cpp
|
||||
llundo.cpp
|
||||
llurlaction.cpp
|
||||
llurlentry.cpp
|
||||
|
|
@ -241,6 +242,7 @@ set(llui_HEADER_FILES
|
|||
llui.h
|
||||
lluicolor.h
|
||||
lluistring.h
|
||||
lluiusage.h
|
||||
llundo.h
|
||||
llurlaction.h
|
||||
llurlentry.h
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@
|
|||
#include "llnotificationsutil.h"
|
||||
#include "llrender.h"
|
||||
#include "lluictrlfactory.h"
|
||||
#include "lluiusage.h"
|
||||
#include "llhelp.h"
|
||||
#include "lldockablefloater.h"
|
||||
#include "llviewereventrecorder.h"
|
||||
|
|
@ -437,6 +438,13 @@ BOOL LLButton::handleMouseDown(S32 x, S32 y, MASK mask)
|
|||
setFocus(TRUE);
|
||||
}
|
||||
|
||||
if (!mFunctionName.empty())
|
||||
{
|
||||
LL_DEBUGS("UIUsage") << "calling mouse down function " << mFunctionName << LL_ENDL;
|
||||
LLUIUsage::instance().logCommand(mFunctionName);
|
||||
LLUIUsage::instance().logControl(getPathname());
|
||||
}
|
||||
|
||||
/*
|
||||
* ATTENTION! This call fires another mouse down callback.
|
||||
* If you wish to remove this call emit that signal directly
|
||||
|
|
|
|||
|
|
@ -37,7 +37,8 @@ typedef enum e_chat_source_type
|
|||
CHAT_SOURCE_SYSTEM = 0,
|
||||
CHAT_SOURCE_AGENT = 1,
|
||||
CHAT_SOURCE_OBJECT = 2,
|
||||
CHAT_SOURCE_UNKNOWN = 3
|
||||
CHAT_SOURCE_TELEPORT = 3,
|
||||
CHAT_SOURCE_UNKNOWN = 4
|
||||
} EChatSourceType;
|
||||
|
||||
typedef enum e_chat_type
|
||||
|
|
@ -64,7 +65,8 @@ typedef enum e_chat_style
|
|||
{
|
||||
CHAT_STYLE_NORMAL,
|
||||
CHAT_STYLE_IRC,
|
||||
CHAT_STYLE_HISTORY
|
||||
CHAT_STYLE_HISTORY,
|
||||
CHAT_STYLE_TELEPORT_SEP
|
||||
}EChatStyle;
|
||||
|
||||
// A piece of chat
|
||||
|
|
|
|||
|
|
@ -187,10 +187,32 @@ void LLCheckBoxCtrl::clear()
|
|||
|
||||
void LLCheckBoxCtrl::reshape(S32 width, S32 height, BOOL called_from_parent)
|
||||
{
|
||||
S32 label_top = mLabel->getRect().mTop;
|
||||
mLabel->reshapeToFitText();
|
||||
LLRect rect = getRect();
|
||||
S32 delta_width = width - rect.getWidth();
|
||||
S32 delta_height = height - rect.getHeight();
|
||||
|
||||
LLRect label_rect = mLabel->getRect();
|
||||
if (delta_width || delta_height)
|
||||
{
|
||||
// adjust our rectangle
|
||||
rect.mRight = getRect().mLeft + width;
|
||||
rect.mTop = getRect().mBottom + height;
|
||||
setRect(rect);
|
||||
}
|
||||
|
||||
// reshapeToFitText reshapes label to minimal size according to last bounding box
|
||||
// it will work fine in case of decrease of space, but if we get more space or text
|
||||
// becomes longer, label will fail to grow so reinit label's dimentions.
|
||||
|
||||
static LLUICachedControl<S32> llcheckboxctrl_hpad("UICheckboxctrlHPad", 0);
|
||||
LLRect label_rect = mLabel->getRect();
|
||||
S32 new_width = getRect().getWidth() - label_rect.mLeft - llcheckboxctrl_hpad;
|
||||
label_rect.mRight = label_rect.mLeft + new_width;
|
||||
mLabel->setRect(label_rect);
|
||||
|
||||
S32 label_top = label_rect.mTop;
|
||||
mLabel->reshapeToFitText(TRUE);
|
||||
|
||||
label_rect = mLabel->getRect();
|
||||
if (label_top != label_rect.mTop && mWordWrap == WRAP_DOWN)
|
||||
{
|
||||
// reshapeToFitText uses LLView::reshape() which always reshapes
|
||||
|
|
@ -210,6 +232,8 @@ void LLCheckBoxCtrl::reshape(S32 width, S32 height, BOOL called_from_parent)
|
|||
llmax(btn_rect.getWidth(), label_rect.mRight - btn_rect.mLeft),
|
||||
llmax(label_rect.mTop - btn_rect.mBottom, btn_rect.getHeight()));
|
||||
mButton->setShape(btn_rect);
|
||||
|
||||
updateBoundingRect();
|
||||
}
|
||||
|
||||
//virtual
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@
|
|||
#include "llhelp.h"
|
||||
#include "llmultifloater.h"
|
||||
#include "llsdutil.h"
|
||||
#include "lluiusage.h"
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
|
||||
|
|
@ -198,7 +199,9 @@ LLFloater::Params::Params()
|
|||
help_pressed_image("help_pressed_image"),
|
||||
open_callback("open_callback"),
|
||||
close_callback("close_callback"),
|
||||
follows("follows")
|
||||
follows("follows"),
|
||||
rel_x("rel_x", 0),
|
||||
rel_y("rel_y", 0)
|
||||
{
|
||||
changeDefault(visible, false);
|
||||
}
|
||||
|
|
@ -267,6 +270,8 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p)
|
|||
mHasBeenDraggedWhileMinimized(FALSE),
|
||||
mPreviousMinimizedBottom(0),
|
||||
mPreviousMinimizedLeft(0),
|
||||
mDefaultRelativeX(p.rel_x),
|
||||
mDefaultRelativeY(p.rel_y),
|
||||
mMinimizeSignal(NULL)
|
||||
// mNotificationContext(NULL)
|
||||
{
|
||||
|
|
@ -505,7 +510,12 @@ void LLFloater::destroy()
|
|||
// virtual
|
||||
LLFloater::~LLFloater()
|
||||
{
|
||||
LLFloaterReg::removeInstance(mInstanceName, mKey);
|
||||
if (!isDead())
|
||||
{
|
||||
// If it's dead, instance is supposed to be already removed, and
|
||||
// in case of single instance we can remove new one by accident
|
||||
LLFloaterReg::removeInstance(mInstanceName, mKey);
|
||||
}
|
||||
|
||||
if( gFocusMgr.childHasKeyboardFocus(this))
|
||||
{
|
||||
|
|
@ -934,6 +944,15 @@ bool LLFloater::applyRectControl()
|
|||
|
||||
saved_rect = true;
|
||||
}
|
||||
else if ((mDefaultRelativeX != 0) && (mDefaultRelativeY != 0))
|
||||
{
|
||||
mPosition.mX = mDefaultRelativeX;
|
||||
mPosition.mY = mDefaultRelativeY;
|
||||
mPositioning = LLFloaterEnums::POSITIONING_RELATIVE;
|
||||
applyRelativePosition();
|
||||
|
||||
saved_rect = true;
|
||||
}
|
||||
|
||||
// remember updated position
|
||||
if (rect_specified)
|
||||
|
|
@ -1631,6 +1650,7 @@ void LLFloater::bringToFront( S32 x, S32 y )
|
|||
// virtual
|
||||
void LLFloater::setVisibleAndFrontmost(BOOL take_focus,const LLSD& key)
|
||||
{
|
||||
LLUIUsage::instance().logFloater(getInstanceName());
|
||||
LLMultiFloater* hostp = getHost();
|
||||
if (hostp)
|
||||
{
|
||||
|
|
@ -3198,6 +3218,9 @@ void LLFloater::initFromParams(const LLFloater::Params& p)
|
|||
mSingleInstance = p.single_instance;
|
||||
mReuseInstance = p.reuse_instance.isProvided() ? p.reuse_instance : p.single_instance;
|
||||
|
||||
mDefaultRelativeX = p.rel_x;
|
||||
mDefaultRelativeY = p.rel_y;
|
||||
|
||||
mPositioning = p.positioning;
|
||||
|
||||
mSaveRect = p.save_rect;
|
||||
|
|
|
|||
|
|
@ -172,6 +172,9 @@ public:
|
|||
Optional<S32> header_height,
|
||||
legacy_header_height; // HACK see initFromXML()
|
||||
|
||||
Optional<F32> rel_x,
|
||||
rel_y;
|
||||
|
||||
// Images for top-right controls
|
||||
Optional<LLUIImage*> close_image,
|
||||
restore_image,
|
||||
|
|
@ -521,6 +524,9 @@ private:
|
|||
BOOL mHasBeenDraggedWhileMinimized;
|
||||
S32 mPreviousMinimizedBottom;
|
||||
S32 mPreviousMinimizedLeft;
|
||||
|
||||
F32 mDefaultRelativeX;
|
||||
F32 mDefaultRelativeY;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
#include "llfloater.h"
|
||||
#include "llmultifloater.h"
|
||||
#include "llfloaterreglistener.h"
|
||||
#include "lluiusage.h"
|
||||
|
||||
//*******************************************************
|
||||
|
||||
|
|
@ -60,6 +61,12 @@ void LLFloaterReg::add(const std::string& name, const std::string& filename, con
|
|||
sGroupMap[groupname] = groupname; // for referencing directly by group name
|
||||
}
|
||||
|
||||
//static
|
||||
bool LLFloaterReg::isRegistered(const std::string& name)
|
||||
{
|
||||
return sBuildMap.find(name) != sBuildMap.end();
|
||||
}
|
||||
|
||||
//static
|
||||
LLFloater* LLFloaterReg::getLastFloaterInGroup(const std::string& name)
|
||||
{
|
||||
|
|
@ -487,7 +494,6 @@ void LLFloaterReg::toggleInstanceOrBringToFront(const LLSD& sdname, const LLSD&
|
|||
std::string name = sdname.asString();
|
||||
LLFloater* instance = getInstance(name, key);
|
||||
|
||||
|
||||
if (!instance)
|
||||
{
|
||||
LL_DEBUGS() << "Unable to get instance of floater '" << name << "'" << LL_ENDL;
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@ public:
|
|||
|
||||
static void add(const std::string& name, const std::string& file, const LLFloaterBuildFunc& func,
|
||||
const std::string& groupname = LLStringUtil::null);
|
||||
static bool isRegistered(const std::string& name);
|
||||
|
||||
// Helpers
|
||||
static LLFloater* getLastFloaterInGroup(const std::string& name);
|
||||
|
|
|
|||
|
|
@ -204,6 +204,7 @@ public:
|
|||
virtual bool hasChildren() const = 0;
|
||||
virtual void addChild(LLFolderViewModelItem* child) = 0;
|
||||
virtual void removeChild(LLFolderViewModelItem* child) = 0;
|
||||
virtual void clearChildren() = 0;
|
||||
|
||||
// This method will be called to determine if a drop can be
|
||||
// performed, and will set drop to TRUE if a drop is
|
||||
|
|
@ -301,9 +302,8 @@ public:
|
|||
|
||||
virtual void clearChildren()
|
||||
{
|
||||
// As this is cleaning the whole list of children wholesale, we do need to delete the pointed objects
|
||||
// This is different and not equivalent to calling removeChild() on each child
|
||||
std::for_each(mChildren.begin(), mChildren.end(), DeletePointer());
|
||||
// We are working with models that belong to views as LLPointers, clean the list, let poiters handle the rest
|
||||
std::for_each(mChildren.begin(), mChildren.end(), [](LLFolderViewModelItem* c) {c->setParent(NULL); });
|
||||
mChildren.clear();
|
||||
dirtyDescendantsFilter();
|
||||
dirtyFilter();
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ void LLLayoutPanel::setVisible( BOOL visible )
|
|||
|
||||
void LLLayoutPanel::reshape( S32 width, S32 height, BOOL called_from_parent /*= TRUE*/ )
|
||||
{
|
||||
if (width == getRect().getWidth() && height == getRect().getHeight()) return;
|
||||
if (width == getRect().getWidth() && height == getRect().getHeight() && !LLView::sForceReshape) return;
|
||||
|
||||
if (!mIgnoreReshape && mAutoResize == false)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -283,6 +283,9 @@ public:
|
|||
|
||||
void resetContextMenu() { setContextMenu(NULL); };
|
||||
|
||||
void setBgImage(LLPointer<LLUIImage> image) { mBgImage = image; }
|
||||
void setBgImageFocused(LLPointer<LLUIImage> image) { mBgImageFocused = image; }
|
||||
|
||||
private:
|
||||
// private helper methods
|
||||
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ const U32 LEFT_PAD_PIXELS = 3;
|
|||
const U32 LEFT_WIDTH_PIXELS = 15;
|
||||
const U32 LEFT_PLAIN_PIXELS = LEFT_PAD_PIXELS + LEFT_WIDTH_PIXELS;
|
||||
|
||||
const U32 RIGHT_PAD_PIXELS = 2;
|
||||
const U32 RIGHT_PAD_PIXELS = 7;
|
||||
const U32 RIGHT_WIDTH_PIXELS = 15;
|
||||
const U32 RIGHT_PLAIN_PIXELS = RIGHT_PAD_PIXELS + RIGHT_WIDTH_PIXELS;
|
||||
|
||||
|
|
@ -95,7 +95,7 @@ const std::string SEPARATOR_NAME("separator");
|
|||
const std::string VERTICAL_SEPARATOR_LABEL( "|" );
|
||||
|
||||
const std::string LLMenuGL::BOOLEAN_TRUE_PREFIX( "\xE2\x9C\x94" ); // U+2714 HEAVY CHECK MARK
|
||||
const std::string LLMenuGL::BRANCH_SUFFIX( "\xE2\x96\xB6" ); // U+25B6 BLACK RIGHT-POINTING TRIANGLE
|
||||
const std::string LLMenuGL::BRANCH_SUFFIX( "\xe2\x96\xb8" ); // U+25B6 BLACK RIGHT-POINTING TRIANGLE
|
||||
const std::string LLMenuGL::ARROW_UP ("^^^^^^^");
|
||||
const std::string LLMenuGL::ARROW_DOWN("vvvvvvv");
|
||||
|
||||
|
|
@ -3276,7 +3276,7 @@ void hide_top_view( LLView* view )
|
|||
// x and y are the desired location for the popup, in the spawning_view's
|
||||
// coordinate frame, NOT necessarily the mouse location
|
||||
// static
|
||||
void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y)
|
||||
void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y, S32 mouse_x, S32 mouse_y)
|
||||
{
|
||||
const S32 CURSOR_HEIGHT = 22; // Approximate "normal" cursor size
|
||||
const S32 CURSOR_WIDTH = 12;
|
||||
|
|
@ -3307,12 +3307,6 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y)
|
|||
}
|
||||
}
|
||||
|
||||
// Save click point for detecting cursor moves before mouse-up.
|
||||
// Must be in local coords to compare with mouseUp events.
|
||||
// If the mouse doesn't move, the menu will stay open ala the Mac.
|
||||
// See also LLContextMenu::show()
|
||||
S32 mouse_x, mouse_y;
|
||||
|
||||
// Resetting scrolling position
|
||||
if (menu->isScrollable() && menu->isScrollPositionOnShowReset())
|
||||
{
|
||||
|
|
@ -3323,7 +3317,18 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y)
|
|||
menu->needsArrange();
|
||||
menu->arrangeAndClear();
|
||||
|
||||
LLUI::getInstance()->getMousePositionLocal(menu->getParent(), &mouse_x, &mouse_y);
|
||||
if ((mouse_x == 0) || (mouse_y == 0))
|
||||
|
||||
{
|
||||
// Save click point for detecting cursor moves before mouse-up.
|
||||
// Must be in local coords to compare with mouseUp events.
|
||||
// If the mouse doesn't move, the menu will stay open ala the Mac.
|
||||
// See also LLContextMenu::show()
|
||||
|
||||
LLUI::getInstance()->getMousePositionLocal(menu->getParent(), &mouse_x, &mouse_y);
|
||||
}
|
||||
|
||||
|
||||
LLMenuHolderGL::sContextMenuSpawnPos.set(mouse_x,mouse_y);
|
||||
|
||||
const LLRect menu_region_rect = LLMenuGL::sMenuContainer->getRect();
|
||||
|
|
|
|||
|
|
@ -519,7 +519,7 @@ public:
|
|||
void createJumpKeys();
|
||||
|
||||
// Show popup at a specific location, in the spawn_view's coordinate frame
|
||||
static void showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y);
|
||||
static void showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y, S32 mouse_x = 0, S32 mouse_y = 0);
|
||||
|
||||
// Whether to drop shadow menu bar
|
||||
void setDropShadowed( const BOOL shadowed );
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ LLNotificationForm::FormButton::FormButton()
|
|||
text("text"),
|
||||
ignore("ignore"),
|
||||
is_default("default"),
|
||||
width("width", 0),
|
||||
type("type")
|
||||
{
|
||||
// set type here so it gets serialized
|
||||
|
|
|
|||
|
|
@ -191,6 +191,7 @@ public:
|
|||
Mandatory<std::string> text;
|
||||
Optional<std::string> ignore;
|
||||
Optional<bool> is_default;
|
||||
Optional<S32> width;
|
||||
|
||||
Mandatory<std::string> type;
|
||||
|
||||
|
|
|
|||
|
|
@ -295,9 +295,6 @@ const std::string LLLocale::SYSTEM_LOCALE("English_United States.1252");
|
|||
#elif LL_DARWIN
|
||||
const std::string LLLocale::USER_LOCALE("en_US.iso8859-1");// = LLStringUtil::null;
|
||||
const std::string LLLocale::SYSTEM_LOCALE("en_US.iso8859-1");
|
||||
#elif LL_SOLARIS
|
||||
const std::string LLLocale::USER_LOCALE("en_US.ISO8859-1");
|
||||
const std::string LLLocale::SYSTEM_LOCALE("C");
|
||||
#else // LL_LINUX likes this
|
||||
const std::string LLLocale::USER_LOCALE("en_US.utf8");
|
||||
const std::string LLLocale::SYSTEM_LOCALE("C");
|
||||
|
|
|
|||
|
|
@ -34,7 +34,11 @@
|
|||
LLSearchEditor::LLSearchEditor(const LLSearchEditor::Params& p)
|
||||
: LLUICtrl(p),
|
||||
mSearchButton(NULL),
|
||||
mClearButton(NULL)
|
||||
mClearButton(NULL),
|
||||
mEditorImage(p.background_image),
|
||||
mEditorImageFocused(p.background_image_focused),
|
||||
mEditorSearchImage(p.background_image_highlight),
|
||||
mHighlightTextField(p.highlight_text_field)
|
||||
{
|
||||
S32 srch_btn_top = p.search_button.top_pad + p.search_button.rect.height;
|
||||
S32 srch_btn_right = p.search_button.rect.width + p.search_button.left_pad;
|
||||
|
|
@ -57,6 +61,8 @@ LLSearchEditor::LLSearchEditor(const LLSearchEditor::Params& p)
|
|||
// Set up line editor.
|
||||
LLLineEditor::Params line_editor_params(p);
|
||||
line_editor_params.name("filter edit box");
|
||||
line_editor_params.background_image(p.background_image);
|
||||
line_editor_params.background_image_focused(p.background_image_focused);
|
||||
line_editor_params.rect(getLocalRect());
|
||||
line_editor_params.follows.flags(FOLLOWS_ALL);
|
||||
line_editor_params.text_pad_left(text_pad_left);
|
||||
|
|
@ -104,6 +110,20 @@ void LLSearchEditor::draw()
|
|||
if (mClearButton)
|
||||
mClearButton->setVisible(!mSearchEditor->getWText().empty());
|
||||
|
||||
if (mHighlightTextField)
|
||||
{
|
||||
if (!mSearchEditor->getWText().empty())
|
||||
{
|
||||
mSearchEditor->setBgImage(mEditorSearchImage);
|
||||
mSearchEditor->setBgImageFocused(mEditorSearchImage);
|
||||
}
|
||||
else
|
||||
{
|
||||
mSearchEditor->setBgImage(mEditorImage);
|
||||
mSearchEditor->setBgImageFocused(mEditorImageFocused);
|
||||
}
|
||||
}
|
||||
|
||||
LLUICtrl::draw();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,14 +47,23 @@ public:
|
|||
Optional<LLButton::Params> search_button,
|
||||
clear_button;
|
||||
Optional<bool> search_button_visible,
|
||||
clear_button_visible;
|
||||
clear_button_visible,
|
||||
highlight_text_field;
|
||||
Optional<commit_callback_t> keystroke_callback;
|
||||
|
||||
Optional<LLUIImage*> background_image,
|
||||
background_image_focused,
|
||||
background_image_highlight;
|
||||
|
||||
Params()
|
||||
: search_button("search_button"),
|
||||
search_button_visible("search_button_visible"),
|
||||
clear_button("clear_button"),
|
||||
clear_button_visible("clear_button_visible")
|
||||
clear_button_visible("clear_button_visible"),
|
||||
highlight_text_field("highlight_text_field"),
|
||||
background_image("background_image"),
|
||||
background_image_focused("background_image_focused"),
|
||||
background_image_highlight("background_image_highlight")
|
||||
{}
|
||||
};
|
||||
|
||||
|
|
@ -93,6 +102,13 @@ protected:
|
|||
LLLineEditor* mSearchEditor;
|
||||
LLButton* mSearchButton;
|
||||
LLButton* mClearButton;
|
||||
|
||||
LLPointer<LLUIImage> mEditorImage;
|
||||
LLPointer<LLUIImage> mEditorImageFocused;
|
||||
LLPointer<LLUIImage> mEditorSearchImage;
|
||||
LLPointer<LLUIImage> mEditorSearchImageFocused;
|
||||
|
||||
bool mHighlightTextField;
|
||||
};
|
||||
|
||||
#endif // LL_SEARCHEDITOR_H
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
#include "llrender.h"
|
||||
#include "llfloater.h"
|
||||
#include "lltrans.h"
|
||||
#include "lluiusage.h"
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
|
|
@ -1556,6 +1557,8 @@ BOOL LLTabContainer::setTab(S32 which)
|
|||
|
||||
if (is_selected)
|
||||
{
|
||||
LLUIUsage::instance().logPanel(tuple->mTabPanel->getName());
|
||||
|
||||
// Make sure selected tab is within scroll region
|
||||
if (mIsVertical)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1179,7 +1179,7 @@ BOOL LLTextBase::handleToolTip(S32 x, S32 y, MASK mask)
|
|||
|
||||
void LLTextBase::reshape(S32 width, S32 height, BOOL called_from_parent)
|
||||
{
|
||||
if (width != getRect().getWidth() || height != getRect().getHeight())
|
||||
if (width != getRect().getWidth() || height != getRect().getHeight() || LLView::sForceReshape)
|
||||
{
|
||||
bool scrolled_to_bottom = mScroller ? mScroller->isAtBottom() : false;
|
||||
|
||||
|
|
|
|||
|
|
@ -163,13 +163,13 @@ BOOL LLTextBox::setTextArg( const std::string& key, const LLStringExplicit& text
|
|||
}
|
||||
|
||||
|
||||
void LLTextBox::reshapeToFitText()
|
||||
void LLTextBox::reshapeToFitText(BOOL called_from_parent)
|
||||
{
|
||||
reflow();
|
||||
|
||||
S32 width = getTextPixelWidth();
|
||||
S32 height = getTextPixelHeight();
|
||||
reshape( width + 2 * mHPad, height + 2 * mVPad, FALSE );
|
||||
reshape( width + 2 * mHPad, height + 2 * mVPad, called_from_parent );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public:
|
|||
void setHAlign( LLFontGL::HAlign align ) { mHAlign = align; }
|
||||
void setClickedCallback( boost::function<void (void*)> cb, void* userdata = NULL );
|
||||
|
||||
void reshapeToFitText();
|
||||
void reshapeToFitText(BOOL called_from_parent = FALSE);
|
||||
|
||||
S32 getTextPixelWidth();
|
||||
S32 getTextPixelHeight();
|
||||
|
|
|
|||
|
|
@ -967,6 +967,8 @@ LLToolBarButton* LLToolBar::createButton(const LLCommandId& id)
|
|||
executeStopParam.function_name = executeStopFunction;
|
||||
executeStopParam.parameter = commandp->executeStopParameters();
|
||||
LLUICtrl::commit_callback_t execute_func = initCommitCallback(executeParam);
|
||||
button->setFunctionName(commandp->executeFunctionName());
|
||||
LL_DEBUGS("UIUsage") << "button function name a -> " << commandp->executeFunctionName() << LL_ENDL;
|
||||
LLUICtrl::commit_callback_t stop_func = initCommitCallback(executeStopParam);
|
||||
|
||||
button->setMouseDownCallback(boost::bind(&LLToolBarButton::callIfEnabled, button, execute_func, _1, _2));
|
||||
|
|
@ -974,6 +976,8 @@ LLToolBarButton* LLToolBar::createButton(const LLCommandId& id)
|
|||
}
|
||||
else
|
||||
{
|
||||
button->setFunctionName(commandp->executeFunctionName());
|
||||
LL_DEBUGS("UIUsage") << "button function name b -> " << commandp->executeFunctionName() << LL_ENDL;
|
||||
button->setCommitCallback(executeParam);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@
|
|||
#include "lluictrlfactory.h"
|
||||
#include "lltabcontainer.h"
|
||||
#include "llaccordionctrltab.h"
|
||||
#include "lluiusage.h"
|
||||
|
||||
static LLDefaultChildRegistry::Register<LLUICtrl> r("ui_ctrl");
|
||||
|
||||
|
|
@ -282,6 +283,7 @@ LLUICtrl::commit_signal_t::slot_type LLUICtrl::initCommitCallback(const CommitCa
|
|||
else
|
||||
{
|
||||
std::string function_name = cb.function_name;
|
||||
setFunctionName(function_name);
|
||||
commit_callback_t* func = (CommitCallbackRegistry::getValue(function_name));
|
||||
if (func)
|
||||
{
|
||||
|
|
@ -422,7 +424,19 @@ BOOL LLUICtrl::canFocusChildren() const
|
|||
void LLUICtrl::onCommit()
|
||||
{
|
||||
if (mCommitSignal)
|
||||
(*mCommitSignal)(this, getValue());
|
||||
{
|
||||
if (!mFunctionName.empty())
|
||||
{
|
||||
LL_DEBUGS("UIUsage") << "calling commit function " << mFunctionName << LL_ENDL;
|
||||
LLUIUsage::instance().logCommand(mFunctionName);
|
||||
LLUIUsage::instance().logControl(getPathname());
|
||||
}
|
||||
else
|
||||
{
|
||||
//LL_DEBUGS("UIUsage") << "calling commit function " << "UNKNOWN" << LL_ENDL;
|
||||
}
|
||||
(*mCommitSignal)(this, getValue());
|
||||
}
|
||||
}
|
||||
|
||||
//virtual
|
||||
|
|
@ -597,6 +611,12 @@ void LLUICtrl::setMakeInvisibleControlVariable(LLControlVariable* control)
|
|||
setVisible(!(mMakeInvisibleControlVariable->getValue().asBoolean()));
|
||||
}
|
||||
}
|
||||
|
||||
void LLUICtrl::setFunctionName(const std::string& function_name)
|
||||
{
|
||||
mFunctionName = function_name;
|
||||
}
|
||||
|
||||
// static
|
||||
bool LLUICtrl::controlListener(const LLSD& newvalue, LLHandle<LLUICtrl> handle, std::string type)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -183,6 +183,8 @@ public:
|
|||
void setMakeVisibleControlVariable(LLControlVariable* control);
|
||||
void setMakeInvisibleControlVariable(LLControlVariable* control);
|
||||
|
||||
void setFunctionName(const std::string& function_name);
|
||||
|
||||
virtual void setTentative(BOOL b);
|
||||
virtual BOOL getTentative() const;
|
||||
virtual void setValue(const LLSD& value);
|
||||
|
|
@ -310,6 +312,8 @@ protected:
|
|||
LLControlVariable* mMakeInvisibleControlVariable;
|
||||
boost::signals2::connection mMakeInvisibleControlConnection;
|
||||
|
||||
std::string mFunctionName;
|
||||
|
||||
static F32 sActiveControlTransparency;
|
||||
static F32 sInactiveControlTransparency;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,146 @@
|
|||
/**
|
||||
* @file lluiuisage.cpp
|
||||
* @brief Source file for LLUIUsage
|
||||
*
|
||||
* $LicenseInfo:firstyear=2021&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2021, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "linden_common.h"
|
||||
#include "lluiusage.h"
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
||||
LLUIUsage::LLUIUsage()
|
||||
{
|
||||
}
|
||||
|
||||
LLUIUsage::~LLUIUsage()
|
||||
{
|
||||
}
|
||||
|
||||
// static
|
||||
std::string LLUIUsage::sanitized(const std::string& s)
|
||||
{
|
||||
// Remove characters that make the ViewerStats db unhappy
|
||||
std::string result(s);
|
||||
std::replace(result.begin(), result.end(), '.', '_');
|
||||
std::replace(result.begin(), result.end(), ' ', '_');
|
||||
return result;
|
||||
}
|
||||
|
||||
// static
|
||||
void LLUIUsage::setLLSDPath(LLSD& sd, const std::string& path, S32 max_elts, const LLSD& val)
|
||||
{
|
||||
// Keep the last max_elts components of the specified path
|
||||
std::vector<std::string> fields;
|
||||
boost::split(fields, path, boost::is_any_of("/"));
|
||||
auto first_pos = std::max(fields.begin(), fields.end() - max_elts);
|
||||
auto end_pos = fields.end();
|
||||
std::vector<std::string> last_fields(first_pos,end_pos);
|
||||
|
||||
setLLSDNested(sd, last_fields, val);
|
||||
}
|
||||
|
||||
// setLLSDNested()
|
||||
// Accomplish the equivalent of
|
||||
// sd[fields[0]][fields[1]]... = val;
|
||||
// for an arbitrary number of fields.
|
||||
// This might be useful as an LLSD utility function; is not specific to LLUIUsage
|
||||
//
|
||||
// static
|
||||
void LLUIUsage::setLLSDNested(LLSD& sd, const std::vector<std::string>& fields, const LLSD& val)
|
||||
{
|
||||
LLSD* fsd = &sd;
|
||||
for (auto it=fields.begin(); it!=fields.end(); ++it)
|
||||
{
|
||||
if (it == fields.end()-1)
|
||||
{
|
||||
(*fsd)[*it] = val;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(*fsd)[*it].isMap())
|
||||
{
|
||||
(*fsd)[*it] = LLSD::emptyMap();
|
||||
}
|
||||
fsd = &(*fsd)[*it];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLUIUsage::logCommand(const std::string& command)
|
||||
{
|
||||
mCommandCounts[sanitized(command)]++;
|
||||
LL_DEBUGS("UIUsage") << "command " << command << LL_ENDL;
|
||||
}
|
||||
|
||||
void LLUIUsage::logControl(const std::string& control)
|
||||
{
|
||||
mControlCounts[sanitized(control)]++;
|
||||
LL_DEBUGS("UIUsage") << "control " << control << LL_ENDL;
|
||||
}
|
||||
|
||||
|
||||
void LLUIUsage::logFloater(const std::string& floater)
|
||||
{
|
||||
mFloaterCounts[sanitized(floater)]++;
|
||||
LL_DEBUGS("UIUsage") << "floater " << floater << LL_ENDL;
|
||||
}
|
||||
|
||||
void LLUIUsage::logPanel(const std::string& p)
|
||||
{
|
||||
mPanelCounts[sanitized(p)]++;
|
||||
LL_DEBUGS("UIUsage") << "panel " << p << LL_ENDL;
|
||||
}
|
||||
|
||||
LLSD LLUIUsage::asLLSD() const
|
||||
{
|
||||
LLSD result;
|
||||
for (auto const& it : mCommandCounts)
|
||||
{
|
||||
result["commands"][it.first] = LLSD::Integer(it.second);
|
||||
}
|
||||
for (auto const& it : mControlCounts)
|
||||
{
|
||||
setLLSDPath(result["controls"], it.first, 2, LLSD::Integer(it.second));
|
||||
}
|
||||
for (auto const& it : mFloaterCounts)
|
||||
{
|
||||
result["floaters"][it.first] = LLSD::Integer(it.second);
|
||||
}
|
||||
for (auto const& it : mPanelCounts)
|
||||
{
|
||||
result["panels"][it.first] = LLSD::Integer(it.second);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// Clear up some junk content generated during initial login/UI initialization
|
||||
void LLUIUsage::clear()
|
||||
{
|
||||
|
||||
LL_DEBUGS("UIUsage") << "clear" << LL_ENDL;
|
||||
mCommandCounts.clear();
|
||||
mControlCounts.clear();
|
||||
mFloaterCounts.clear();
|
||||
mPanelCounts.clear();
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
/**
|
||||
* @file lluiuisage.h
|
||||
* @brief Header file for LLUIUsage
|
||||
*
|
||||
* $LicenseInfo:firstyear=2021&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2021, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LLUIUSAGE_H
|
||||
#define LL_LLUIUSAGE_H
|
||||
|
||||
#include <map>
|
||||
#include "llsd.h"
|
||||
#include "llsingleton.h"
|
||||
|
||||
// UIUsage tracking to see which operations and UI elements are most popular in a session
|
||||
class LLUIUsage : public LLSingleton<LLUIUsage>
|
||||
{
|
||||
public:
|
||||
LLSINGLETON(LLUIUsage);
|
||||
~LLUIUsage();
|
||||
public:
|
||||
static std::string sanitized(const std::string& s);
|
||||
static void setLLSDPath(LLSD& sd, const std::string& path, S32 max_elts, const LLSD& val);
|
||||
static void setLLSDNested(LLSD& sd, const std::vector<std::string>& fields, const LLSD& val);
|
||||
void logCommand(const std::string& command);
|
||||
void logControl(const std::string& control);
|
||||
void logFloater(const std::string& floater);
|
||||
void logPanel(const std::string& p);
|
||||
LLSD asLLSD() const;
|
||||
void clear();
|
||||
private:
|
||||
std::map<std::string,U32> mCommandCounts;
|
||||
std::map<std::string,U32> mControlCounts;
|
||||
std::map<std::string,U32> mFloaterCounts;
|
||||
std::map<std::string,U32> mPanelCounts;
|
||||
};
|
||||
|
||||
#endif // LLUIUIUSAGE.h
|
||||
|
|
@ -517,8 +517,7 @@ LLUrlEntrySimpleSecondlifeURL::LLUrlEntrySimpleSecondlifeURL()
|
|||
// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/about
|
||||
// x-grid-location-info://lincoln.lindenlab.com/app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/about
|
||||
//
|
||||
LLUrlEntryAgent::LLUrlEntryAgent() :
|
||||
mAvatarNameCacheConnection()
|
||||
LLUrlEntryAgent::LLUrlEntryAgent()
|
||||
{
|
||||
mPattern = boost::regex(APP_HEADER_REGEX "/agent/[\\da-f-]+/\\w+",
|
||||
boost::regex::perl|boost::regex::icase);
|
||||
|
|
@ -549,7 +548,15 @@ void LLUrlEntryAgent::callObservers(const std::string &id,
|
|||
void LLUrlEntryAgent::onAvatarNameCache(const LLUUID& id,
|
||||
const LLAvatarName& av_name)
|
||||
{
|
||||
mAvatarNameCacheConnection.disconnect();
|
||||
avatar_name_cache_connection_map_t::iterator it = mAvatarNameCacheConnections.find(id);
|
||||
if (it != mAvatarNameCacheConnections.end())
|
||||
{
|
||||
if (it->second.connected())
|
||||
{
|
||||
it->second.disconnect();
|
||||
}
|
||||
mAvatarNameCacheConnections.erase(it);
|
||||
}
|
||||
|
||||
std::string label = av_name.getCompleteName();
|
||||
|
||||
|
|
@ -636,11 +643,17 @@ std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCa
|
|||
}
|
||||
else
|
||||
{
|
||||
if (mAvatarNameCacheConnection.connected())
|
||||
avatar_name_cache_connection_map_t::iterator it = mAvatarNameCacheConnections.find(agent_id);
|
||||
if (it != mAvatarNameCacheConnections.end())
|
||||
{
|
||||
mAvatarNameCacheConnection.disconnect();
|
||||
if (it->second.connected())
|
||||
{
|
||||
it->second.disconnect();
|
||||
}
|
||||
mAvatarNameCacheConnections.erase(it);
|
||||
}
|
||||
mAvatarNameCacheConnection = LLAvatarNameCache::get(agent_id, boost::bind(&LLUrlEntryAgent::onAvatarNameCache, this, _1, _2));
|
||||
mAvatarNameCacheConnections[agent_id] = LLAvatarNameCache::get(agent_id, boost::bind(&LLUrlEntryAgent::onAvatarNameCache, this, _1, _2));
|
||||
|
||||
addObserver(agent_id_string, url, cb);
|
||||
return LLTrans::getString("LoadingData");
|
||||
}
|
||||
|
|
@ -701,14 +714,21 @@ std::string LLUrlEntryAgent::getIcon(const std::string &url)
|
|||
// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/(completename|displayname|username)
|
||||
// x-grid-location-info://lincoln.lindenlab.com/app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/(completename|displayname|username)
|
||||
//
|
||||
LLUrlEntryAgentName::LLUrlEntryAgentName() :
|
||||
mAvatarNameCacheConnection()
|
||||
LLUrlEntryAgentName::LLUrlEntryAgentName()
|
||||
{}
|
||||
|
||||
void LLUrlEntryAgentName::onAvatarNameCache(const LLUUID& id,
|
||||
const LLAvatarName& av_name)
|
||||
{
|
||||
mAvatarNameCacheConnection.disconnect();
|
||||
avatar_name_cache_connection_map_t::iterator it = mAvatarNameCacheConnections.find(id);
|
||||
if (it != mAvatarNameCacheConnections.end())
|
||||
{
|
||||
if (it->second.connected())
|
||||
{
|
||||
it->second.disconnect();
|
||||
}
|
||||
mAvatarNameCacheConnections.erase(it);
|
||||
}
|
||||
|
||||
std::string label = getName(av_name);
|
||||
// received the agent name from the server - tell our observers
|
||||
|
|
@ -743,11 +763,17 @@ std::string LLUrlEntryAgentName::getLabel(const std::string &url, const LLUrlLab
|
|||
}
|
||||
else
|
||||
{
|
||||
if (mAvatarNameCacheConnection.connected())
|
||||
avatar_name_cache_connection_map_t::iterator it = mAvatarNameCacheConnections.find(agent_id);
|
||||
if (it != mAvatarNameCacheConnections.end())
|
||||
{
|
||||
mAvatarNameCacheConnection.disconnect();
|
||||
if (it->second.connected())
|
||||
{
|
||||
it->second.disconnect();
|
||||
}
|
||||
mAvatarNameCacheConnections.erase(it);
|
||||
}
|
||||
mAvatarNameCacheConnection = LLAvatarNameCache::get(agent_id, boost::bind(&LLUrlEntryAgentName::onAvatarNameCache, this, _1, _2));
|
||||
mAvatarNameCacheConnections[agent_id] = LLAvatarNameCache::get(agent_id, boost::bind(&LLUrlEntryAgentName::onAvatarNameCache, this, _1, _2));
|
||||
|
||||
addObserver(agent_id_string, url, cb);
|
||||
return LLTrans::getString("LoadingData");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -212,10 +212,14 @@ public:
|
|||
LLUrlEntryAgent();
|
||||
~LLUrlEntryAgent()
|
||||
{
|
||||
if (mAvatarNameCacheConnection.connected())
|
||||
for (avatar_name_cache_connection_map_t::iterator it = mAvatarNameCacheConnections.begin(); it != mAvatarNameCacheConnections.end(); ++it)
|
||||
{
|
||||
mAvatarNameCacheConnection.disconnect();
|
||||
if (it->second.connected())
|
||||
{
|
||||
it->second.disconnect();
|
||||
}
|
||||
}
|
||||
mAvatarNameCacheConnections.clear();
|
||||
}
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
|
||||
/*virtual*/ std::string getIcon(const std::string &url);
|
||||
|
|
@ -227,7 +231,9 @@ protected:
|
|||
/*virtual*/ void callObservers(const std::string &id, const std::string &label, const std::string& icon);
|
||||
private:
|
||||
void onAvatarNameCache(const LLUUID& id, const LLAvatarName& av_name);
|
||||
boost::signals2::connection mAvatarNameCacheConnection;
|
||||
|
||||
typedef std::map<LLUUID, boost::signals2::connection> avatar_name_cache_connection_map_t;
|
||||
avatar_name_cache_connection_map_t mAvatarNameCacheConnections;
|
||||
};
|
||||
|
||||
///
|
||||
|
|
@ -241,10 +247,14 @@ public:
|
|||
LLUrlEntryAgentName();
|
||||
~LLUrlEntryAgentName()
|
||||
{
|
||||
if (mAvatarNameCacheConnection.connected())
|
||||
for (avatar_name_cache_connection_map_t::iterator it = mAvatarNameCacheConnections.begin(); it != mAvatarNameCacheConnections.end(); ++it)
|
||||
{
|
||||
mAvatarNameCacheConnection.disconnect();
|
||||
if (it->second.connected())
|
||||
{
|
||||
it->second.disconnect();
|
||||
}
|
||||
}
|
||||
mAvatarNameCacheConnections.clear();
|
||||
}
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
|
||||
/*virtual*/ LLStyle::Params getStyle() const;
|
||||
|
|
@ -253,7 +263,9 @@ protected:
|
|||
virtual std::string getName(const LLAvatarName& avatar_name) = 0;
|
||||
private:
|
||||
void onAvatarNameCache(const LLUUID& id, const LLAvatarName& av_name);
|
||||
boost::signals2::connection mAvatarNameCacheConnection;
|
||||
|
||||
typedef std::map<LLUUID, boost::signals2::connection> avatar_name_cache_connection_map_t;
|
||||
avatar_name_cache_connection_map_t mAvatarNameCacheConnections;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1402,7 +1402,9 @@ void LLView::reshape(S32 width, S32 height, BOOL called_from_parent)
|
|||
S32 delta_x = child_rect.mLeft - viewp->getRect().mLeft;
|
||||
S32 delta_y = child_rect.mBottom - viewp->getRect().mBottom;
|
||||
viewp->translate( delta_x, delta_y );
|
||||
if (child_rect.getWidth() != viewp->getRect().getWidth() || child_rect.getHeight() != viewp->getRect().getHeight())
|
||||
if (child_rect.getWidth() != viewp->getRect().getWidth()
|
||||
|| child_rect.getHeight() != viewp->getRect().getHeight()
|
||||
|| sForceReshape)
|
||||
{
|
||||
viewp->reshape(child_rect.getWidth(), child_rect.getHeight());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -348,6 +348,42 @@ LLQuaternion LLVirtualTrackball::getRotation() const
|
|||
return mValue;
|
||||
}
|
||||
|
||||
// static
|
||||
void LLVirtualTrackball::getAzimuthAndElevation(const LLQuaternion &quat, F32 &azimuth, F32 &elevation)
|
||||
{
|
||||
// LLQuaternion has own function to get azimuth, but it doesn't appear to return correct values (meant for 2d?)
|
||||
LLVector3 point = VectorZero * quat;
|
||||
|
||||
if (!is_approx_zero(point.mV[VX]) || !is_approx_zero(point.mV[VY]))
|
||||
{
|
||||
azimuth = atan2f(point.mV[VX], point.mV[VY]);
|
||||
}
|
||||
else
|
||||
{
|
||||
azimuth = 0;
|
||||
}
|
||||
|
||||
azimuth -= F_PI_BY_TWO;
|
||||
|
||||
if (azimuth < 0)
|
||||
{
|
||||
azimuth += F_PI * 2;
|
||||
}
|
||||
|
||||
// while vector is '1', F32 is not sufficiently precise and we can get
|
||||
// values like 1.0000012 which will result in -90deg angle instead of 90deg
|
||||
F32 z = llclamp(point.mV[VZ], -1.f, 1.f);
|
||||
elevation = asin(z); // because VectorZero's length is '1'
|
||||
}
|
||||
|
||||
// static
|
||||
void LLVirtualTrackball::getAzimuthAndElevationDeg(const LLQuaternion &quat, F32 &azimuth, F32 &elevation)
|
||||
{
|
||||
getAzimuthAndElevation(quat, azimuth, elevation);
|
||||
azimuth *= RAD_TO_DEG;
|
||||
elevation *= RAD_TO_DEG;
|
||||
}
|
||||
|
||||
BOOL LLVirtualTrackball::handleHover(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
if (hasMouseCapture())
|
||||
|
|
@ -409,6 +445,10 @@ BOOL LLVirtualTrackball::handleHover(S32 x, S32 y, MASK mask)
|
|||
mValue *= az_quat;
|
||||
}
|
||||
|
||||
// we are doing a lot of F32 mathematical operations with loss of precision,
|
||||
// re-normalize to compensate
|
||||
mValue.normalize();
|
||||
|
||||
mPrevX = x;
|
||||
mPrevY = y;
|
||||
onCommit();
|
||||
|
|
|
|||
|
|
@ -96,6 +96,9 @@ public:
|
|||
void setRotation(const LLQuaternion &value);
|
||||
LLQuaternion getRotation() const;
|
||||
|
||||
static void getAzimuthAndElevation(const LLQuaternion &quat, F32 &azimuth, F32 &elevation);
|
||||
static void getAzimuthAndElevationDeg(const LLQuaternion &quat, F32 &azimuth, F32 &elevation);
|
||||
|
||||
protected:
|
||||
friend class LLUICtrlFactory;
|
||||
LLVirtualTrackball(const Params&);
|
||||
|
|
|
|||
|
|
@ -61,9 +61,6 @@ LLDir_Win32 gDirUtil;
|
|||
#elif LL_DARWIN
|
||||
#include "lldir_mac.h"
|
||||
LLDir_Mac gDirUtil;
|
||||
#elif LL_SOLARIS
|
||||
#include "lldir_solaris.h"
|
||||
LLDir_Solaris gDirUtil;
|
||||
#else
|
||||
#include "lldir_linux.h"
|
||||
LLDir_Linux gDirUtil;
|
||||
|
|
|
|||
|
|
@ -27,11 +27,6 @@
|
|||
#ifndef LL_LLDIR_H
|
||||
#define LL_LLDIR_H
|
||||
|
||||
#if LL_SOLARIS
|
||||
#include <sys/param.h>
|
||||
#define MAX_PATH MAXPATHLEN
|
||||
#endif
|
||||
|
||||
// these numbers are read from settings_files.xml, so we need to be explicit
|
||||
typedef enum ELLPath
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,266 +0,0 @@
|
|||
/**
|
||||
* @file fmodwrapper.cpp
|
||||
* @brief dummy source file for building a shared library to wrap libfmod.a
|
||||
*
|
||||
* $LicenseInfo:firstyear=2005&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "linden_common.h"
|
||||
|
||||
#include "lldir_solaris.h"
|
||||
#include "llerror.h"
|
||||
#include "llrand.h"
|
||||
#include "llstring.h"
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <glob.h>
|
||||
#include <pwd.h>
|
||||
#include <sys/utsname.h>
|
||||
#define _STRUCTURED_PROC 1
|
||||
#include <sys/procfs.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
static std::string getCurrentUserHome(char* fallback)
|
||||
{
|
||||
// fwiw this exactly duplicates getCurrentUserHome() in lldir_linux.cpp...
|
||||
// we should either derive both from LLDir_Posix or just axe Solaris.
|
||||
const uid_t uid = getuid();
|
||||
struct passwd *pw;
|
||||
|
||||
pw = getpwuid(uid);
|
||||
if ((pw != NULL) && (pw->pw_dir != NULL))
|
||||
{
|
||||
return pw->pw_dir;
|
||||
}
|
||||
|
||||
LL_INFOS() << "Couldn't detect home directory from passwd - trying $HOME" << LL_ENDL;
|
||||
auto home_env = LLStringUtil::getoptenv("HOME");
|
||||
if (home_env)
|
||||
{
|
||||
return *home_env;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "Couldn't detect home directory! Falling back to " << fallback << LL_ENDL;
|
||||
return fallback;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LLDir_Solaris::LLDir_Solaris()
|
||||
{
|
||||
mDirDelimiter = "/";
|
||||
mCurrentDirIndex = -1;
|
||||
mCurrentDirCount = -1;
|
||||
mDirp = NULL;
|
||||
|
||||
char tmp_str[LL_MAX_PATH]; /* Flawfinder: ignore */
|
||||
if (getcwd(tmp_str, LL_MAX_PATH) == NULL)
|
||||
{
|
||||
strcpy(tmp_str, "/tmp");
|
||||
LL_WARNS() << "Could not get current directory; changing to "
|
||||
<< tmp_str << LL_ENDL;
|
||||
if (chdir(tmp_str) == -1)
|
||||
{
|
||||
LL_ERRS() << "Could not change directory to " << tmp_str << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
mExecutableFilename = "";
|
||||
mExecutablePathAndName = "";
|
||||
mExecutableDir = strdup(tmp_str);
|
||||
mWorkingDir = strdup(tmp_str);
|
||||
mAppRODataDir = strdup(tmp_str);
|
||||
mOSUserDir = getCurrentUserHome(tmp_str);
|
||||
mOSUserAppDir = "";
|
||||
mLindenUserDir = "";
|
||||
|
||||
char path [LL_MAX_PATH]; /* Flawfinder: ignore */
|
||||
|
||||
sprintf(path, "/proc/%d/psinfo", (int)getpid());
|
||||
int proc_fd = -1;
|
||||
if((proc_fd = open(path, O_RDONLY)) == -1){
|
||||
LL_WARNS() << "unable to open " << path << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
psinfo_t proc_psinfo;
|
||||
if(read(proc_fd, &proc_psinfo, sizeof(psinfo_t)) != sizeof(psinfo_t)){
|
||||
LL_WARNS() << "Unable to read " << path << LL_ENDL;
|
||||
close(proc_fd);
|
||||
return;
|
||||
}
|
||||
|
||||
close(proc_fd);
|
||||
|
||||
mExecutableFilename = strdup(proc_psinfo.pr_fname);
|
||||
LL_INFOS() << "mExecutableFilename = [" << mExecutableFilename << "]" << LL_ENDL;
|
||||
|
||||
sprintf(path, "/proc/%d/path/a.out", (int)getpid());
|
||||
|
||||
char execpath[LL_MAX_PATH];
|
||||
if(readlink(path, execpath, LL_MAX_PATH) == -1){
|
||||
LL_WARNS() << "Unable to read link from " << path << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
|
||||
char *p = execpath; // nuke trash in link, if any exists
|
||||
int i = 0;
|
||||
while(*p != NULL && ++i < LL_MAX_PATH && isprint((int)(*p++)));
|
||||
*p = NULL;
|
||||
|
||||
mExecutablePathAndName = strdup(execpath);
|
||||
LL_INFOS() << "mExecutablePathAndName = [" << mExecutablePathAndName << "]" << LL_ENDL;
|
||||
|
||||
//NOTE: Why force people to cd into the package directory?
|
||||
// Look for SECONDLIFE env variable and use it, if set.
|
||||
|
||||
auto SECONDLIFE(LLDirUtil::getoptenv("SECONDLIFE"));
|
||||
if(SECONDLIFE){
|
||||
mExecutableDir = add(*SECONDLIFE, "bin"); //NOTE: make sure we point at the bin
|
||||
}else{
|
||||
mExecutableDir = getDirName(execpath);
|
||||
LL_INFOS() << "mExecutableDir = [" << mExecutableDir << "]" << LL_ENDL;
|
||||
}
|
||||
|
||||
mLLPluginDir = add(mExecutableDir, "llplugin");
|
||||
|
||||
// *TODO: don't use /tmp, use $HOME/.secondlife/tmp or something.
|
||||
mTempDir = "/tmp";
|
||||
}
|
||||
|
||||
LLDir_Solaris::~LLDir_Solaris()
|
||||
{
|
||||
}
|
||||
|
||||
// Implementation
|
||||
|
||||
|
||||
void LLDir_Solaris::initAppDirs(const std::string &app_name,
|
||||
const std::string& app_read_only_data_dir)
|
||||
{
|
||||
// Allow override so test apps can read newview directory
|
||||
if (!app_read_only_data_dir.empty())
|
||||
{
|
||||
mAppRODataDir = app_read_only_data_dir;
|
||||
mSkinBaseDir = add(mAppRODataDir, "skins");
|
||||
}
|
||||
mAppName = app_name;
|
||||
|
||||
std::string upper_app_name(app_name);
|
||||
LLStringUtil::toUpper(upper_app_name);
|
||||
|
||||
auto app_home_env(LLStringUtil::getoptenv(upper_app_name + "_USER_DIR"));
|
||||
if (app_home_env)
|
||||
{
|
||||
// user has specified own userappdir i.e. $SECONDLIFE_USER_DIR
|
||||
mOSUserAppDir = *app_home_env;
|
||||
}
|
||||
else
|
||||
{
|
||||
// traditionally on unixoids, MyApp gets ~/.myapp dir for data
|
||||
mOSUserAppDir = mOSUserDir;
|
||||
mOSUserAppDir += "/";
|
||||
mOSUserAppDir += ".";
|
||||
std::string lower_app_name(app_name);
|
||||
LLStringUtil::toLower(lower_app_name);
|
||||
mOSUserAppDir += lower_app_name;
|
||||
}
|
||||
|
||||
// create any directories we expect to write to.
|
||||
|
||||
int res = LLFile::mkdir(mOSUserAppDir);
|
||||
if (res == -1)
|
||||
{
|
||||
LL_WARNS() << "Couldn't create app user dir " << mOSUserAppDir << LL_ENDL;
|
||||
LL_WARNS() << "Default to base dir" << mOSUserDir << LL_ENDL;
|
||||
mOSUserAppDir = mOSUserDir;
|
||||
}
|
||||
|
||||
res = LLFile::mkdir(getExpandedFilename(LL_PATH_LOGS,""));
|
||||
if (res == -1)
|
||||
{
|
||||
LL_WARNS() << "Couldn't create LL_PATH_LOGS dir " << getExpandedFilename(LL_PATH_LOGS,"") << LL_ENDL;
|
||||
}
|
||||
|
||||
res = LLFile::mkdir(getExpandedFilename(LL_PATH_USER_SETTINGS,""));
|
||||
if (res == -1)
|
||||
{
|
||||
LL_WARNS() << "Couldn't create LL_PATH_USER_SETTINGS dir " << getExpandedFilename(LL_PATH_USER_SETTINGS,"") << LL_ENDL;
|
||||
}
|
||||
|
||||
res = LLFile::mkdir(getExpandedFilename(LL_PATH_CACHE,""));
|
||||
if (res == -1)
|
||||
{
|
||||
LL_WARNS() << "Couldn't create LL_PATH_CACHE dir " << getExpandedFilename(LL_PATH_CACHE,"") << LL_ENDL;
|
||||
}
|
||||
|
||||
mCAFile = getExpandedFilename(LL_PATH_EXECUTABLE, "ca-bundle.crt");
|
||||
}
|
||||
|
||||
U32 LLDir_Solaris::countFilesInDir(const std::string &dirname, const std::string &mask)
|
||||
{
|
||||
U32 file_count = 0;
|
||||
glob_t g;
|
||||
|
||||
std::string tmp_str;
|
||||
tmp_str = dirname;
|
||||
tmp_str += mask;
|
||||
|
||||
if(glob(tmp_str.c_str(), GLOB_NOSORT, NULL, &g) == 0)
|
||||
{
|
||||
file_count = g.gl_pathc;
|
||||
|
||||
globfree(&g);
|
||||
}
|
||||
|
||||
return (file_count);
|
||||
}
|
||||
|
||||
std::string LLDir_Solaris::getCurPath()
|
||||
{
|
||||
char tmp_str[LL_MAX_PATH]; /* Flawfinder: ignore */
|
||||
if (getcwd(tmp_str, LL_MAX_PATH) == NULL)
|
||||
{
|
||||
LL_WARNS() << "Could not get current directory" << LL_ENDL;
|
||||
tmp_str[0] = '\0';
|
||||
}
|
||||
return tmp_str;
|
||||
}
|
||||
|
||||
|
||||
bool LLDir_Solaris::fileExists(const std::string &filename) const
|
||||
{
|
||||
struct stat stat_data;
|
||||
// Check the age of the file
|
||||
// Now, we see if the files we've gathered are recent...
|
||||
int res = stat(filename.c_str(), &stat_data);
|
||||
if (!res)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
/**
|
||||
* @file fmodwrapper.cpp
|
||||
* @brief dummy source file for building a shared library to wrap libfmod.a
|
||||
*
|
||||
* $LicenseInfo:firstyear=2005&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#if !LL_SOLARIS
|
||||
#error This header must not be included when compiling for any target other than Solaris. Consider including lldir.h instead.
|
||||
#endif // !LL_SOLARIS
|
||||
|
||||
#ifndef LL_LLDIR_SOLARIS_H
|
||||
#define LL_LLDIR_SOLARIS_H
|
||||
|
||||
#include "lldir.h"
|
||||
|
||||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
|
||||
class LLDir_Solaris : public LLDir
|
||||
{
|
||||
public:
|
||||
LLDir_Solaris();
|
||||
virtual ~LLDir_Solaris();
|
||||
|
||||
/*virtual*/ void initAppDirs(const std::string &app_name,
|
||||
const std::string& app_read_only_data_dir);
|
||||
|
||||
virtual std::string getCurPath();
|
||||
virtual U32 countFilesInDir(const std::string &dirname, const std::string &mask);
|
||||
/*virtual*/ bool fileExists(const std::string &filename) const;
|
||||
|
||||
private:
|
||||
DIR *mDirp;
|
||||
int mCurrentDirIndex;
|
||||
int mCurrentDirCount;
|
||||
std::string mCurrentDir;
|
||||
};
|
||||
|
||||
#endif // LL_LLDIR_SOLARIS_H
|
||||
|
||||
|
||||
|
|
@ -33,10 +33,6 @@
|
|||
#include <map>
|
||||
#if LL_WINDOWS
|
||||
#include <share.h>
|
||||
#elif LL_SOLARIS
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#else
|
||||
#include <sys/file.h>
|
||||
#endif
|
||||
|
|
@ -2146,12 +2142,6 @@ LLFILE *LLVFS::openAndLock(const std::string& filename, const char* mode, BOOL r
|
|||
int fd;
|
||||
|
||||
// first test the lock in a non-destructive way
|
||||
#if LL_SOLARIS
|
||||
struct flock fl;
|
||||
fl.l_whence = SEEK_SET;
|
||||
fl.l_start = 0;
|
||||
fl.l_len = 1;
|
||||
#else // !LL_SOLARIS
|
||||
if (strchr(mode, 'w') != NULL)
|
||||
{
|
||||
fp = LLFile::fopen(filename, "rb"); /* Flawfinder: ignore */
|
||||
|
|
@ -2167,19 +2157,13 @@ LLFILE *LLVFS::openAndLock(const std::string& filename, const char* mode, BOOL r
|
|||
fclose(fp);
|
||||
}
|
||||
}
|
||||
#endif // !LL_SOLARIS
|
||||
|
||||
// now actually open the file for use
|
||||
fp = LLFile::fopen(filename, mode); /* Flawfinder: ignore */
|
||||
if (fp)
|
||||
{
|
||||
fd = fileno(fp);
|
||||
#if LL_SOLARIS
|
||||
fl.l_type = read_lock ? F_RDLCK : F_WRLCK;
|
||||
if (fcntl(fd, F_SETLK, &fl) == -1)
|
||||
#else
|
||||
if (flock(fd, (read_lock ? LOCK_SH : LOCK_EX) | LOCK_NB) == -1)
|
||||
#endif
|
||||
{
|
||||
fclose(fp);
|
||||
fp = NULL;
|
||||
|
|
@ -2207,14 +2191,6 @@ void LLVFS::unlockAndClose(LLFILE *fp)
|
|||
flock(fd, LOCK_UN);
|
||||
#endif
|
||||
*/
|
||||
#if LL_SOLARIS
|
||||
struct flock fl;
|
||||
fl.l_whence = SEEK_SET;
|
||||
fl.l_start = 0;
|
||||
fl.l_len = 1;
|
||||
fl.l_type = F_UNLCK;
|
||||
fcntl(fileno(fp), F_SETLK, &fl);
|
||||
#endif
|
||||
fclose(fp);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -263,6 +263,18 @@ std::vector<std::string> LLWindow::getDynamicFallbackFontList()
|
|||
#endif
|
||||
}
|
||||
|
||||
// static
|
||||
std::vector<std::string> LLWindow::getDisplaysResolutionList()
|
||||
{
|
||||
#if LL_WINDOWS
|
||||
return LLWindowWin32::getDisplaysResolutionList();
|
||||
#elif LL_DARWIN
|
||||
return LLWindowMacOSX::getDisplaysResolutionList();
|
||||
#else
|
||||
return std::vector<std::string>();
|
||||
#endif
|
||||
}
|
||||
|
||||
#define UTF16_IS_HIGH_SURROGATE(U) ((U16)((U) - 0xD800) < 0x0400)
|
||||
#define UTF16_IS_LOW_SURROGATE(U) ((U16)((U) - 0xDC00) < 0x0400)
|
||||
#define UTF16_SURROGATE_PAIR_TO_UTF32(H,L) (((H) << 10) + (L) - (0xD800 << 10) - 0xDC00 + 0x00010000)
|
||||
|
|
|
|||
|
|
@ -169,6 +169,8 @@ public:
|
|||
// Get system UI size based on DPI (for 96 DPI UI size should be 1.0)
|
||||
virtual F32 getSystemUISize() { return 1.0; }
|
||||
|
||||
static std::vector<std::string> getDisplaysResolutionList();
|
||||
|
||||
// windows only DirectInput8 for joysticks
|
||||
virtual void* getDirectInput8() { return NULL; };
|
||||
virtual bool getInputDevices(U32 device_type_filter, void * devices_callback, void* userdata) { return false; };
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@
|
|||
#include <OpenGL/OpenGL.h>
|
||||
#include <Carbon/Carbon.h>
|
||||
#include <CoreServices/CoreServices.h>
|
||||
#include <CoreGraphics/CGDisplayConfiguration.h>
|
||||
|
||||
extern BOOL gDebugWindowProc;
|
||||
BOOL gHiDPISupport = TRUE;
|
||||
|
|
@ -1911,6 +1912,35 @@ void LLWindowMacOSX::interruptLanguageTextInput()
|
|||
commitCurrentPreedit(mGLView);
|
||||
}
|
||||
|
||||
std::vector<std::string> LLWindowMacOSX::getDisplaysResolutionList()
|
||||
{
|
||||
std::vector<std::string> resolution_list;
|
||||
|
||||
CGDirectDisplayID display_ids[10];
|
||||
uint32_t found_displays = 0;
|
||||
CGError err = CGGetActiveDisplayList(10, display_ids, &found_displays);
|
||||
|
||||
if (kCGErrorSuccess != err)
|
||||
{
|
||||
LL_WARNS() << "Couldn't get a list of active displays" << LL_ENDL;
|
||||
return std::vector<std::string>();
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < found_displays; i++)
|
||||
{
|
||||
S32 monitor_width = CGDisplayPixelsWide(display_ids[i]);
|
||||
S32 monitor_height = CGDisplayPixelsHigh(display_ids[i]);
|
||||
|
||||
std::ostringstream sstream;
|
||||
sstream << monitor_width << "x" << monitor_height;;
|
||||
std::string res = sstream.str();
|
||||
|
||||
resolution_list.push_back(res);
|
||||
}
|
||||
|
||||
return resolution_list;
|
||||
}
|
||||
|
||||
//static
|
||||
std::vector<std::string> LLWindowMacOSX::getDynamicFallbackFontList()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -114,6 +114,8 @@ public:
|
|||
/*virtual*/ void spawnWebBrowser(const std::string& escaped_url, bool async);
|
||||
/*virtual*/ F32 getSystemUISize();
|
||||
|
||||
static std::vector<std::string> getDisplaysResolutionList();
|
||||
|
||||
static std::vector<std::string> getDynamicFallbackFontList();
|
||||
|
||||
// Provide native key event data
|
||||
|
|
|
|||
|
|
@ -51,13 +51,13 @@ extern "C" {
|
|||
# include "fontconfig/fontconfig.h"
|
||||
}
|
||||
|
||||
#if LL_LINUX || LL_SOLARIS
|
||||
#if LL_LINUX
|
||||
// not necessarily available on random SDL platforms, so #if LL_LINUX
|
||||
// for execv(), waitpid(), fork()
|
||||
# include <unistd.h>
|
||||
# include <sys/types.h>
|
||||
# include <sys/wait.h>
|
||||
#endif // LL_LINUX || LL_SOLARIS
|
||||
#endif // LL_LINUX
|
||||
|
||||
extern BOOL gDebugWindowProc;
|
||||
|
||||
|
|
@ -323,12 +323,6 @@ static int x11_detect_VRAM_kb_fp(FILE *fp, const char *prefix_str)
|
|||
|
||||
static int x11_detect_VRAM_kb()
|
||||
{
|
||||
#if LL_SOLARIS && defined(__sparc)
|
||||
// NOTE: there's no Xorg server on SPARC so just return 0
|
||||
// and allow SDL to attempt to get the amount of VRAM
|
||||
return(0);
|
||||
#else
|
||||
|
||||
std::string x_log_location("/var/log/");
|
||||
std::string fname;
|
||||
int rtn = 0; // 'could not detect'
|
||||
|
|
@ -409,7 +403,6 @@ static int x11_detect_VRAM_kb()
|
|||
}
|
||||
}
|
||||
return rtn;
|
||||
#endif // LL_SOLARIS
|
||||
}
|
||||
#endif // LL_X11
|
||||
|
||||
|
|
@ -484,27 +477,10 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
|
|||
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
|
||||
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE,8);
|
||||
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
|
||||
#if !LL_SOLARIS
|
||||
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, (bits <= 16) ? 16 : 24);
|
||||
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, (bits <= 16) ? 16 : 24);
|
||||
// We need stencil support for a few (minor) things.
|
||||
if (!getenv("LL_GL_NO_STENCIL"))
|
||||
SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8);
|
||||
#else
|
||||
// NOTE- use smaller Z-buffer to enable more graphics cards
|
||||
// - This should not affect better GPUs and has been proven
|
||||
// to provide 24-bit z-buffers when available.
|
||||
//
|
||||
// As the API states:
|
||||
//
|
||||
// GLX_DEPTH_SIZE Must be followed by a nonnegative
|
||||
// minimum size specification. If this
|
||||
// value is zero, visuals with no depth
|
||||
// buffer are preferred. Otherwise, the
|
||||
// largest available depth buffer of at
|
||||
// least the minimum size is preferred.
|
||||
|
||||
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
|
||||
#endif
|
||||
SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, (bits <= 16) ? 1 : 8);
|
||||
|
||||
// *FIX: try to toggle vsync here?
|
||||
|
|
@ -682,25 +658,13 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
|
|||
// fixme: actually, it's REALLY important for picking that we get at
|
||||
// least 8 bits each of red,green,blue. Alpha we can be a bit more
|
||||
// relaxed about if we have to.
|
||||
#if LL_SOLARIS && defined(__sparc)
|
||||
// again the __sparc required because Xsun support, 32bit are very pricey on SPARC
|
||||
if(colorBits < 24) //HACK: on SPARC allow 24-bit color
|
||||
#else
|
||||
if (colorBits < 32)
|
||||
#endif
|
||||
{
|
||||
close();
|
||||
setupFailure(
|
||||
#if LL_SOLARIS && defined(__sparc)
|
||||
"Second Life requires at least 24-bit color on SPARC to run in a window.\n"
|
||||
"Please use fbconfig to set your default color depth to 24 bits.\n"
|
||||
"You may also need to adjust the X11 setting in SMF. To do so use\n"
|
||||
" 'svccfg -s svc:/application/x11/x11-server setprop options/default_depth=24'\n"
|
||||
#else
|
||||
"Second Life requires True Color (32-bit) to run in a window.\n"
|
||||
"Please go to Control Panels -> Display -> Settings and\n"
|
||||
"set the screen to 32-bit color.\n"
|
||||
#endif
|
||||
"Alternately, if you choose to run fullscreen, Second Life\n"
|
||||
"will automatically adjust the screen each time it runs.",
|
||||
"Error",
|
||||
|
|
@ -2503,7 +2467,7 @@ BOOL LLWindowSDL::dialogColorPicker( F32 *r, F32 *g, F32 *b)
|
|||
}
|
||||
#endif // LL_GTK
|
||||
|
||||
#if LL_LINUX || LL_SOLARIS
|
||||
#if LL_LINUX
|
||||
// extracted from spawnWebBrowser for clarity and to eliminate
|
||||
// compiler confusion regarding close(int fd) vs. LLWindow::close()
|
||||
void exec_cmd(const std::string& cmd, const std::string& arg)
|
||||
|
|
@ -2559,7 +2523,7 @@ void LLWindowSDL::spawnWebBrowser(const std::string& escaped_url, bool async)
|
|||
|
||||
LL_INFOS() << "spawn_web_browser: " << escaped_url << LL_ENDL;
|
||||
|
||||
#if LL_LINUX || LL_SOLARIS
|
||||
#if LL_LINUX
|
||||
# if LL_X11
|
||||
if (mSDL_Display)
|
||||
{
|
||||
|
|
@ -2578,7 +2542,7 @@ void LLWindowSDL::spawnWebBrowser(const std::string& escaped_url, bool async)
|
|||
cmd += "launch_url.sh";
|
||||
arg = escaped_url;
|
||||
exec_cmd(cmd, arg);
|
||||
#endif // LL_LINUX || LL_SOLARIS
|
||||
#endif // LL_LINUX
|
||||
|
||||
LL_INFOS() << "spawn_web_browser returning." << LL_ENDL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
|
||||
// Linden library includes
|
||||
#include "llerror.h"
|
||||
#include "llexception.h"
|
||||
#include "llfasttimer.h"
|
||||
#include "llgl.h"
|
||||
#include "llstring.h"
|
||||
|
|
@ -121,7 +122,7 @@ void show_window_creation_error(const std::string& title)
|
|||
LL_WARNS("Window") << title << LL_ENDL;
|
||||
}
|
||||
|
||||
HGLRC SafeCreateContext(HDC hdc)
|
||||
HGLRC SafeCreateContext(HDC &hdc)
|
||||
{
|
||||
__try
|
||||
{
|
||||
|
|
@ -133,6 +134,22 @@ HGLRC SafeCreateContext(HDC hdc)
|
|||
}
|
||||
}
|
||||
|
||||
GLuint SafeChoosePixelFormat(HDC &hdc, const PIXELFORMATDESCRIPTOR *ppfd)
|
||||
{
|
||||
__try
|
||||
{
|
||||
return ChoosePixelFormat(hdc, ppfd);
|
||||
}
|
||||
__except (EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
// convert to C++ styled exception
|
||||
// C exception don't allow classes, so it's a regular char array
|
||||
char integer_string[32];
|
||||
sprintf(integer_string, "SEH, code: %lu\n", GetExceptionCode());
|
||||
throw std::exception(integer_string);
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
BOOL LLWindowWin32::sIsClassRegistered = FALSE;
|
||||
|
||||
|
|
@ -404,6 +421,39 @@ LLWinImm::~LLWinImm()
|
|||
}
|
||||
|
||||
|
||||
class LLMonitorInfo
|
||||
{
|
||||
public:
|
||||
|
||||
std::vector<std::string> getResolutionsList() { return mResList; }
|
||||
|
||||
LLMonitorInfo()
|
||||
{
|
||||
EnumDisplayMonitors(0, 0, MonitorEnum, (LPARAM)this);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
static BOOL CALLBACK MonitorEnum(HMONITOR hMon, HDC hdc, LPRECT lprcMonitor, LPARAM pData)
|
||||
{
|
||||
int monitor_width = lprcMonitor->right - lprcMonitor->left;
|
||||
int monitor_height = lprcMonitor->bottom - lprcMonitor->top;
|
||||
|
||||
std::ostringstream sstream;
|
||||
sstream << monitor_width << "x" << monitor_height;;
|
||||
std::string res = sstream.str();
|
||||
|
||||
LLMonitorInfo* pThis = reinterpret_cast<LLMonitorInfo*>(pData);
|
||||
pThis->mResList.push_back(res);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
std::vector<std::string> mResList;
|
||||
};
|
||||
|
||||
static LLMonitorInfo sMonitorInfo;
|
||||
|
||||
LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks,
|
||||
const std::string& title, const std::string& name, S32 x, S32 y, S32 width,
|
||||
S32 height, U32 flags,
|
||||
|
|
@ -432,6 +482,7 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks,
|
|||
memset(mCurrentGammaRamp, 0, sizeof(mCurrentGammaRamp));
|
||||
memset(mPrevGammaRamp, 0, sizeof(mPrevGammaRamp));
|
||||
mCustomGammaSet = FALSE;
|
||||
mWindowHandle = NULL;
|
||||
|
||||
if (!SystemParametersInfo(SPI_GETMOUSEVANISH, 0, &mMouseVanish, 0))
|
||||
{
|
||||
|
|
@ -695,6 +746,37 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks,
|
|||
// TrackMouseEvent( &track_mouse_event );
|
||||
// }
|
||||
|
||||
// SL-12971 dual GPU display
|
||||
DISPLAY_DEVICEA display_device;
|
||||
int display_index = -1;
|
||||
DWORD display_flags = 0; // EDD_GET_DEVICE_INTERFACE_NAME ?
|
||||
const size_t display_bytes = sizeof(display_device);
|
||||
|
||||
do
|
||||
{
|
||||
if (display_index >= 0)
|
||||
{
|
||||
// CHAR DeviceName [ 32] Adapter name
|
||||
// CHAR DeviceString[128]
|
||||
CHAR text[256];
|
||||
|
||||
size_t name_len = strlen(display_device.DeviceName );
|
||||
size_t desc_len = strlen(display_device.DeviceString);
|
||||
|
||||
CHAR *name = name_len ? display_device.DeviceName : "???";
|
||||
CHAR *desc = desc_len ? display_device.DeviceString : "???";
|
||||
|
||||
sprintf(text, "Display Device %d: %s, %s", display_index, name, desc);
|
||||
LL_INFOS("Window") << text << LL_ENDL;
|
||||
}
|
||||
|
||||
::ZeroMemory(&display_device,display_bytes);
|
||||
display_device.cb = display_bytes;
|
||||
|
||||
display_index++;
|
||||
} while( EnumDisplayDevicesA(NULL, display_index, &display_device, display_flags ));
|
||||
|
||||
LL_INFOS("Window") << "Total Display Devices: " << display_index << LL_ENDL;
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
// Create GL drawing context
|
||||
|
|
@ -1157,7 +1239,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
|
|||
<< " Height: " << (window_rect.bottom - window_rect.top)
|
||||
<< " Fullscreen: " << mFullscreen
|
||||
<< LL_ENDL;
|
||||
if (!destroy_window_handler(mWindowHandle))
|
||||
if (mWindowHandle && !destroy_window_handler(mWindowHandle))
|
||||
{
|
||||
LL_WARNS("Window") << "Failed to properly close window before recreating it!" << LL_ENDL;
|
||||
}
|
||||
|
|
@ -1216,11 +1298,24 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
|
|||
|
||||
LL_INFOS("Window") << "Device context retrieved." << LL_ENDL ;
|
||||
|
||||
if (!(pixel_format = ChoosePixelFormat(mhDC, &pfd)))
|
||||
try
|
||||
{
|
||||
// Looks like ChoosePixelFormat can crash in case of faulty driver
|
||||
if (!(pixel_format = SafeChoosePixelFormat(mhDC, &pfd)))
|
||||
{
|
||||
LL_WARNS("Window") << "ChoosePixelFormat failed, code: " << GetLastError() << LL_ENDL;
|
||||
OSMessageBox(mCallbacks->translateString("MBPixelFmtErr"),
|
||||
mCallbacks->translateString("MBError"), OSMB_OK);
|
||||
close();
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
LOG_UNHANDLED_EXCEPTION("ChoosePixelFormat");
|
||||
OSMessageBox(mCallbacks->translateString("MBPixelFmtErr"),
|
||||
mCallbacks->translateString("MBError"), OSMB_OK);
|
||||
close();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1449,21 +1544,27 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
|
|||
LL_INFOS("Window") << "pixel formats done." << LL_ENDL ;
|
||||
|
||||
S32 swap_method = 0;
|
||||
S32 cur_format = num_formats-1;
|
||||
S32 cur_format = 0;
|
||||
const S32 max_format = (S32)num_formats - 1;
|
||||
GLint swap_query = WGL_SWAP_METHOD_ARB;
|
||||
|
||||
BOOL found_format = FALSE;
|
||||
|
||||
while (!found_format && wglGetPixelFormatAttribivARB(mhDC, pixel_format, 0, 1, &swap_query, &swap_method))
|
||||
// SL-14705 Fix name tags showing in front of objects with AMD GPUs.
|
||||
// On AMD hardware we need to iterate from the first pixel format to the end.
|
||||
// Spec:
|
||||
// https://www.khronos.org/registry/OpenGL/extensions/ARB/WGL_ARB_pixel_format.txt
|
||||
while (wglGetPixelFormatAttribivARB(mhDC, pixel_formats[cur_format], 0, 1, &swap_query, &swap_method))
|
||||
{
|
||||
if (swap_method == WGL_SWAP_UNDEFINED_ARB || cur_format <= 0)
|
||||
if (swap_method == WGL_SWAP_UNDEFINED_ARB)
|
||||
{
|
||||
found_format = TRUE;
|
||||
break;
|
||||
}
|
||||
else
|
||||
else if (cur_format >= max_format)
|
||||
{
|
||||
--cur_format;
|
||||
cur_format = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
++cur_format;
|
||||
}
|
||||
|
||||
pixel_format = pixel_formats[cur_format];
|
||||
|
|
@ -1482,7 +1583,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
|
|||
}
|
||||
|
||||
// Destroy The Window
|
||||
if (!destroy_window_handler(mWindowHandle))
|
||||
if (mWindowHandle && !destroy_window_handler(mWindowHandle))
|
||||
{
|
||||
LL_WARNS("Window") << "Failed to properly close window!" << LL_ENDL;
|
||||
}
|
||||
|
|
@ -4287,6 +4388,12 @@ F32 LLWindowWin32::getSystemUISize()
|
|||
return scale_value;
|
||||
}
|
||||
|
||||
//static
|
||||
std::vector<std::string> LLWindowWin32::getDisplaysResolutionList()
|
||||
{
|
||||
return sMonitorInfo.getResolutionsList();
|
||||
}
|
||||
|
||||
//static
|
||||
std::vector<std::string> LLWindowWin32::getDynamicFallbackFontList()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -114,6 +114,7 @@ public:
|
|||
|
||||
LLWindowCallbacks::DragNDropResult completeDragNDropRequest( const LLCoordGL gl_coord, const MASK mask, LLWindowCallbacks::DragNDropAction action, const std::string url );
|
||||
|
||||
static std::vector<std::string> getDisplaysResolutionList();
|
||||
static std::vector<std::string> getDynamicFallbackFontList();
|
||||
static void setDPIAwareness();
|
||||
|
||||
|
|
|
|||
|
|
@ -209,6 +209,7 @@ set(viewer_SOURCE_FILES
|
|||
llflexibleobject.cpp
|
||||
llfloaterabout.cpp
|
||||
llfloaterbvhpreview.cpp
|
||||
llfloateraddpaymentmethod.cpp
|
||||
llfloaterauction.cpp
|
||||
llfloaterautoreplacesettings.cpp
|
||||
llfloateravatar.cpp
|
||||
|
|
@ -232,8 +233,10 @@ set(viewer_SOURCE_FILES
|
|||
llfloatercolorpicker.cpp
|
||||
llfloaterconversationlog.cpp
|
||||
llfloaterconversationpreview.cpp
|
||||
llfloatercreatelandmark.cpp
|
||||
llfloaterdeleteprefpreset.cpp
|
||||
llfloaterdestinations.cpp
|
||||
llfloatereditenvironmentbase.cpp
|
||||
llfloatereditextdaycycle.cpp
|
||||
llfloaterenvironmentadjust.cpp
|
||||
llfloaterevent.cpp
|
||||
|
|
@ -253,6 +256,7 @@ set(viewer_SOURCE_FILES
|
|||
llfloaterhandler.cpp
|
||||
llfloaterhelpbrowser.cpp
|
||||
llfloaterhoverheight.cpp
|
||||
llfloaterhowto.cpp
|
||||
llfloaterhud.cpp
|
||||
llfloaterimagepreview.cpp
|
||||
llfloaterimsessiontab.cpp
|
||||
|
|
@ -585,6 +589,7 @@ set(viewer_SOURCE_FILES
|
|||
llsyntaxid.cpp
|
||||
llsyswellitem.cpp
|
||||
llsyswellwindow.cpp
|
||||
lltelemetry.cpp
|
||||
llteleporthistory.cpp
|
||||
llteleporthistorystorage.cpp
|
||||
lltextureatlas.cpp
|
||||
|
|
@ -634,6 +639,7 @@ set(viewer_SOURCE_FILES
|
|||
llurl.cpp
|
||||
llurldispatcher.cpp
|
||||
llurldispatcherlistener.cpp
|
||||
llurlfloaterdispatchhandler.cpp
|
||||
llurlhistory.cpp
|
||||
llurllineeditorctrl.cpp
|
||||
llurlwhitelist.cpp
|
||||
|
|
@ -854,6 +860,7 @@ set(viewer_HEADER_FILES
|
|||
llflexibleobject.h
|
||||
llfloaterabout.h
|
||||
llfloaterbvhpreview.h
|
||||
llfloateraddpaymentmethod.h
|
||||
llfloaterauction.h
|
||||
llfloaterautoreplacesettings.h
|
||||
llfloateravatar.h
|
||||
|
|
@ -877,8 +884,10 @@ set(viewer_HEADER_FILES
|
|||
llfloatercolorpicker.h
|
||||
llfloaterconversationlog.h
|
||||
llfloaterconversationpreview.h
|
||||
llfloatercreatelandmark.h
|
||||
llfloaterdeleteprefpreset.h
|
||||
llfloaterdestinations.h
|
||||
llfloatereditenvironmentbase.h
|
||||
llfloatereditextdaycycle.h
|
||||
llfloaterenvironmentadjust.h
|
||||
llfloaterevent.h
|
||||
|
|
@ -898,6 +907,7 @@ set(viewer_HEADER_FILES
|
|||
llfloaterhandler.h
|
||||
llfloaterhelpbrowser.h
|
||||
llfloaterhoverheight.h
|
||||
llfloaterhowto.h
|
||||
llfloaterhud.h
|
||||
llfloaterimagepreview.h
|
||||
llfloaterimnearbychat.h
|
||||
|
|
@ -1273,6 +1283,7 @@ set(viewer_HEADER_FILES
|
|||
llurl.h
|
||||
llurldispatcher.h
|
||||
llurldispatcherlistener.h
|
||||
llurlfloaterdispatchhandler.h
|
||||
llurlhistory.h
|
||||
llurllineeditorctrl.h
|
||||
llurlwhitelist.h
|
||||
|
|
@ -1846,10 +1857,12 @@ if (WINDOWS)
|
|||
${SHARED_LIB_STAGING_DIR}/Release/libhunspell.dll
|
||||
${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/libhunspell.dll
|
||||
#${SHARED_LIB_STAGING_DIR}/Debug/libhunspell.dll
|
||||
${LIBS_PREBUILT_DIR}/bin/release/SLVoice.exe
|
||||
${SHARED_LIB_STAGING_DIR}/Release/uriparser.dll
|
||||
${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/uriparser.dll
|
||||
${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/SLVoice.exe
|
||||
#${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/libsndfile-1.dll
|
||||
#${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/vivoxoal.dll
|
||||
${LIBS_PREBUILT_DIR}/ca-bundle.crt
|
||||
${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/ca-bundle.crt
|
||||
${GOOGLE_PERF_TOOLS_SOURCE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/licenses-win32.txt
|
||||
#${CMAKE_CURRENT_SOURCE_DIR}/featuretable.txt
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
6.4.17
|
||||
6.4.20
|
||||
|
|
|
|||
|
|
@ -90,8 +90,10 @@
|
|||
icon="Command_HowTo_Icon"
|
||||
label_ref="Command_HowTo_Label"
|
||||
tooltip_ref="Command_HowTo_Tooltip"
|
||||
execute_function="Help.ToggleHowTo"
|
||||
is_running_function="Help.HowToVisible"
|
||||
execute_function="Floater.ToggleOrBringToFront"
|
||||
execute_parameters="guidebook"
|
||||
is_running_function="Floater.IsOpen"
|
||||
is_running_parameters="guidebook"
|
||||
/>
|
||||
<command name="inventory"
|
||||
available_in_toybox="true"
|
||||
|
|
|
|||
|
|
@ -5055,6 +5055,17 @@
|
|||
<key>Value</key>
|
||||
<string>https://search.[GRID]/viewer/[CATEGORY]/?q=[QUERY]&p=[AUTH_TOKEN]&r=[MATURITY]&lang=[LANGUAGE]&g=[GODLIKE]&sid=[SESSION_ID]&rid=[REGION_ID]&pid=[PARCEL_ID]&channel=[CHANNEL]&version=[VERSION]&major=[VERSION_MAJOR]&minor=[VERSION_MINOR]&patch=[VERSION_PATCH]&build=[VERSION_BUILD]</string>
|
||||
</map>
|
||||
<key>GuidebookURL</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>URL for Guidebook content</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string>http://guidebooks.secondlife.io/welcome/index.html</string>
|
||||
</map>
|
||||
<key>HighResSnapshot</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
@ -6265,7 +6276,7 @@
|
|||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string>http://map.secondlife.com.s3.amazonaws.com/</string>
|
||||
<string>https://map.secondlife.com/</string>
|
||||
</map>
|
||||
<key>CurrentMapServerURL</key>
|
||||
<map>
|
||||
|
|
@ -6916,7 +6927,7 @@
|
|||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>MemoryFailurePreventionEnabled</key>
|
||||
<key>MemoryFailurePreventionEnabled</key> <!-- deprecated, only used for obsolete-in-2020 Intel 965 Express GPU -->
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>If set, the viewer will quit to avoid crash when memory failure happens</string>
|
||||
|
|
@ -9454,7 +9465,7 @@
|
|||
<key>Type</key>
|
||||
<string>F32</string>
|
||||
<key>Value</key>
|
||||
<real>0.03</real>
|
||||
<real>0.1</real>
|
||||
</map>
|
||||
<key>RenderDebugPipeline</key>
|
||||
<map>
|
||||
|
|
@ -14777,7 +14788,53 @@
|
|||
<key>Value</key>
|
||||
<integer>44125</integer>
|
||||
</map>
|
||||
<key>VoiceCallsFriendsOnly</key>
|
||||
|
||||
<key>VivoxVadAuto</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>A flag indicating if the automatic VAD is enabled (1) or disabled (0). The individual settings are ignored if the auto-mode is enabled</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>U32</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>VivoxVadHangover</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>The time (in milliseconds) that it takes or the VAD to switch back to silence from speech mode after the last speech frame has been detected</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>U32</string>
|
||||
<key>Value</key>
|
||||
<integer>2000</integer>
|
||||
</map>
|
||||
<key>VivoxVadNoiseFloor</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>A dimensionless value between 0 and 20000 (default 576) that controls the maximum level at which the noise floor may be set at by the VAD's noise tracking</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>U32</string>
|
||||
<key>Value</key>
|
||||
<integer>576</integer>
|
||||
</map>
|
||||
<key>VivoxVadSensitivity</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>
|
||||
A dimensionless value between 0 and 100, indicating the 'sensitivity of the VAD'. Increasing this value corresponds to decreasing the sensitivity of the VAD and 0 is turned off altogether</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>U32</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>VoiceCallsFriendsOnly</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>(Deprecated) Only accept voice calls from residents on your friends list</string>
|
||||
|
|
@ -15521,7 +15578,7 @@
|
|||
<key>Value</key>
|
||||
<real>1</real>
|
||||
</map>
|
||||
<key>PoolSizeVAssetStorage</key>
|
||||
<key>PoolSizeAssetStorage</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Coroutine Pool size for AssetStorage requests</string>
|
||||
|
|
|
|||
|
|
@ -1,24 +1,24 @@
|
|||
/**
|
||||
/**
|
||||
* @file WLCloudsV.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2005&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2005, Linden Research, Inc.
|
||||
*
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
|
@ -33,26 +33,26 @@ ATTRIBUTE vec2 texcoord0;
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Output parameters
|
||||
VARYING vec4 vary_CloudColorSun;
|
||||
VARYING vec4 vary_CloudColorAmbient;
|
||||
VARYING vec4 vary_CloudColorSun;
|
||||
VARYING vec4 vary_CloudColorAmbient;
|
||||
VARYING float vary_CloudDensity;
|
||||
|
||||
VARYING vec2 vary_texcoord0;
|
||||
VARYING vec2 vary_texcoord1;
|
||||
VARYING vec2 vary_texcoord2;
|
||||
VARYING vec2 vary_texcoord3;
|
||||
VARYING vec2 vary_texcoord0;
|
||||
VARYING vec2 vary_texcoord1;
|
||||
VARYING vec2 vary_texcoord2;
|
||||
VARYING vec2 vary_texcoord3;
|
||||
VARYING float altitude_blend_factor;
|
||||
|
||||
// Inputs
|
||||
uniform vec3 camPosLocal;
|
||||
|
||||
uniform vec4 lightnorm;
|
||||
uniform vec4 sunlight_color;
|
||||
uniform vec4 moonlight_color;
|
||||
uniform int sun_up_factor;
|
||||
uniform vec4 ambient_color;
|
||||
uniform vec4 blue_horizon;
|
||||
uniform vec4 blue_density;
|
||||
uniform vec4 lightnorm;
|
||||
uniform vec4 sunlight_color;
|
||||
uniform vec4 moonlight_color;
|
||||
uniform int sun_up_factor;
|
||||
uniform vec4 ambient_color;
|
||||
uniform vec4 blue_horizon;
|
||||
uniform vec4 blue_density;
|
||||
uniform float haze_horizon;
|
||||
uniform float haze_density;
|
||||
|
||||
|
|
@ -60,7 +60,7 @@ uniform float cloud_shadow;
|
|||
uniform float density_multiplier;
|
||||
uniform float max_y;
|
||||
|
||||
uniform vec4 glow;
|
||||
uniform vec4 glow;
|
||||
uniform float sun_moon_glow_factor;
|
||||
|
||||
uniform vec4 cloud_color;
|
||||
|
|
@ -75,53 +75,53 @@ uniform float cloud_scale;
|
|||
// indra\newview\llsettingsvo.cpp
|
||||
void main()
|
||||
{
|
||||
// World / view / projection
|
||||
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
|
||||
// World / view / projection
|
||||
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
|
||||
|
||||
// Texture coords
|
||||
// Texture coords
|
||||
// SL-13084 EEP added support for custom cloud textures -- flip them horizontally to match the preview of Clouds > Cloud Scroll
|
||||
vary_texcoord0 = vec2(-texcoord0.x, texcoord0.y); // See: LLSettingsVOSky::applySpecial
|
||||
|
||||
vary_texcoord0.xy -= 0.5;
|
||||
vary_texcoord0.xy /= cloud_scale;
|
||||
vary_texcoord0.xy += 0.5;
|
||||
vary_texcoord0.xy -= 0.5;
|
||||
vary_texcoord0.xy /= cloud_scale;
|
||||
vary_texcoord0.xy += 0.5;
|
||||
|
||||
vary_texcoord1 = vary_texcoord0;
|
||||
vary_texcoord1.x += lightnorm.x * 0.0125;
|
||||
vary_texcoord1.y += lightnorm.z * 0.0125;
|
||||
vary_texcoord1 = vary_texcoord0;
|
||||
vary_texcoord1.x += lightnorm.x * 0.0125;
|
||||
vary_texcoord1.y += lightnorm.z * 0.0125;
|
||||
|
||||
vary_texcoord2 = vary_texcoord0 * 16.;
|
||||
vary_texcoord3 = vary_texcoord1 * 16.;
|
||||
vary_texcoord2 = vary_texcoord0 * 16.;
|
||||
vary_texcoord3 = vary_texcoord1 * 16.;
|
||||
|
||||
// Get relative position
|
||||
// Get relative position
|
||||
vec3 rel_pos = position.xyz - camPosLocal.xyz + vec3(0, 50, 0);
|
||||
|
||||
altitude_blend_factor = clamp((rel_pos.y + 512.0) / max_y, 0.0, 1.0);
|
||||
|
||||
// Set altitude
|
||||
// Set altitude
|
||||
if (rel_pos.y > 0)
|
||||
{
|
||||
{
|
||||
rel_pos *= (max_y / rel_pos.y);
|
||||
}
|
||||
}
|
||||
if (rel_pos.y < 0)
|
||||
{
|
||||
altitude_blend_factor = 0; // SL-11589 Fix clouds drooping below horizon
|
||||
{
|
||||
altitude_blend_factor = 0; // SL-11589 Fix clouds drooping below horizon
|
||||
rel_pos *= (-32000. / rel_pos.y);
|
||||
}
|
||||
}
|
||||
|
||||
// Can normalize then
|
||||
// Can normalize then
|
||||
vec3 rel_pos_norm = normalize(rel_pos);
|
||||
float rel_pos_len = length(rel_pos);
|
||||
|
||||
// Initialize temp variables
|
||||
vec4 sunlight = sunlight_color;
|
||||
vec4 light_atten;
|
||||
// Initialize temp variables
|
||||
vec4 sunlight = sunlight_color;
|
||||
vec4 light_atten;
|
||||
|
||||
// Sunlight attenuation effect (hue and brightness) due to atmosphere
|
||||
// this is used later for sunlight modulation at various altitudes
|
||||
// Sunlight attenuation effect (hue and brightness) due to atmosphere
|
||||
// this is used later for sunlight modulation at various altitudes
|
||||
light_atten = (blue_density + vec4(haze_density * 0.25)) * (density_multiplier * max_y);
|
||||
|
||||
// Calculate relative weights
|
||||
// Calculate relative weights
|
||||
vec4 combined_haze = abs(blue_density) + vec4(abs(haze_density));
|
||||
vec4 blue_weight = blue_density / combined_haze;
|
||||
vec4 haze_weight = haze_density / combined_haze;
|
||||
|
|
@ -130,63 +130,64 @@ void main()
|
|||
float off_axis = 1.0 / max(1e-6, max(0., rel_pos_norm.y) + lightnorm.y);
|
||||
sunlight *= exp(-light_atten * off_axis);
|
||||
|
||||
// Distance
|
||||
// Distance
|
||||
float density_dist = rel_pos_len * density_multiplier;
|
||||
|
||||
// Transparency (-> combined_haze)
|
||||
// ATI Bugfix -- can't store combined_haze*density_dist in a variable because the ati
|
||||
// compiler gets confused.
|
||||
// compiler gets confused.
|
||||
combined_haze = exp(-combined_haze * density_dist);
|
||||
|
||||
// Compute haze glow
|
||||
// Compute haze glow
|
||||
float haze_glow = 1.0 - dot(rel_pos_norm, lightnorm.xyz);
|
||||
// haze_glow is 0 at the sun and increases away from sun
|
||||
haze_glow = max(haze_glow, .001);
|
||||
// Set a minimum "angle" (smaller glow.y allows tighter, brighter hotspot)
|
||||
// Set a minimum "angle" (smaller glow.y allows tighter, brighter hotspot)
|
||||
haze_glow *= glow.x;
|
||||
// Higher glow.x gives dimmer glow (because next step is 1 / "angle")
|
||||
// Higher glow.x gives dimmer glow (because next step is 1 / "angle")
|
||||
haze_glow = pow(haze_glow, glow.z);
|
||||
// glow.z should be negative, so we're doing a sort of (1 / "angle") function
|
||||
// glow.z should be negative, so we're doing a sort of (1 / "angle") function
|
||||
|
||||
haze_glow *= sun_moon_glow_factor;
|
||||
|
||||
// Add "minimum anti-solar illumination"
|
||||
// Add "minimum anti-solar illumination"
|
||||
// For sun, add to glow. For moon, remove glow entirely. SL-13768
|
||||
haze_glow = (sun_moon_glow_factor < 1.0) ? 0.0 : (haze_glow + 0.25);
|
||||
|
||||
// Increase ambient when there are more clouds
|
||||
vec4 tmpAmbient = ambient_color;
|
||||
tmpAmbient += (1. - tmpAmbient) * cloud_shadow * 0.5;
|
||||
// Increase ambient when there are more clouds
|
||||
vec4 tmpAmbient = ambient_color;
|
||||
tmpAmbient += (1. - tmpAmbient) * cloud_shadow * 0.5;
|
||||
|
||||
// Dim sunlight by cloud shadow percentage
|
||||
sunlight *= (1. - cloud_shadow);
|
||||
// Dim sunlight by cloud shadow percentage
|
||||
sunlight *= (1. - cloud_shadow);
|
||||
|
||||
// Haze color below cloud
|
||||
// Haze color below cloud
|
||||
vec4 additiveColorBelowCloud =
|
||||
(blue_horizon * blue_weight * (sunlight + tmpAmbient) + (haze_horizon * haze_weight) * (sunlight * haze_glow + tmpAmbient));
|
||||
|
||||
// CLOUDS
|
||||
// CLOUDS
|
||||
sunlight = sunlight_color; // SL-14707 reset color -- Clouds are unusually dim in EEP
|
||||
off_axis = 1.0 / max(1e-6, lightnorm.y * 2.);
|
||||
sunlight *= exp(-light_atten * off_axis);
|
||||
|
||||
// Cloud color out
|
||||
// Cloud color out
|
||||
vary_CloudColorSun = (sunlight * haze_glow) * cloud_color;
|
||||
vary_CloudColorAmbient = tmpAmbient * cloud_color;
|
||||
|
||||
// Attenuate cloud color by atmosphere
|
||||
vary_CloudColorAmbient = tmpAmbient * cloud_color;
|
||||
|
||||
// Attenuate cloud color by atmosphere
|
||||
combined_haze = sqrt(combined_haze); // less atmos opacity (more transparency) below clouds
|
||||
vary_CloudColorSun *= combined_haze;
|
||||
vary_CloudColorAmbient *= combined_haze;
|
||||
vec4 oHazeColorBelowCloud = additiveColorBelowCloud * (1. - combined_haze);
|
||||
|
||||
// Make a nice cloud density based on the cloud_shadow value that was passed in.
|
||||
vary_CloudDensity = 2. * (cloud_shadow - 0.25);
|
||||
// Make a nice cloud density based on the cloud_shadow value that was passed in.
|
||||
vary_CloudDensity = 2. * (cloud_shadow - 0.25);
|
||||
|
||||
// Combine these to minimize register use
|
||||
vary_CloudColorAmbient += oHazeColorBelowCloud;
|
||||
// Combine these to minimize register use
|
||||
vary_CloudColorAmbient += oHazeColorBelowCloud;
|
||||
|
||||
// needs this to compile on mac
|
||||
// vary_AtmosAttenuation = vec3(0.0,0.0,0.0);
|
||||
// needs this to compile on mac
|
||||
//vary_AtmosAttenuation = vec3(0.0,0.0,0.0);
|
||||
|
||||
// END CLOUDS
|
||||
// END CLOUDS
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,28 +64,27 @@ void main()
|
|||
#else
|
||||
vec4 color = texture2D(diffuseMap, vary_texcoord0.xy);
|
||||
#endif
|
||||
|
||||
|
||||
color.rgb *= vertex_color.rgb;
|
||||
|
||||
// SL-9632 HUDs are affected by Atmosphere
|
||||
if (no_atmo == 0)
|
||||
{
|
||||
vec3 sunlit;
|
||||
vec3 amblit;
|
||||
vec3 additive;
|
||||
vec3 atten;
|
||||
vec3 sunlit;
|
||||
vec3 amblit;
|
||||
vec3 additive;
|
||||
vec3 atten;
|
||||
vec3 pos = vary_position.xyz/vary_position.w;
|
||||
|
||||
calcAtmosphericVars(pos.xyz, vec3(0), 1.0, sunlit, amblit, additive, atten, false);
|
||||
|
||||
vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;
|
||||
float env_intensity = vertex_color.a;
|
||||
calcAtmosphericVars(pos.xyz, vec3(0), 1.0, sunlit, amblit, additive, atten, false);
|
||||
|
||||
vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;
|
||||
float env_intensity = vertex_color.a;
|
||||
|
||||
//color.rgb = srgb_to_linear(color.rgb);
|
||||
color.rgb = mix(color.rgb, envColor.rgb, env_intensity);
|
||||
|
||||
color.rgb = fullbrightAtmosTransportFrag(color.rgb, additive, atten);
|
||||
color.rgb = fullbrightScaleSoftClip(color.rgb);
|
||||
color.rgb = fullbrightAtmosTransportFrag(color.rgb, additive, atten);
|
||||
color.rgb = fullbrightScaleSoftClip(color.rgb);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@ uniform sampler2D specularMap;
|
|||
|
||||
VARYING vec2 vary_texcoord0;
|
||||
|
||||
vec3 linear_to_srgb(vec3 c);
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 col = texture2D(diffuseMap, vary_texcoord0.xy);
|
||||
|
|
@ -52,6 +54,7 @@ void main()
|
|||
vec4 norm = texture2D(normalMap, vary_texcoord0.xy);
|
||||
vec4 spec = texture2D(specularMap, vary_texcoord0.xy);
|
||||
|
||||
col.rgb = linear_to_srgb(col.rgb);
|
||||
frag_data[0] = vec4(col.rgb, 0.0);
|
||||
frag_data[1] = spec;
|
||||
frag_data[2] = vec4(norm.xy,0,0);
|
||||
|
|
|
|||
|
|
@ -406,6 +406,8 @@ void main()
|
|||
|
||||
vec3 light = vec3(0, 0, 0);
|
||||
|
||||
final_specular.rgb = srgb_to_linear(final_specular.rgb); // SL-14035
|
||||
|
||||
#define LIGHT_LOOP(i) light.rgb += calcPointLightOrSpotLight(light_diffuse[i].rgb, npos, diffuse.rgb, final_specular, pos.xyz, norm.xyz, light_position[i], light_direction[i].xyz, light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z, glare, light_attenuation[i].w );
|
||||
|
||||
LIGHT_LOOP(1)
|
||||
|
|
|
|||
|
|
@ -73,9 +73,7 @@ void main()
|
|||
vec3 norm = getNorm(frag.xy);
|
||||
|
||||
vec4 spec = texture2DRect(specularRect, frag.xy);
|
||||
spec.rgb = srgb_to_linear(spec.rgb);
|
||||
vec3 diff = texture2DRect(diffuseRect, frag.xy).rgb;
|
||||
diff.rgb = srgb_to_linear(diff.rgb);
|
||||
|
||||
float noise = texture2D(noiseMap, frag.xy / 128.0).b;
|
||||
vec3 npos = normalize(-pos);
|
||||
|
|
|
|||
|
|
@ -182,10 +182,6 @@ void main()
|
|||
|
||||
|
||||
vec3 diff_tex = texture2DRect(diffuseRect, frag.xy).rgb;
|
||||
// SL-12005 Projector light pops as we get closer, more objectionable than being in wrong color space.
|
||||
// We can't switch to linear here unless we do it everywhere*
|
||||
// *gbuffer is sRGB, convert to linear whenever sampling from it
|
||||
diff_tex.rgb = srgb_to_linear(diff_tex.rgb);
|
||||
|
||||
vec3 dlit = vec3(0, 0, 0);
|
||||
|
||||
|
|
|
|||
|
|
@ -90,7 +90,6 @@ void main()
|
|||
float noise = texture2D(noiseMap, frag.xy/128.0).b;
|
||||
|
||||
vec3 col = texture2DRect(diffuseRect, frag.xy).rgb;
|
||||
col.rgb = srgb_to_linear(col.rgb);
|
||||
|
||||
float fa = falloff+1.0;
|
||||
float dist_atten = clamp(1.0-(dist-1.0*(1.0-fa))/fa, 0.0, 1.0);
|
||||
|
|
@ -127,7 +126,7 @@ void main()
|
|||
{
|
||||
discard;
|
||||
}
|
||||
//col.rgb = vec3(0);
|
||||
|
||||
frag_color.rgb = col;
|
||||
frag_color.a = 0.0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ void main()
|
|||
vec4 diffuse = texture2DRect(diffuseRect, tc);
|
||||
|
||||
//convert to gamma space
|
||||
//diffuse.rgb = linear_to_srgb(diffuse.rgb);
|
||||
diffuse.rgb = linear_to_srgb(diffuse.rgb); // SL-14035
|
||||
|
||||
vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy);
|
||||
vec3 color = vec3(0);
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue