Merge branch 'master' of https://vcs.firestormviewer.org/phoenix-firestorm
commit
d3815da8b0
|
|
@ -994,11 +994,11 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>4f9bf4566934e6e8611ef918186f20c5</string>
|
||||
<string>c96fbccf3db01230832d8795318ee627</string>
|
||||
<key>hash_algorithm</key>
|
||||
<string>md5</string>
|
||||
<key>url</key>
|
||||
<string>file:///opt/firestorm/fmodstudio-2.01.08-darwin-210441530.tar.bz2</string>
|
||||
<string>file:///opt/firestorm/fmodstudio-2.01.09-darwin-211252249.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>darwin</string>
|
||||
|
|
@ -2980,9 +2980,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>e235c5da10f29893e14b14c7a3184d91</string>
|
||||
<string>ba2034b4a372fd46c3e09f56bede38a7</string>
|
||||
<key>url</key>
|
||||
<string>http://3p.firestormviewer.org/openjpeg-2.3.1.202821233-windows-202821233.tar.bz2</string>
|
||||
<string>http://3p.firestormviewer.org/openjpeg-2.4.0.211361403-windows-211361403.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>windows</string>
|
||||
|
|
@ -2992,16 +2992,16 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>d87183b9cab5910a4a0f15e8faebab06</string>
|
||||
<string>d7ac606703a9330a2d8a3f7276cb6894</string>
|
||||
<key>url</key>
|
||||
<string>http://3p.firestormviewer.org/openjpeg-2.3.1.202821246-windows64-202821246.tar.bz2</string>
|
||||
<string>http://3p.firestormviewer.org/openjpeg-2.4.0.211361407-windows64-211361407.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>windows64</string>
|
||||
</map>
|
||||
</map>
|
||||
<key>version</key>
|
||||
<string>2.3.1</string>
|
||||
<string>2.4.0</string>
|
||||
</map>
|
||||
<key>openssl</key>
|
||||
<map>
|
||||
|
|
|
|||
|
|
@ -270,6 +270,7 @@ Beq Janus
|
|||
SL-10288
|
||||
SL-13583
|
||||
SL-14766
|
||||
SL-11300
|
||||
Beth Walcher
|
||||
Bezilon Kasei
|
||||
Biancaluce Robbiani
|
||||
|
|
@ -1363,6 +1364,12 @@ Sovereign Engineer
|
|||
OPEN-343
|
||||
SL-11625
|
||||
BUG-229030
|
||||
SL-14705
|
||||
SL-14706
|
||||
SL-14707
|
||||
SL-14731
|
||||
SL-14732
|
||||
SL-15096
|
||||
SpacedOut Frye
|
||||
VWR-34
|
||||
VWR-45
|
||||
|
|
|
|||
|
|
@ -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,10 +167,7 @@ void LLAvatarJoint::updateJointGeometry()
|
|||
for (joints_t::iterator iter = mChildren.begin();
|
||||
iter != mChildren.end(); ++iter)
|
||||
{
|
||||
// LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
||||
// [SL:KB] - Patch: Viewer-OptimizationAnimesh | Checked: Catznip-6.0
|
||||
LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(*iter);
|
||||
// [/SL:KB]
|
||||
joint->updateJointGeometry();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -155,8 +155,20 @@ void LLStreamingAudio_FMODSTUDIO::update()
|
|||
bool diskbusy;
|
||||
FMOD_OPENSTATE open_state;
|
||||
|
||||
if (Check_FMOD_Error(mCurrentInternetStreamp->getOpenState(open_state, &progress, &starving, &diskbusy), "FMOD::Sound::getOpenState") || open_state == FMOD_OPENSTATE_ERROR)
|
||||
if (Check_FMOD_Error(mCurrentInternetStreamp->getOpenState(open_state, &progress, &starving, &diskbusy), "FMOD::Sound::getOpenState"))
|
||||
{
|
||||
LL_WARNS() << "Internet stream openstate error: open_state = " << open_state << " - progress = " << progress << " - starving = " << starving << " - diskbusy = " << diskbusy << LL_ENDL;
|
||||
stop();
|
||||
return;
|
||||
}
|
||||
else if (open_state == FMOD_OPENSTATE_ERROR)
|
||||
{
|
||||
// Actually we might not get into this case at all since according to the
|
||||
// FMOD API doc, one should check the result of getOpenState for further
|
||||
// details, which most likely means if open_state is FMOD_OPENSTATE_ERROR,
|
||||
// calling getOpenState will return anything but FMOD_OK and we end up in
|
||||
// the if-case above.
|
||||
LL_WARNS() << "Internet stream openstate error: progress = " << progress << " - starving = " << starving << " - diskbusy = " << diskbusy << LL_ENDL;
|
||||
stop();
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@
|
|||
#define FSZoneNC( name, color ) ZoneNamedNC( ___tracy_scoped_zone, name, color, FSTelemetry::active)
|
||||
#define FSPlot( name, value ) TracyPlot( name, value)
|
||||
#define FSFrameMark FrameMark
|
||||
#define FSThreadName( name ) tracy::SetThreadName( name )
|
||||
#define FSTelemetryIsConnected TracyIsConnected
|
||||
|
||||
#else // (no telemetry)
|
||||
|
|
@ -58,6 +59,7 @@
|
|||
#define FSZoneNC( name, color )
|
||||
#define FSPlot( name, value )
|
||||
#define FSFrameMark
|
||||
#define FSThreadName( name )
|
||||
#define FSTelemetryIsConnected
|
||||
#endif // TRACY_ENABLE
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
@ -69,7 +69,7 @@ bool BlockTimer::sMetricLog = false;
|
|||
#define USE_RDTSC 0
|
||||
#else
|
||||
#endif
|
||||
#if LL_LINUX || LL_SOLARIS || LL_DARWIN // AO: Add LL_DARWIN to this list now
|
||||
#if LL_LINUX || LL_DARWIN // AO: Add LL_DARWIN to this list now
|
||||
U64 BlockTimer::sClockResolution = 1000000000; // Nanosecond resolution
|
||||
#else
|
||||
U64 BlockTimer::sClockResolution = 1000000; // Microsecond resolution
|
||||
|
|
@ -156,12 +156,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
|
||||
|
|
|
|||
|
|
@ -146,11 +146,11 @@ public:
|
|||
|
||||
|
||||
// <FS:ND> Linux/Mac should honour LL_FASTTIMER_USE_RDTSC too
|
||||
// #if (LL_LINUX || LL_SOLARIS) && !(defined(__i386__) || defined(__amd64__)
|
||||
#if (LL_LINUX || LL_SOLARIS) && ( !(defined(__i386__) || defined(__amd64__)) || !LL_FASTTIMER_USE_RDTSC )
|
||||
// #if (LL_LINUX) && !(defined(__i386__) || defined(__amd64__)
|
||||
#if (LL_LINUX) && ( !(defined(__i386__) || defined(__amd64__)) || !LL_FASTTIMER_USE_RDTSC )
|
||||
// </FS:ND>
|
||||
//
|
||||
// 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
|
||||
|
|
@ -176,15 +176,15 @@ public:
|
|||
return (U32)(getCPUClockCount64() >> 8);
|
||||
}
|
||||
|
||||
#endif // (LL_LINUX || LL_SOLARIS) && !(defined(__i386__) || defined(__amd64__))
|
||||
#endif // (LL_LINUX) && !(defined(__i386__) || defined(__amd64__))
|
||||
|
||||
|
||||
// <FS:ND> Linux/Mac should honour LL_FASTTIMER_USE_RDTSC too
|
||||
//#if (LL_LINUX || LL_SOLARIS || LL_DARWIN) && (defined(__i386__) || defined(__amd64__))
|
||||
#if (LL_LINUX || LL_SOLARIS || LL_DARWIN) && (defined(__i386__) || defined(__amd64__)) && LL_FASTTIMER_USE_RDTSC
|
||||
//#if (LL_LINUX || LL_DARWIN) && (defined(__i386__) || defined(__amd64__))
|
||||
#if (LL_LINUX || LL_DARWIN) && (defined(__i386__) || defined(__amd64__)) && LL_FASTTIMER_USE_RDTSC
|
||||
// </FS:ND>
|
||||
//
|
||||
// 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()
|
||||
|
|
|
|||
|
|
@ -356,10 +356,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() ;
|
||||
|
|
@ -371,7 +370,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
|
||||
|
|
|
|||
|
|
@ -442,7 +442,15 @@ S32 LLQueuedThread::processNextRequest()
|
|||
// safe to access req.
|
||||
if (req)
|
||||
{
|
||||
// process request
|
||||
// <FS:ND> Image thread pool from CoolVL
|
||||
if (req->getFlags() & FLAG_ASYNC)
|
||||
{
|
||||
req->processRequest();
|
||||
return getPending();
|
||||
}
|
||||
// </FS:ND>
|
||||
|
||||
// process request
|
||||
bool complete = req->processRequest();
|
||||
|
||||
if (complete)
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ public:
|
|||
FLAG_AUTO_COMPLETE = 1,
|
||||
FLAG_AUTO_DELETE = 2, // child-class dependent
|
||||
FLAG_ABORT = 4
|
||||
,FLAG_ASYNC = 8 // <FS:ND/> Image thread pool from CoolVL
|
||||
};
|
||||
|
||||
typedef U32 handle_t;
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
#include <list>
|
||||
// [/RLVa:KB]
|
||||
|
||||
#if LL_LINUX || LL_SOLARIS
|
||||
#if LL_LINUX
|
||||
#include <wctype.h>
|
||||
#include <wchar.h>
|
||||
#endif
|
||||
|
|
@ -49,16 +49,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>
|
||||
|
||||
|
|
|
|||
|
|
@ -88,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;
|
||||
|
|
@ -551,8 +540,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");
|
||||
|
|
@ -572,24 +559,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;
|
||||
}
|
||||
|
|
@ -598,8 +567,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)
|
||||
|
|
@ -618,24 +585,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;
|
||||
}
|
||||
|
|
@ -780,11 +729,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;
|
||||
|
||||
|
|
@ -1082,13 +1026,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())
|
||||
|
|
|
|||
|
|
@ -35,8 +35,9 @@
|
|||
#include "lltrace.h"
|
||||
#include "lltracethreadrecorder.h"
|
||||
#include "llexception.h"
|
||||
#include "fstelemetry.h" // <FS:Beq> allow thread naming
|
||||
|
||||
#if LL_LINUX || LL_SOLARIS
|
||||
#if LL_LINUX
|
||||
#include <sched.h>
|
||||
#endif
|
||||
|
||||
|
|
@ -140,7 +141,10 @@ void LLThread::threadRun()
|
|||
|
||||
// for now, hard code all LLThreads to report to single master thread recorder, which is known to be running on main thread
|
||||
mRecorder = new LLTrace::ThreadRecorder(*LLTrace::get_master_thread_recorder());
|
||||
|
||||
// <FS:Beq> - Add threadnames to telemetry
|
||||
LL_INFOS("THREAD") << "Started thread " << mName << LL_ENDL;
|
||||
FSThreadName( mName.c_str() );
|
||||
// </FS:Beq>
|
||||
// Run the user supplied function
|
||||
do
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -360,7 +360,7 @@ static BOOL isDefault(const std::string& scheme, U16 port)
|
|||
|
||||
void LLURI::parseAuthorityAndPathUsingOpaque()
|
||||
{
|
||||
if (mScheme == "http" || mScheme == "https" || mScheme == "hop" || mScheme == "inworldz" || mScheme == "iw" ||
|
||||
if (mScheme == "http" || mScheme == "https" || mScheme == "hop" ||
|
||||
mScheme == "ftp" || mScheme == "secondlife" ||
|
||||
mScheme == "x-grid-location-info")
|
||||
{
|
||||
|
|
|
|||
|
|
@ -602,9 +602,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
|
||||
|
|
|
|||
|
|
@ -63,9 +63,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
|
||||
|
||||
|
||||
|
|
@ -43,7 +43,9 @@
|
|||
static const char* subdirs = "0123456789abcdef";
|
||||
|
||||
LLDiskCache::LLDiskCache(const std::string cache_dir,
|
||||
const int max_size_bytes,
|
||||
// <FS:Ansariel> Fix integer overflow
|
||||
//const int max_size_bytes,
|
||||
const uintmax_t max_size_bytes,
|
||||
const bool enable_cache_debug_info) :
|
||||
mCacheDir(cache_dir),
|
||||
mMaxSizeBytes(max_size_bytes),
|
||||
|
|
@ -64,7 +66,7 @@ LLDiskCache::LLDiskCache(const std::string cache_dir,
|
|||
|
||||
void LLDiskCache::purge()
|
||||
{
|
||||
if (mEnableCacheDebugInfo)
|
||||
//if (mEnableCacheDebugInfo)
|
||||
{
|
||||
LL_INFOS() << "Total dir size before purge is " << dirFileSize(mCacheDir) << LL_ENDL;
|
||||
}
|
||||
|
|
@ -144,7 +146,7 @@ void LLDiskCache::purge()
|
|||
}
|
||||
}
|
||||
|
||||
if (mEnableCacheDebugInfo)
|
||||
//if (mEnableCacheDebugInfo)
|
||||
{
|
||||
auto end_time = std::chrono::high_resolution_clock::now();
|
||||
auto execute_time = std::chrono::duration_cast<std::chrono::milliseconds>(end_time - start_time).count();
|
||||
|
|
@ -369,3 +371,27 @@ uintmax_t LLDiskCache::dirFileSize(const std::string dir)
|
|||
|
||||
return total_file_size;
|
||||
}
|
||||
|
||||
// <FS:Ansariel> Regular disk cache cleanup
|
||||
FSPurgeDiskCacheThread::FSPurgeDiskCacheThread() :
|
||||
LLThread("PurgeDiskCacheThread", nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
void FSPurgeDiskCacheThread::run()
|
||||
{
|
||||
constexpr F64 CHECK_INTERVAL = 60;
|
||||
mTimer.setTimerExpirySec(CHECK_INTERVAL);
|
||||
mTimer.start();
|
||||
|
||||
do
|
||||
{
|
||||
if (mTimer.checkExpirationAndReset(CHECK_INTERVAL))
|
||||
{
|
||||
LLDiskCache::instance().purge();
|
||||
}
|
||||
|
||||
ms_sleep(100);
|
||||
} while (!isQuitting());
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
|
|
|
|||
|
|
@ -86,7 +86,9 @@ class LLDiskCache :
|
|||
* The maximum size of the cache in bytes - Based on the
|
||||
* setting at 'CacheSize' and 'DiskCachePercentOfTotal'
|
||||
*/
|
||||
const int max_size_bytes,
|
||||
// <FS:Ansariel> Fix integer overflow
|
||||
//const int max_size_bytes,
|
||||
const uintmax_t max_size_bytes,
|
||||
/**
|
||||
* A flag that enables extra cache debugging so that
|
||||
* if there are bugs, we can ask uses to enable this
|
||||
|
|
@ -141,6 +143,9 @@ class LLDiskCache :
|
|||
*/
|
||||
const std::string getCacheInfo();
|
||||
|
||||
// <FS:Ansariel> Better asset cache size control
|
||||
void setMaxSizeBytes(uintmax_t size) { mMaxSizeBytes = size; }
|
||||
|
||||
private:
|
||||
/**
|
||||
* Utility function to gather the total size the files in a given
|
||||
|
|
@ -188,4 +193,17 @@ class LLDiskCache :
|
|||
bool mEnableCacheDebugInfo;
|
||||
};
|
||||
|
||||
// <FS:Ansariel> Regular disk cache cleanup
|
||||
class FSPurgeDiskCacheThread : public LLThread
|
||||
{
|
||||
public:
|
||||
FSPurgeDiskCacheThread();
|
||||
|
||||
protected:
|
||||
void run() override;
|
||||
|
||||
private:
|
||||
LLTimer mTimer;
|
||||
};
|
||||
// </FS:Ansariel>
|
||||
#endif // _LLDISKCACHE
|
||||
|
|
|
|||
|
|
@ -162,7 +162,9 @@ S32 LLFileSystem::getFileSize(const LLUUID& file_id, const LLAssetType::EType fi
|
|||
BOOL LLFileSystem::read(U8* buffer, S32 bytes)
|
||||
{
|
||||
FSZoneC(tracy::Color::Gold); // <FS:Beq> measure cache performance
|
||||
BOOL success = TRUE;
|
||||
// <FS:Ansariel> Cache fixes
|
||||
//BOOL success = TRUE;
|
||||
BOOL success = FALSE;
|
||||
|
||||
std::string id;
|
||||
mFileID.toString(id);
|
||||
|
|
@ -197,14 +199,18 @@ BOOL LLFileSystem::read(U8* buffer, S32 bytes)
|
|||
LLFILE* file = LLFile::fopen(filename, "rb");
|
||||
if (file)
|
||||
{
|
||||
fseek(file, mPosition, SEEK_SET);
|
||||
mBytesRead = fread(buffer, 1, bytes, file);
|
||||
fclose(file);
|
||||
|
||||
mPosition += mBytesRead;
|
||||
if (!mBytesRead)
|
||||
if (fseek(file, mPosition, SEEK_SET) == 0)
|
||||
{
|
||||
success = FALSE;
|
||||
mBytesRead = fread(buffer, 1, bytes, file);
|
||||
fclose(file);
|
||||
|
||||
mPosition += mBytesRead;
|
||||
// It probably would be correct to check for mBytesRead == bytes,
|
||||
// but that will break avatar rezzing...
|
||||
if (mBytesRead)
|
||||
{
|
||||
success = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
|
|
@ -295,10 +301,10 @@ BOOL LLFileSystem::write(const U8* buffer, S32 bytes)
|
|||
LLFILE* ofs = LLFile::fopen(filename, "a+b");
|
||||
if (ofs)
|
||||
{
|
||||
fwrite(buffer, 1, bytes, ofs);
|
||||
S32 bytes_written = fwrite(buffer, 1, bytes, ofs);
|
||||
mPosition = ftell(ofs);
|
||||
fclose(ofs);
|
||||
success = TRUE;
|
||||
success = (bytes_written == bytes);
|
||||
}
|
||||
}
|
||||
else if (mMode == READ_WRITE)
|
||||
|
|
@ -306,21 +312,23 @@ BOOL LLFileSystem::write(const U8* buffer, S32 bytes)
|
|||
LLFILE* ofs = LLFile::fopen(filename, "r+b");
|
||||
if (ofs)
|
||||
{
|
||||
fseek(ofs, mPosition, SEEK_SET);
|
||||
fwrite(buffer, 1, bytes, ofs);
|
||||
mPosition = ftell(ofs);
|
||||
fclose(ofs);
|
||||
success = TRUE;
|
||||
if (fseek(ofs, mPosition, SEEK_SET) == 0)
|
||||
{
|
||||
S32 bytes_written = fwrite(buffer, 1, bytes, ofs);
|
||||
mPosition = ftell(ofs);
|
||||
fclose(ofs);
|
||||
success = (bytes_written == bytes);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ofs = LLFile::fopen(filename, "wb");
|
||||
if (ofs)
|
||||
{
|
||||
fwrite(buffer, 1, bytes, ofs);
|
||||
S32 bytes_written = fwrite(buffer, 1, bytes, ofs);
|
||||
mPosition = ftell(ofs);
|
||||
fclose(ofs);
|
||||
success = TRUE;
|
||||
success = (bytes_written == bytes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -329,10 +337,10 @@ BOOL LLFileSystem::write(const U8* buffer, S32 bytes)
|
|||
LLFILE* ofs = LLFile::fopen(filename, "wb");
|
||||
if (ofs)
|
||||
{
|
||||
fwrite(buffer, 1, bytes, ofs);
|
||||
S32 bytes_written = fwrite(buffer, 1, bytes, ofs);
|
||||
mPosition = ftell(ofs);
|
||||
fclose(ofs);
|
||||
success = TRUE;
|
||||
success = (bytes_written == bytes);
|
||||
}
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
|
|
|
|||
|
|
@ -25,17 +25,104 @@
|
|||
*/
|
||||
|
||||
#include "linden_common.h"
|
||||
|
||||
#include "fstelemetry.h" // <FS:Beq> add telemetry support.
|
||||
#include "llimageworker.h"
|
||||
#include "llimagedxt.h"
|
||||
|
||||
// <FS:ND> Image thread pool from CoolVL
|
||||
#include "boost/thread.hpp"
|
||||
std::atomic< U32 > s_ChildThreads;
|
||||
|
||||
class PoolWorkerThread : public LLThread
|
||||
{
|
||||
public:
|
||||
PoolWorkerThread(std::string name) : LLThread(name),
|
||||
mCurrentRequest(NULL)
|
||||
{
|
||||
}
|
||||
virtual void run()
|
||||
{
|
||||
while (!isQuitting())
|
||||
{
|
||||
auto *pReq = mCurrentRequest.exchange(nullptr);
|
||||
|
||||
if (pReq)
|
||||
pReq->processRequestIntern();
|
||||
checkPause();
|
||||
}
|
||||
}
|
||||
bool isBusy()
|
||||
{
|
||||
auto *pReq = mCurrentRequest.load();
|
||||
if (!pReq)
|
||||
return false;
|
||||
|
||||
auto status = pReq->getStatus();
|
||||
|
||||
return status == LLQueuedThread::STATUS_QUEUED || status == LLQueuedThread::STATUS_INPROGRESS;
|
||||
}
|
||||
|
||||
bool runCondition()
|
||||
{
|
||||
return mCurrentRequest != NULL;
|
||||
}
|
||||
|
||||
bool setRequest(LLImageDecodeThread::ImageRequest* req)
|
||||
{
|
||||
LLImageDecodeThread::ImageRequest* pOld{ nullptr };
|
||||
bool bSuccess = mCurrentRequest.compare_exchange_strong(pOld, req);
|
||||
wake();
|
||||
|
||||
return bSuccess;
|
||||
}
|
||||
|
||||
private:
|
||||
std::atomic< LLImageDecodeThread::ImageRequest * > mCurrentRequest;
|
||||
};
|
||||
// </FS:ND>
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
// MAIN THREAD
|
||||
LLImageDecodeThread::LLImageDecodeThread(bool threaded)
|
||||
LLImageDecodeThread::LLImageDecodeThread(bool threaded, U32 aSubThreads)
|
||||
: LLQueuedThread("imagedecode", threaded)
|
||||
{
|
||||
mCreationMutex = new LLMutex();
|
||||
|
||||
// <FS:ND> Image thread pool from CoolVL
|
||||
if (aSubThreads == 0)
|
||||
{
|
||||
aSubThreads = boost::thread::hardware_concurrency();
|
||||
if (!aSubThreads)
|
||||
aSubThreads = 4U; // Use a sane default: 4 cores
|
||||
if (aSubThreads > 8U)
|
||||
{
|
||||
// Using number of (virtual) cores - 1 (for the main image worker
|
||||
// thread) - 1 (for the viewer main loop thread), further bound to
|
||||
// a maximum of 32 threads (more than that is totally useless, even
|
||||
// when flying over main land with 512m draw distance).
|
||||
aSubThreads = llmin(aSubThreads - 2U, 32U);
|
||||
}
|
||||
else if (aSubThreads > 2U)
|
||||
{
|
||||
// Using number of (virtual) cores - 1 (for the main image worker
|
||||
// thread).
|
||||
--aSubThreads;
|
||||
}
|
||||
}
|
||||
else if (aSubThreads == 1) // Disable if only 1
|
||||
aSubThreads = 0;
|
||||
|
||||
s_ChildThreads = aSubThreads;
|
||||
for (U32 i = 0; i < aSubThreads; ++i)
|
||||
{
|
||||
std::stringstream strm;
|
||||
strm << "imagedecodethread" << (i + 1);
|
||||
|
||||
mThreadPool.push_back(std::make_shared< PoolWorkerThread>(strm.str()));
|
||||
mThreadPool[i]->start();
|
||||
}
|
||||
// </FS:ND>
|
||||
}
|
||||
|
||||
//virtual
|
||||
|
|
@ -48,14 +135,22 @@ LLImageDecodeThread::~LLImageDecodeThread()
|
|||
// virtual
|
||||
S32 LLImageDecodeThread::update(F32 max_time_ms)
|
||||
{
|
||||
FSZoneC(tracy::Color::Blue); // <FS:Beq/> instrument image decodes
|
||||
LLMutexLock lock(mCreationMutex);
|
||||
// <FS:Beq> instrument image decodes
|
||||
{
|
||||
FSZoneC(tracy::Color::Blue1);
|
||||
// </FS:Beq>
|
||||
for (creation_list_t::iterator iter = mCreationList.begin();
|
||||
iter != mCreationList.end(); ++iter)
|
||||
{
|
||||
creation_info& info = *iter;
|
||||
// ImageRequest* req = new ImageRequest(info.handle, info.image,
|
||||
// info.priority, info.discard, info.needs_aux,
|
||||
// info.responder);
|
||||
ImageRequest* req = new ImageRequest(info.handle, info.image,
|
||||
info.priority, info.discard, info.needs_aux,
|
||||
info.responder);
|
||||
info.priority, info.discard, info.needs_aux,
|
||||
info.responder, this);
|
||||
|
||||
bool res = addRequest(req);
|
||||
if (!res)
|
||||
|
|
@ -65,16 +160,49 @@ S32 LLImageDecodeThread::update(F32 max_time_ms)
|
|||
}
|
||||
}
|
||||
mCreationList.clear();
|
||||
// <FS:Beq> instrument image decodes
|
||||
}
|
||||
{
|
||||
FSZoneC(tracy::Color::Blue2);
|
||||
// </FS:Beq>
|
||||
S32 res = LLQueuedThread::update(max_time_ms);
|
||||
// FSPlot("img_decode_pending", (int64_t)res); // <FS:Beq/> instrument image decodes
|
||||
return res;
|
||||
} // <FS:Beq/> instrument image decodes
|
||||
}
|
||||
|
||||
LLImageDecodeThread::handle_t LLImageDecodeThread::decodeImage(LLImageFormatted* image,
|
||||
U32 priority, S32 discard, BOOL needs_aux, Responder* responder)
|
||||
{
|
||||
LLMutexLock lock(mCreationMutex);
|
||||
FSZoneC(tracy::Color::Orange); // <FS:Beq> instrument the image decode pipeline
|
||||
// <FS:Beq> De-couple texture threading from mainloop
|
||||
// LLMutexLock lock(mCreationMutex);
|
||||
// handle_t handle = generateHandle();
|
||||
// mCreationList.push_back(creation_info(handle, image, priority, discard, needs_aux, responder));
|
||||
handle_t handle = generateHandle();
|
||||
mCreationList.push_back(creation_info(handle, image, priority, discard, needs_aux, responder));
|
||||
// If we have a thread pool dispatch this directly.
|
||||
// Note: addRequest could cause the handling to take place on the fetch thread, this is unlikely to be an issue.
|
||||
// if this is an actual problem we move the fallback to here and place the unfulfilled request into the legacy queue
|
||||
if (s_ChildThreads > 0)
|
||||
{
|
||||
FSZoneNC("DecodeDecoupled", tracy::Color::Orange); // <FS:Beq> instrument the image decode pipeline
|
||||
ImageRequest* req = new ImageRequest(handle, image,
|
||||
priority, discard, needs_aux,
|
||||
responder, this);
|
||||
bool res = addRequest(req);
|
||||
if (!res)
|
||||
{
|
||||
LL_WARNS() << "Decode request not added because we are exiting." << LL_ENDL;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
FSZoneNC("DecodeQueued", tracy::Color::Orange); // <FS:Beq> instrument the image decode pipeline
|
||||
LLMutexLock lock(mCreationMutex);
|
||||
mCreationList.push_back(creation_info(handle, image, priority, discard, needs_aux, responder));
|
||||
}
|
||||
// </FS:Beq>
|
||||
return handle;
|
||||
}
|
||||
|
||||
|
|
@ -95,15 +223,21 @@ LLImageDecodeThread::Responder::~Responder()
|
|||
|
||||
LLImageDecodeThread::ImageRequest::ImageRequest(handle_t handle, LLImageFormatted* image,
|
||||
U32 priority, S32 discard, BOOL needs_aux,
|
||||
LLImageDecodeThread::Responder* responder)
|
||||
LLImageDecodeThread::Responder* responder,
|
||||
LLImageDecodeThread *aQueue)
|
||||
: LLQueuedThread::QueuedRequest(handle, priority, FLAG_AUTO_COMPLETE),
|
||||
mFormattedImage(image),
|
||||
mDiscardLevel(discard),
|
||||
mNeedsAux(needs_aux),
|
||||
mDecodedRaw(FALSE),
|
||||
mDecodedAux(FALSE),
|
||||
mResponder(responder)
|
||||
mResponder(responder),
|
||||
mQueue( aQueue ) // <FS:ND/> Image thread pool from CoolVL
|
||||
{
|
||||
//<FS:ND> Image thread pool from CoolVL
|
||||
if (s_ChildThreads > 0)
|
||||
mFlags |= FLAG_ASYNC;
|
||||
// </FS:ND>
|
||||
}
|
||||
|
||||
LLImageDecodeThread::ImageRequest::~ImageRequest()
|
||||
|
|
@ -119,10 +253,34 @@ LLImageDecodeThread::ImageRequest::~ImageRequest()
|
|||
// Returns true when done, whether or not decode was successful.
|
||||
bool LLImageDecodeThread::ImageRequest::processRequest()
|
||||
{
|
||||
const F32 decode_time_slice = .1f;
|
||||
// <FS:ND> Image thread pool from CoolVL
|
||||
|
||||
// If not async, decode using this thread
|
||||
if ((mFlags & FLAG_ASYNC) == 0)
|
||||
return processRequestIntern();
|
||||
|
||||
// Try to dispatch to a new thread, if this isn't possible decode on this thread
|
||||
if (!mQueue->enqueRequest(this))
|
||||
return processRequestIntern();
|
||||
return true;
|
||||
// </FS:ND>
|
||||
}
|
||||
|
||||
bool LLImageDecodeThread::ImageRequest::processRequestIntern()
|
||||
{
|
||||
// <FS:Beq> allow longer timeout for async and add instrumentation
|
||||
// const F32 decode_time_slice = .1f;
|
||||
FSZoneC(tracy::Color::DarkOrange);
|
||||
F32 decode_time_slice = .1f;
|
||||
if(mFlags & FLAG_ASYNC)
|
||||
{
|
||||
decode_time_slice = 10.0f;// long time out as this is not an issue with async
|
||||
}
|
||||
// </FS:Beq>
|
||||
bool done = true;
|
||||
if (!mDecodedRaw && mFormattedImage.notNull())
|
||||
{
|
||||
FSZoneC(tracy::Color::DarkOrange1); // <FS:Beq> instrument the image decode pipeline
|
||||
// Decode primary channels
|
||||
if (mDecodedImageRaw.isNull())
|
||||
{
|
||||
|
|
@ -161,6 +319,7 @@ bool LLImageDecodeThread::ImageRequest::processRequest()
|
|||
}
|
||||
if (done && mNeedsAux && !mDecodedAux && mFormattedImage.notNull())
|
||||
{
|
||||
FSZoneC(tracy::Color::DarkOrange2); // <FS:Beq> instrument the image decode pipeline
|
||||
// Decode aux channel
|
||||
if (!mDecodedImageAux)
|
||||
{
|
||||
|
|
@ -171,7 +330,21 @@ bool LLImageDecodeThread::ImageRequest::processRequest()
|
|||
done = mFormattedImage->decodeChannels(mDecodedImageAux, decode_time_slice, 4, 4); // 1ms
|
||||
mDecodedAux = done && mDecodedImageAux->getData();
|
||||
}
|
||||
|
||||
// <FS:Beq> report timeout on async thread (which leads to worker abort errors)
|
||||
if(!done)
|
||||
{
|
||||
LL_WARNS("ImageDecode") << "Image decoding failed to complete with time slice=" << decode_time_slice << LL_ENDL;
|
||||
}
|
||||
// </FS:Beq>
|
||||
//<FS:ND> Image thread pool from CoolVL
|
||||
if (mFlags & FLAG_ASYNC)
|
||||
{
|
||||
setStatus(STATUS_COMPLETE);
|
||||
finishRequest(true);
|
||||
// always autocomplete
|
||||
mQueue->completeRequest(mHashKey);
|
||||
}
|
||||
// </FS:ND>
|
||||
return done;
|
||||
}
|
||||
|
||||
|
|
@ -191,3 +364,16 @@ bool LLImageDecodeThread::ImageRequest::tut_isOK()
|
|||
{
|
||||
return mResponder.notNull();
|
||||
}
|
||||
|
||||
bool LLImageDecodeThread::enqueRequest(ImageRequest * req)
|
||||
{
|
||||
for (auto &pThread : mThreadPool)
|
||||
{
|
||||
if (!pThread->isBusy())
|
||||
{
|
||||
if( pThread->setRequest(req) )
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,9 @@
|
|||
#include "llpointer.h"
|
||||
#include "llworkerthread.h"
|
||||
|
||||
// <FS:ND/> Image thread pool
|
||||
class PoolWorkerThread;
|
||||
|
||||
class LLImageDecodeThread : public LLQueuedThread
|
||||
{
|
||||
public:
|
||||
|
|
@ -50,9 +53,10 @@ public:
|
|||
public:
|
||||
ImageRequest(handle_t handle, LLImageFormatted* image,
|
||||
U32 priority, S32 discard, BOOL needs_aux,
|
||||
LLImageDecodeThread::Responder* responder);
|
||||
LLImageDecodeThread::Responder* responder, LLImageDecodeThread *aQueue);
|
||||
|
||||
/*virtual*/ bool processRequest();
|
||||
bool processRequestIntern();
|
||||
/*virtual*/ void finishRequest(bool completed);
|
||||
|
||||
// Used by unit tests to check the consitency of the request instance
|
||||
|
|
@ -66,13 +70,18 @@ public:
|
|||
// output
|
||||
LLPointer<LLImageRaw> mDecodedImageRaw;
|
||||
LLPointer<LLImageRaw> mDecodedImageAux;
|
||||
LLImageDecodeThread * mQueue; // <FS:ND> Image thread pool from CoolVL
|
||||
BOOL mDecodedRaw;
|
||||
BOOL mDecodedAux;
|
||||
LLPointer<LLImageDecodeThread::Responder> mResponder;
|
||||
};
|
||||
|
||||
public:
|
||||
LLImageDecodeThread(bool threaded = true);
|
||||
// <FS:ND> Image thread pool from CoolVL
|
||||
//LLImageDecodeThread(bool threaded = true);
|
||||
LLImageDecodeThread(bool threaded = true, U32 aSubThreads = 0 );
|
||||
// </FS:ND>
|
||||
|
||||
virtual ~LLImageDecodeThread();
|
||||
|
||||
handle_t decodeImage(LLImageFormatted* image,
|
||||
|
|
@ -99,6 +108,11 @@ private:
|
|||
typedef std::list<creation_info> creation_list_t;
|
||||
creation_list_t mCreationList;
|
||||
LLMutex* mCreationMutex;
|
||||
|
||||
// <FS:ND> Image thread pool from CoolVL
|
||||
std::vector< std::shared_ptr< PoolWorkerThread > > mThreadPool;
|
||||
bool enqueRequest(ImageRequest*);
|
||||
// <FS:ND>
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -25,13 +25,16 @@
|
|||
*/
|
||||
|
||||
#include "linden_common.h"
|
||||
#include "fstelemetry.h" // <FS:Beq> instrument image decodes
|
||||
#include "llimagej2coj.h"
|
||||
#define OPENJPEG2
|
||||
|
||||
// this is defined so that we get static linking.
|
||||
#include "openjpeg.h"
|
||||
#ifndef OPENJPEG2
|
||||
#include "cio.h"
|
||||
#endif
|
||||
#include "event.h"
|
||||
#define OPENJPEG2
|
||||
|
||||
#include "lltimer.h"
|
||||
|
||||
|
|
@ -177,9 +180,13 @@ std::string LLImageJ2COJ::getEngineInfo() const
|
|||
+ opj_version();
|
||||
#elif defined OPJ_PACKAGE_VERSION
|
||||
return std::string("OpenJPEG: " OPJ_PACKAGE_VERSION ", Runtime: ") + opj_version();
|
||||
#else
|
||||
#ifdef OPENJPEG2
|
||||
return llformat("OpenJPEG: %i.%i.%i, Runtime: %s", OPJ_VERSION_MAJOR, OPJ_VERSION_MINOR, OPJ_VERSION_BUILD, opj_version());
|
||||
#else
|
||||
return std::string("OpenJPEG Runtime: ") + opj_version();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
// Return string from message, eliminating final \n if present
|
||||
|
|
@ -252,10 +259,11 @@ bool LLImageJ2COJ::initEncode(LLImageJ2C &base, LLImageRaw &raw_image, int block
|
|||
bool LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decode_time, S32 first_channel, S32 max_channel_count)
|
||||
{
|
||||
// <FS:Techwolf Lupindo> texture comment metadata reader
|
||||
FSZone; // <FS:Beq> instrument image decodes
|
||||
U8* c_data = base.getData();
|
||||
S32 c_size = base.getDataSize();
|
||||
S32 position = 0;
|
||||
|
||||
|
||||
while (position < 1024 && position < (c_size - 7)) // the comment field should be in the first 1024 bytes.
|
||||
{
|
||||
if (c_data[position] == 0xff && c_data[position + 1] == 0x64)
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
#include "llpointer.h"
|
||||
#include "llmath.h"
|
||||
#include "llkdumem.h"
|
||||
|
||||
#include "fstelemetry.h" // <FS:Beq> instrument image decodes
|
||||
#define kdu_xxxx "kdu_block_coding.h"
|
||||
#include "include_kdu_xxxx.h"
|
||||
|
||||
|
|
@ -287,6 +287,7 @@ void transfer_bytes(kdu_byte *dest, kdu_line_buf &src, int gap, int precision);
|
|||
// as well, when that still existed, with keep_codestream true and MODE_FAST.
|
||||
void LLImageJ2CKDU::setupCodeStream(LLImageJ2C &base, bool keep_codestream, ECodeStreamMode mode)
|
||||
{
|
||||
FSZone; // <FS:Beq> instrument image decodes
|
||||
S32 data_size = base.getDataSize();
|
||||
S32 max_bytes = (base.getMaxBytes() ? base.getMaxBytes() : data_size);
|
||||
|
||||
|
|
@ -436,6 +437,7 @@ bool LLImageJ2CKDU::initEncode(LLImageJ2C &base, LLImageRaw &raw_image, int bloc
|
|||
// decodeImpl() usage matters for production.
|
||||
bool LLImageJ2CKDU::initDecode(LLImageJ2C &base, LLImageRaw &raw_image, F32 decode_time, ECodeStreamMode mode, S32 first_channel, S32 max_channel_count, int discard_level, int* region)
|
||||
{
|
||||
FSZone; // <FS:Beq> instrument image decodes
|
||||
base.resetLastError();
|
||||
|
||||
// *FIX: kdu calls our callback function if there's an error, and then bombs.
|
||||
|
|
@ -519,6 +521,7 @@ bool LLImageJ2CKDU::initDecode(LLImageJ2C &base, LLImageRaw &raw_image, F32 deco
|
|||
// Returns true to mean done, whether successful or not.
|
||||
bool LLImageJ2CKDU::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decode_time, S32 first_channel, S32 max_channel_count)
|
||||
{
|
||||
FSZone; // <FS:Beq> instrument image decodes
|
||||
ECodeStreamMode mode = MODE_FAST;
|
||||
|
||||
LLTimer decode_timer;
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -39,6 +39,29 @@ inline U64 to_region_handle(const U32 x_origin, const U32 y_origin)
|
|||
return region_handle;
|
||||
}
|
||||
|
||||
// <FS:Beq> FIRE-30534 Overload that takes explicit region origin and width to improve Var Region identification.
|
||||
inline U64 to_region_handle(const LLVector3d& pos_global, const LLVector3d& agent_region_origin, const F32 width)
|
||||
{
|
||||
U32 global_x { static_cast<U32>( pos_global.mdV[VX] ) };
|
||||
U32 global_y { static_cast<U32>( pos_global.mdV[VY] ) };
|
||||
|
||||
U32 agent_region_origin_x { static_cast<U32>( agent_region_origin.mdV[VX] ) };
|
||||
U32 agent_region_origin_y { static_cast<U32>( agent_region_origin.mdV[VY] ) };
|
||||
|
||||
if( agent_region_origin_x < global_x && ( agent_region_origin_x + width ) > global_x &&
|
||||
agent_region_origin_y < global_y && ( agent_region_origin_y + width ) > global_y )
|
||||
{
|
||||
// target is local to current region we can make a more informed guess
|
||||
return to_region_handle( agent_region_origin_x, agent_region_origin_y );
|
||||
}
|
||||
// fallback to legacy 256m tile-based guess and let the region server / map work it out.
|
||||
global_x -= global_x % 256;
|
||||
global_y -= global_y % 256;
|
||||
|
||||
return to_region_handle( global_x, global_y );
|
||||
}
|
||||
// </FS:Beq>
|
||||
|
||||
inline U64 to_region_handle(const LLVector3d& pos_global)
|
||||
{
|
||||
U32 global_x = (U32)pos_global.mdV[VX];
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -28,8 +28,6 @@
|
|||
|
||||
#include "llmaterial.h"
|
||||
|
||||
#include "../llrender/llglheaders.h"
|
||||
|
||||
/**
|
||||
* Materials cap parameters
|
||||
*/
|
||||
|
|
@ -107,8 +105,6 @@ LLMaterial::LLMaterial()
|
|||
, mSpecularLightExponent(LLMaterial::DEFAULT_SPECULAR_LIGHT_EXPONENT)
|
||||
, mEnvironmentIntensity(LLMaterial::DEFAULT_ENV_INTENSITY)
|
||||
, mDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_BLEND)
|
||||
, mDiffuseFormatPrimary(GL_RGBA)
|
||||
, mDiffuseBaked(false)
|
||||
, mAlphaMaskCutoff(0)
|
||||
{
|
||||
}
|
||||
|
|
@ -315,20 +311,6 @@ void LLMaterial::setEnvironmentIntensity(U8 intensity)
|
|||
mEnvironmentIntensity = intensity;
|
||||
}
|
||||
|
||||
U8 LLMaterial::getDiffuseAlphaModeRender() const
|
||||
{
|
||||
if (mDiffuseBaked
|
||||
|| mDiffuseFormatPrimary == GL_RGBA
|
||||
|| mDiffuseFormatPrimary == GL_ALPHA)
|
||||
{
|
||||
return mDiffuseAlphaMode;
|
||||
}
|
||||
else
|
||||
{
|
||||
return DIFFUSE_ALPHA_MODE_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
U8 LLMaterial::getDiffuseAlphaMode() const
|
||||
{
|
||||
return mDiffuseAlphaMode;
|
||||
|
|
@ -339,26 +321,6 @@ void LLMaterial::setDiffuseAlphaMode(U8 alpha_mode)
|
|||
mDiffuseAlphaMode = alpha_mode;
|
||||
}
|
||||
|
||||
U32 LLMaterial::getDiffuseFormatPrimary() const
|
||||
{
|
||||
return mDiffuseFormatPrimary;
|
||||
}
|
||||
|
||||
void LLMaterial::setDiffuseFormatPrimary(U32 format_primary)
|
||||
{
|
||||
mDiffuseFormatPrimary = format_primary;
|
||||
}
|
||||
|
||||
bool LLMaterial::getIsDiffuseBaked() const
|
||||
{
|
||||
return mDiffuseBaked;
|
||||
}
|
||||
|
||||
void LLMaterial::setDiffuseBaked(bool baked)
|
||||
{
|
||||
mDiffuseBaked = baked;
|
||||
}
|
||||
|
||||
U8 LLMaterial::getAlphaMaskCutoff() const
|
||||
{
|
||||
return mAlphaMaskCutoff;
|
||||
|
|
@ -475,7 +437,7 @@ U32 LLMaterial::getShaderMask(U32 alpha_mode)
|
|||
}
|
||||
else
|
||||
{
|
||||
ret = getDiffuseAlphaModeRender();
|
||||
ret = getDiffuseAlphaMode();
|
||||
}
|
||||
|
||||
llassert(ret < SHADER_COUNT);
|
||||
|
|
|
|||
|
|
@ -115,17 +115,8 @@ public:
|
|||
void setSpecularLightExponent(U8 exponent);
|
||||
U8 getEnvironmentIntensity() const;
|
||||
void setEnvironmentIntensity(U8 intensity);
|
||||
|
||||
// getDiffuseAlphaModeRender takes into account if image supports alpha
|
||||
// and returns value apropriate for render
|
||||
// getDiffuseAlphaMode() returns value as is
|
||||
U8 getDiffuseAlphaModeRender() const;
|
||||
U8 getDiffuseAlphaMode() const;
|
||||
void setDiffuseAlphaMode(U8 alpha_mode);
|
||||
U32 getDiffuseFormatPrimary() const;
|
||||
void setDiffuseFormatPrimary(U32 format_primary);
|
||||
bool getIsDiffuseBaked() const;
|
||||
void setDiffuseBaked(bool baked);
|
||||
U8 getAlphaMaskCutoff() const;
|
||||
void setAlphaMaskCutoff(U8 cutoff);
|
||||
|
||||
|
|
@ -156,8 +147,6 @@ protected:
|
|||
U8 mSpecularLightExponent;
|
||||
U8 mEnvironmentIntensity;
|
||||
U8 mDiffuseAlphaMode;
|
||||
U32 mDiffuseFormatPrimary; // value from texture, LLGLenum, is not included in fromLLSD/asLLSD
|
||||
bool mDiffuseBaked; // is not included in fromLLSD/asLLSD
|
||||
U8 mAlphaMaskCutoff;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1220,7 +1220,13 @@ bool LLModel::isMaterialListSubset( LLModel* ref )
|
|||
{
|
||||
int refCnt = ref->mMaterialList.size();
|
||||
int modelCnt = mMaterialList.size();
|
||||
|
||||
// <FS:Beq> FIRE-30965 Cleanup braindead mesh parsing error handlers
|
||||
if(modelCnt > refCnt)
|
||||
{
|
||||
// this model cannot be a strict subset if it has more materials than the reference
|
||||
return FALSE;
|
||||
}
|
||||
// </FS:Beq>
|
||||
for (U32 src = 0; src < modelCnt; ++src)
|
||||
{
|
||||
bool foundRef = false;
|
||||
|
|
@ -1264,77 +1270,80 @@ bool LLModel::needToAddFaces( LLModel* ref, int& refFaceCnt, int& modelFaceCnt )
|
|||
return changed;
|
||||
}
|
||||
|
||||
bool LLModel::matchMaterialOrder(LLModel* ref, int& refFaceCnt, int& modelFaceCnt )
|
||||
{
|
||||
//Is this a subset?
|
||||
//LODs cannot currently add new materials, e.g.
|
||||
//1. ref = a,b,c lod1 = d,e => This is not permitted
|
||||
//2. ref = a,b,c lod1 = c => This would be permitted
|
||||
// <FS:Beq> FIRE-30965 Improve mesh upload error handling
|
||||
// function moved to llmodelpreview
|
||||
// bool LLModel::matchMaterialOrder(LLModel* ref, int& refFaceCnt, int& modelFaceCnt )
|
||||
// {
|
||||
// //Is this a subset?
|
||||
// //LODs cannot currently add new materials, e.g.
|
||||
// //1. ref = a,b,c lod1 = d,e => This is not permitted
|
||||
// //2. ref = a,b,c lod1 = c => This would be permitted
|
||||
|
||||
bool isASubset = isMaterialListSubset( ref );
|
||||
if ( !isASubset )
|
||||
{
|
||||
LL_INFOS("MESHSKININFO")<<"Material of model is not a subset of reference."<<LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
// bool isASubset = isMaterialListSubset( ref );
|
||||
// if ( !isASubset )
|
||||
// {
|
||||
// LL_INFOS("MESHSKININFO")<<"Material of model is not a subset of reference."<<LL_ENDL;
|
||||
// return false;
|
||||
// }
|
||||
|
||||
if (mMaterialList.size() > ref->mMaterialList.size())
|
||||
{
|
||||
LL_INFOS("MESHSKININFO") << "Material of model has more materials than a reference." << LL_ENDL;
|
||||
// We passed isMaterialListSubset, so materials are a subset, but subset isn't supposed to be
|
||||
// larger than original and if we keep going, reordering will cause a crash
|
||||
return false;
|
||||
}
|
||||
// if (mMaterialList.size() > ref->mMaterialList.size())
|
||||
// {
|
||||
// LL_INFOS("MESHSKININFO") << "Material of model has more materials than a reference." << LL_ENDL;
|
||||
// // We passed isMaterialListSubset, so materials are a subset, but subset isn't supposed to be
|
||||
// // larger than original and if we keep going, reordering will cause a crash
|
||||
// return false;
|
||||
// }
|
||||
|
||||
std::map<std::string, U32> index_map;
|
||||
// std::map<std::string, U32> index_map;
|
||||
|
||||
//build a map of material slot names to face indexes
|
||||
bool reorder = false;
|
||||
// //build a map of material slot names to face indexes
|
||||
// bool reorder = false;
|
||||
|
||||
std::set<std::string> base_mat;
|
||||
std::set<std::string> cur_mat;
|
||||
// std::set<std::string> base_mat;
|
||||
// std::set<std::string> cur_mat;
|
||||
|
||||
for (U32 i = 0; i < mMaterialList.size(); i++)
|
||||
{
|
||||
index_map[ref->mMaterialList[i]] = i;
|
||||
//if any material name does not match reference, we need to reorder
|
||||
reorder |= ref->mMaterialList[i] != mMaterialList[i];
|
||||
base_mat.insert(ref->mMaterialList[i]);
|
||||
cur_mat.insert(mMaterialList[i]);
|
||||
}
|
||||
// for (U32 i = 0; i < mMaterialList.size(); i++)
|
||||
// {
|
||||
// index_map[ref->mMaterialList[i]] = i;
|
||||
// //if any material name does not match reference, we need to reorder
|
||||
// reorder |= ref->mMaterialList[i] != mMaterialList[i];
|
||||
// base_mat.insert(ref->mMaterialList[i]);
|
||||
// cur_mat.insert(mMaterialList[i]);
|
||||
// }
|
||||
|
||||
|
||||
if (reorder && (base_mat == cur_mat)) //don't reorder if material name sets don't match
|
||||
{
|
||||
std::vector<LLVolumeFace> new_face_list;
|
||||
new_face_list.resize(mMaterialList.size());
|
||||
// if (reorder && (base_mat == cur_mat)) //don't reorder if material name sets don't match
|
||||
// {
|
||||
// std::vector<LLVolumeFace> new_face_list;
|
||||
// new_face_list.resize(mMaterialList.size());
|
||||
|
||||
std::vector<std::string> new_material_list;
|
||||
new_material_list.resize(mMaterialList.size());
|
||||
// std::vector<std::string> new_material_list;
|
||||
// new_material_list.resize(mMaterialList.size());
|
||||
|
||||
//rebuild face list so materials have the same order
|
||||
//as the reference model
|
||||
for (U32 i = 0; i < mMaterialList.size(); ++i)
|
||||
{
|
||||
U32 ref_idx = index_map[mMaterialList[i]];
|
||||
// //rebuild face list so materials have the same order
|
||||
// //as the reference model
|
||||
// for (U32 i = 0; i < mMaterialList.size(); ++i)
|
||||
// {
|
||||
// U32 ref_idx = index_map[mMaterialList[i]];
|
||||
|
||||
if (i < mVolumeFaces.size())
|
||||
{
|
||||
new_face_list[ref_idx] = mVolumeFaces[i];
|
||||
}
|
||||
new_material_list[ref_idx] = mMaterialList[i];
|
||||
}
|
||||
// if (i < mVolumeFaces.size())
|
||||
// {
|
||||
// new_face_list[ref_idx] = mVolumeFaces[i];
|
||||
// }
|
||||
// new_material_list[ref_idx] = mMaterialList[i];
|
||||
// }
|
||||
|
||||
llassert(new_material_list == ref->mMaterialList);
|
||||
// llassert(new_material_list == ref->mMaterialList);
|
||||
|
||||
mVolumeFaces = new_face_list;
|
||||
// mVolumeFaces = new_face_list;
|
||||
|
||||
//override material list with reference model ordering
|
||||
mMaterialList = ref->mMaterialList;
|
||||
}
|
||||
// //override material list with reference model ordering
|
||||
// mMaterialList = ref->mMaterialList;
|
||||
// }
|
||||
|
||||
return true;
|
||||
}
|
||||
// return true;
|
||||
// }
|
||||
// </FS:Beq>
|
||||
|
||||
bool LLModel::loadSkinInfo(LLSD& header, std::istream &is)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ public:
|
|||
|
||||
//reorder face list based on mMaterialList in this and reference so
|
||||
//order matches that of reference (material ordering touchup)
|
||||
bool matchMaterialOrder(LLModel* ref, int& refFaceCnt, int& modelFaceCnt );
|
||||
// bool matchMaterialOrder(LLModel* ref, int& refFaceCnt, int& modelFaceCnt ); // <FS:Beq/> FIRE-30965 error handling improvements (function relocated)
|
||||
bool isMaterialListSubset( LLModel* ref );
|
||||
bool needToAddFaces( LLModel* ref, int& refFaceCnt, int& modelFaceCnt );
|
||||
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ public:
|
|||
DONE,
|
||||
WARNING_BIND_SHAPE_ORIENTATION,
|
||||
ERROR_PARSING, //basically loading failed
|
||||
ERROR_MATERIALS,
|
||||
ERROR_MATERIALS_NOT_A_SUBSET, // <FS:Beq/> FIRE-30965 - better error differentiation
|
||||
ERROR_PASSWORD_REQUIRED,
|
||||
ERROR_NEED_MORE_MEMORY,
|
||||
ERROR_INVALID_FILE,
|
||||
|
|
@ -95,6 +95,8 @@ public:
|
|||
ERROR_INVALID_PARAMETERS,
|
||||
ERROR_OUT_OF_RANGE,
|
||||
ERROR_FILE_VERSION_INVALID,
|
||||
ERROR_LOD_MODEL_MISMATCH, // <FS:Beq/> clean up and improve error reporting
|
||||
ERROR_HIGH_LOD_MODEL_MISSING, // <FS:Beq/> clean up and improve error reporting
|
||||
ERROR_MODEL // this error should always be last in this list, error code is passed as ERROR_MODEL+error_code
|
||||
} eLoadState;
|
||||
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
@ -859,10 +857,6 @@ bool LLGLManager::initGL()
|
|||
|
||||
stop_glerror();
|
||||
|
||||
setToDebugGPU();
|
||||
|
||||
stop_glerror();
|
||||
|
||||
initGLStates();
|
||||
|
||||
stop_glerror();
|
||||
|
|
@ -870,17 +864,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)
|
||||
|
|
@ -1037,7 +1020,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;
|
||||
|
|
@ -1172,7 +1154,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.
|
||||
|
|
@ -1242,7 +1224,7 @@ void LLGLManager::initExtensions()
|
|||
if (strchr(blacklist,'u')) mHasDepthClamp = FALSE;
|
||||
|
||||
}
|
||||
#endif // LL_LINUX || LL_SOLARIS
|
||||
#endif // LL_LINUX
|
||||
|
||||
if (!mHasMultitexture)
|
||||
{
|
||||
|
|
@ -1320,7 +1302,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)
|
||||
{
|
||||
|
|
@ -1419,7 +1401,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)
|
||||
|
|
@ -2780,8 +2762,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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -152,9 +152,6 @@ public:
|
|||
// Misc extensions
|
||||
BOOL mHasSeparateSpecularColor;
|
||||
|
||||
//whether this GPU is in the debug list.
|
||||
BOOL mDebugGPU;
|
||||
|
||||
S32 mDriverVersionMajor;
|
||||
S32 mDriverVersionMinor;
|
||||
S32 mDriverVersionRelease;
|
||||
|
|
@ -188,7 +185,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;
|
||||
|
|
@ -400,16 +404,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++ )
|
||||
|
|
@ -493,11 +509,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;
|
||||
}
|
||||
|
|
@ -514,6 +555,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;
|
||||
}
|
||||
|
|
@ -530,6 +574,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
|
||||
|
|
|
|||
|
|
@ -874,11 +874,10 @@ void LLTexUnit::setTextureColorSpace(eTextureColorSpace space)
|
|||
}
|
||||
}
|
||||
else
|
||||
// #endif // <FS:Beq/> Colour space and shader fixes for BUG-228586 (Rye)
|
||||
{
|
||||
glTexParameteri(sGLTextureType[mCurrTexType], GL_TEXTURE_SRGB_DECODE_EXT, GL_SKIP_DECODE_EXT);
|
||||
}
|
||||
#endif // <FS:Beq/> Colour space and shader fixes for BUG-228586 (Rye)
|
||||
#endif
|
||||
}
|
||||
|
||||
LLLightState::LLLightState(S32 index)
|
||||
|
|
|
|||
|
|
@ -617,13 +617,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())
|
||||
|
|
@ -972,55 +970,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,234 +36,237 @@ 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,
|
||||
|
||||
// <FS:CR> Import Vignette from Exodus
|
||||
EXO_RENDER_VIGNETTE,
|
||||
EXO_RENDER_SCREEN,
|
||||
// </FS:CR> Import Vignette from Exodus
|
||||
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,
|
||||
// [RLVa:KB] - @setsphere
|
||||
RLV_EFFECT_MODE,
|
||||
RLV_EFFECT_PARAM1,
|
||||
RLV_EFFECT_PARAM2,
|
||||
RLV_EFFECT_PARAM3,
|
||||
RLV_EFFECT_PARAM4,
|
||||
RLV_EFFECT_PARAM5,
|
||||
// [/RLVa:KB]
|
||||
AVATAR_MATRIX, // "matrixPalette"
|
||||
AVATAR_TRANSLATION, // "translationPalette"
|
||||
|
||||
AVATAR_WIND,
|
||||
AVATAR_SINWAVE,
|
||||
AVATAR_GRAVITY,
|
||||
// <FS:CR> Import Vignette from Exodus
|
||||
EXO_RENDER_VIGNETTE, // "exo_vignette"
|
||||
EXO_RENDER_SCREEN, // "exo_screen"
|
||||
// </FS:CR> Import Vignette from Exodus
|
||||
|
||||
TERRAIN_DETAIL0,
|
||||
TERRAIN_DETAIL1,
|
||||
TERRAIN_DETAIL2,
|
||||
TERRAIN_DETAIL3,
|
||||
TERRAIN_ALPHARAMP,
|
||||
|
||||
SHINY_ORIGIN,
|
||||
DISPLAY_GAMMA,
|
||||
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"
|
||||
|
||||
INSCATTER_RT,
|
||||
SUN_SIZE,
|
||||
FOG_COLOR,
|
||||
WL_CAMPOSLOCAL, // "camPosLocal"
|
||||
|
||||
// [RLVa:KB] - @setsphere
|
||||
RLV_EFFECT_MODE, // "rlvEffectMode"
|
||||
RLV_EFFECT_PARAM1, // "rlvEffectParam1"
|
||||
RLV_EFFECT_PARAM2, // "rlvEffectParam2"
|
||||
RLV_EFFECT_PARAM3, // "rlvEffectParam3"
|
||||
RLV_EFFECT_PARAM4, // "rlvEffectParam4"
|
||||
RLV_EFFECT_PARAM5, // "rlvEffectParam5"
|
||||
// [/RLVa:KB]
|
||||
|
||||
AVATAR_WIND, // "gWindDir"
|
||||
AVATAR_SINWAVE, // "gSinWaveParams"
|
||||
AVATAR_GRAVITY, // "gGravity"
|
||||
|
||||
TERRAIN_DETAIL0, // "detail_0"
|
||||
TERRAIN_DETAIL1, // "detail_1"
|
||||
TERRAIN_DETAIL2, // "detail_2"
|
||||
TERRAIN_DETAIL3, // "detail_3"
|
||||
TERRAIN_ALPHARAMP, // "alpha_ramp"
|
||||
|
||||
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();
|
||||
|
|
|
|||
|
|
@ -157,9 +157,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
|
||||
|
|
@ -167,24 +166,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),
|
||||
|
|
|
|||
|
|
@ -296,9 +296,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");
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
// <FS:AW> hop:// protocol>
|
||||
//#define APP_HEADER_REGEX "((x-grid-location-info://[-\\w\\.]+/app)|(secondlife:///app))"
|
||||
#define APP_HEADER_REGEX "(((hop|x-grid-location-info)://[-\\w\\.\\:\\@]+/app)|((hop|secondlife|inworldz|iw):///app))"
|
||||
#define APP_HEADER_REGEX "(((hop|x-grid-location-info)://[-\\w\\.\\:\\@]+/app)|((hop|secondlife):///app))"
|
||||
// </FS:AW>
|
||||
|
||||
// Utility functions
|
||||
|
|
@ -354,9 +354,8 @@ std::string LLUrlEntryHTTPNoProtocol::getTooltip(const std::string &url) const
|
|||
LLUrlEntryInvalidSLURL::LLUrlEntryInvalidSLURL()
|
||||
: LLUrlEntryBase()
|
||||
{
|
||||
// <FS:Ansariel> Inworldz special
|
||||
//mPattern = boost::regex("(http://(maps.secondlife.com|slurl.com)/secondlife/|secondlife://(/app/(worldmap|teleport)/)?)[^ /]+(/-?[0-9]+){1,3}(/?(\\?title|\\?img|\\?msg)=\\S*)?/?",
|
||||
mPattern = boost::regex("(https?://(maps.secondlife.com|slurl.com)/secondlife/|(secondlife|inworldz|iw)://(/app/(worldmap|teleport)/)?)[^ /]+(/-?[0-9]+){1,3}(/?(\\?title|\\?img|\\?msg)=\\S*)?/?",
|
||||
// <FS:Beq> remove legacy Inworldz URI support. restore previous with addition of https
|
||||
mPattern = boost::regex("(https?://(maps.secondlife.com|slurl.com)/secondlife/|secondlife://(/app/(worldmap|teleport)/)?)[^ /]+(/-?[0-9]+){1,3}(/?(\\?title|\\?img|\\?msg)=\\S*)?/?",
|
||||
boost::regex::perl|boost::regex::icase);
|
||||
mMenuName = "menu_url_http.xml";
|
||||
mTooltip = LLTrans::getString("TooltipHttpUrl");
|
||||
|
|
@ -1099,7 +1098,7 @@ LLUrlEntryObjectIM::LLUrlEntryObjectIM()
|
|||
{
|
||||
// <FS:AW> hop:// protocol; Ansa: Stop at first space so we can use it in notifications!
|
||||
//mPattern = boost::regex("secondlife:///app/objectim/[\\da-f-]+\?\\S*\\w",
|
||||
mPattern = boost::regex("(hop|secondlife|inworldz|iw):///app/objectim/[\\da-f-]+\?[^ \t\r\n\v\f]*",
|
||||
mPattern = boost::regex("(hop|secondlife):///app/objectim/[\\da-f-]+\?[^ \t\r\n\v\f]*",
|
||||
// </FS:AW>
|
||||
boost::regex::perl|boost::regex::icase);
|
||||
mMenuName = "menu_url_objectim.xml";
|
||||
|
|
@ -1228,9 +1227,7 @@ void LLUrlEntryParcel::processParcelInfo(const LLParcelData& parcel_data)
|
|||
//
|
||||
LLUrlEntryPlace::LLUrlEntryPlace()
|
||||
{
|
||||
// <FS:Ansariel> Inworldz special
|
||||
//mPattern = boost::regex("((hop://[-\\w\\.\\:\\@]+/)|((x-grid-location-info://[-\\w\\.]+/region/)|(secondlife://)))\\S+/?(\\d+/\\d+/\\d+|\\d+/\\d+)/?", // <AW: hop:// protocol>
|
||||
mPattern = boost::regex("((hop://[-\\w\\.\\:\\@]+/)|((x-grid-location-info://[-\\w\\.]+/region/)|((secondlife|inworldz|iw)://)))\\S+/?(\\d+/\\d+/\\d+|\\d+/\\d+)/?", // <AW: hop:// protocol>
|
||||
mPattern = boost::regex("((hop://[-\\w\\.\\:\\@]+/)|((x-grid-location-info://[-\\w\\.]+/region/)|(secondlife://)))\\S+/?(\\d+/\\d+/\\d+|\\d+/\\d+)/?", // <AW: hop:// protocol>
|
||||
boost::regex::perl|boost::regex::icase);
|
||||
mMenuName = "menu_url_slurl.xml";
|
||||
mTooltip = LLTrans::getString("TooltipSLURL");
|
||||
|
|
@ -1413,7 +1410,7 @@ std::string LLUrlEntryTeleport::getLocation(const std::string &url) const
|
|||
///
|
||||
FSUrlEntryWear::FSUrlEntryWear()
|
||||
{
|
||||
mPattern = boost::regex("(hop|secondlife|inworldz|iw):///app/wear_folder/\\S+",
|
||||
mPattern = boost::regex("(hop|secondlife):///app/wear_folder/\\S+",
|
||||
boost::regex::perl|boost::regex::icase);
|
||||
mMenuName = "menu_url_slapp.xml";
|
||||
mTooltip = LLTrans::getString("TooltipFSUrlEntryWear");
|
||||
|
|
@ -1431,7 +1428,7 @@ std::string FSUrlEntryWear::getLabel(const std::string &url, const LLUrlLabelCal
|
|||
//
|
||||
LLUrlEntrySL::LLUrlEntrySL()
|
||||
{
|
||||
mPattern = boost::regex("(hop|secondlife|inworldz|iw)://(\\w+)?(:\\d+)?/\\S+", // <AW: hop:// protocol>
|
||||
mPattern = boost::regex("(hop|secondlife)://(\\w+)?(:\\d+)?/\\S+", // <AW: hop:// protocol>
|
||||
boost::regex::perl|boost::regex::icase);
|
||||
mMenuName = "menu_url_slapp.xml";
|
||||
mTooltip = LLTrans::getString("TooltipSLAPP");
|
||||
|
|
@ -1449,7 +1446,7 @@ std::string LLUrlEntrySL::getLabel(const std::string &url, const LLUrlLabelCallb
|
|||
///
|
||||
FSHelpDebugUrlEntrySL::FSHelpDebugUrlEntrySL()
|
||||
{
|
||||
mPattern = boost::regex("(hop|secondlife|inworldz|iw):///app/fshelp/showdebug/\\S+",
|
||||
mPattern = boost::regex("(hop|secondlife):///app/fshelp/showdebug/\\S+",
|
||||
boost::regex::perl|boost::regex::icase);
|
||||
mMenuName = "menu_url_slapp.xml";
|
||||
mTooltip = LLTrans::getString("TooltipFSHelpDebugSLUrl");
|
||||
|
|
@ -1468,7 +1465,7 @@ std::string FSHelpDebugUrlEntrySL::getLabel(const std::string &url, const LLUrlL
|
|||
//
|
||||
LLUrlEntrySLLabel::LLUrlEntrySLLabel()
|
||||
{
|
||||
mPattern = boost::regex("\\[(hop|secondlife|inworldz|iw)://\\S+[ \t]+[^\\]]+\\]", // <AW: hop:// protocol>
|
||||
mPattern = boost::regex("\\[(hop|secondlife)://\\S+[ \t]+[^\\]]+\\]", // <AW: hop:// protocol>
|
||||
boost::regex::perl|boost::regex::icase);
|
||||
mMenuName = "menu_url_slapp.xml";
|
||||
mTooltip = LLTrans::getString("TooltipSLAPP");
|
||||
|
|
|
|||
|
|
@ -51,14 +51,14 @@ 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>
|
||||
# include <stdio.h>
|
||||
#endif // LL_LINUX || LL_SOLARIS
|
||||
#endif // LL_LINUX
|
||||
|
||||
extern BOOL gDebugWindowProc;
|
||||
|
||||
|
|
@ -332,12 +332,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'
|
||||
|
|
@ -418,7 +412,6 @@ static int x11_detect_VRAM_kb()
|
|||
}
|
||||
}
|
||||
return rtn;
|
||||
#endif // LL_SOLARIS
|
||||
}
|
||||
#endif // LL_X11
|
||||
|
||||
|
|
@ -507,27 +500,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?
|
||||
|
|
@ -705,25 +681,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",
|
||||
|
|
@ -2547,7 +2511,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)
|
||||
|
|
@ -2626,7 +2590,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)
|
||||
{
|
||||
|
|
@ -2645,7 +2609,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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -748,6 +748,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
|
||||
|
|
@ -1517,6 +1548,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
|
|||
|
||||
S32 swap_method = 0;
|
||||
S32 cur_format = 0;
|
||||
const S32 max_format = (S32)num_formats - 1;
|
||||
GLint swap_query = WGL_SWAP_METHOD_ARB;
|
||||
|
||||
// SL-14705 Fix name tags showing in front of objects with AMD GPUs.
|
||||
|
|
@ -1529,7 +1561,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
|
|||
{
|
||||
break;
|
||||
}
|
||||
else if (cur_format >= (S32)(num_formats - 1))
|
||||
else if (cur_format >= max_format)
|
||||
{
|
||||
cur_format = 0;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -698,6 +698,7 @@ set(viewer_SOURCE_FILES
|
|||
llsyntaxid.cpp
|
||||
llsyswellitem.cpp
|
||||
llsyswellwindow.cpp
|
||||
lltelemetry.cpp
|
||||
llteleporthistory.cpp
|
||||
llteleporthistorystorage.cpp
|
||||
lltextureatlas.cpp
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
6.4.19
|
||||
6.4.20
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
<string>CameraFocusTransitionTime</string>
|
||||
<string>CameraFNumber</string>
|
||||
<string>FramePerSecondLimit</string>
|
||||
<string>FSAllowWaterDistortionOcclusion</string>
|
||||
<string>FSDynamicTextureMemory</string>
|
||||
<string>FSDynamicTextureMemoryCacheReserve</string>
|
||||
<string>FSDynamicTextureMemoryGPUReserve</string>
|
||||
|
|
|
|||
|
|
@ -166,17 +166,6 @@
|
|||
<key>Backup</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>OpensimPrefsAddGrid</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Transient string for adding new grids in Preferences > Opensim</string>
|
||||
<key>Persist</key>
|
||||
<integer>0</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string/>
|
||||
</map>
|
||||
<key>FSShowDummyAVsinRadar</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
@ -2919,7 +2908,7 @@
|
|||
<key>Value</key>
|
||||
<integer>23</integer>
|
||||
</map>
|
||||
<key>EnableCacheDebugInfo</key>
|
||||
<key>EnableDiskCacheDebugInfo</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>When set, display additional cache debugging information</string>
|
||||
|
|
@ -2933,7 +2922,7 @@
|
|||
<key>DiskCachePercentOfTotal</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>The percent of total cache size (defined by CacheSize) to use for the disk cache</string>
|
||||
<string>The percent of total cache size (defined by CacheSize) to use for the disk cache (UNUSED)</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
|
|
@ -2952,6 +2941,17 @@
|
|||
<key>Value</key>
|
||||
<string>cache</string>
|
||||
</map>
|
||||
<key>FSDiskCacheSize</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Controls amount of hard drive space reserved for local asset caching in MB</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>U32</string>
|
||||
<key>Value</key>
|
||||
<integer>2048</integer>
|
||||
</map>
|
||||
<key>CacheLocation</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
@ -2988,7 +2988,7 @@
|
|||
<key>CacheSize</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Controls amount of hard drive space reserved for local file caching in MB</string>
|
||||
<string>Controls amount of hard drive space reserved for local texture caching in MB</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
|
|
@ -9007,7 +9007,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 try to throttle memory allocations when memory is low (32bit systems only)</string>
|
||||
|
|
@ -9388,6 +9388,17 @@
|
|||
<key>Value</key>
|
||||
<string>salt_and_pepper.jpg</string>
|
||||
</map>
|
||||
<key>FSPhysicsPresetUser1</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>full system path to a user provided physics mesh (DAE).</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string></string>
|
||||
</map>
|
||||
<key>MigrateCacheDirectory</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
@ -11978,7 +11989,7 @@ Change of this parameter will affect the layout of buttons in notification toast
|
|||
<key>Type</key>
|
||||
<string>F32</string>
|
||||
<key>Value</key>
|
||||
<real>0.03</real>
|
||||
<real>0.1</real>
|
||||
</map>
|
||||
<key>RenderDebugPipeline</key>
|
||||
<map>
|
||||
|
|
@ -25562,17 +25573,6 @@ Change of this parameter will affect the layout of buttons in notification toast
|
|||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>FSAllowWaterDistortionOcclusion</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>If allowed, object occlusion setting will be restored for generating the water reflection distortion. This was allowed pre-EEP and got disabled for EEP. While generating is more exact without occlusion, it can cause a huge performance impact.</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>FSDynamicTextureMemory</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
@ -25661,5 +25661,38 @@ Change of this parameter will affect the layout of buttons in notification toast
|
|||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>FSImageDecodeThreads</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Amount of threads to use for image decoding. 0 = autodetect, 1 = 0ff, >1 number of threads. Needs restart</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>U32</string>
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>FSAutoUnmuteSounds</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>If Sound Effects are muted, unmute on TP. Default (false)</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>FSAutoUnmuteAmbient</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>If Ambient sounds are muted, unmute on TP. Default (false)</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
</map>
|
||||
</llsd>
|
||||
|
|
|
|||
|
|
@ -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,7 +40,8 @@ uniform sampler2D specularMap;
|
|||
|
||||
VARYING vec2 vary_texcoord0;
|
||||
|
||||
vec3 linear_to_srgb(vec3 cl);// <FS:Beq/> Colour space and shader fixes for BUG-228586 (Rye)
|
||||
vec3 linear_to_srgb(vec3 c);
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 col = texture2D(diffuseMap, vary_texcoord0.xy);
|
||||
|
|
@ -53,7 +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);// <FS:Beq/> Colour space and shader fixes for BUG-228586 (Rye)
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -405,8 +405,8 @@ void main()
|
|||
vec3 npos = normalize(-pos.xyz);
|
||||
|
||||
vec3 light = vec3(0, 0, 0);
|
||||
final_specular.rgb = srgb_to_linear(final_specular.rgb);// <FS:Beq/> Colour space and shader fixes for BUG-228586 (Rye)
|
||||
|
||||
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,10 +73,8 @@ void main()
|
|||
vec3 norm = getNorm(frag.xy);
|
||||
|
||||
vec4 spec = texture2DRect(specularRect, frag.xy);
|
||||
// spec.rgb = srgb_to_linear(spec.rgb);// <FS:Beq/> Colour space and shader fixes for BUG-228586 (Rye)
|
||||
vec3 diff = texture2DRect(diffuseRect, frag.xy).rgb;
|
||||
// diff.rgb = srgb_to_linear(diff.rgb);// <FS:Beq/> Colour space and shader fixes for BUG-228586 (Rye)
|
||||
|
||||
|
||||
float noise = texture2D(noiseMap, frag.xy / 128.0).b;
|
||||
vec3 npos = normalize(-pos);
|
||||
|
||||
|
|
|
|||
|
|
@ -187,12 +187,7 @@ void main()
|
|||
|
||||
|
||||
vec3 diff_tex = texture2DRect(diffuseRect, frag.xy).rgb;
|
||||
// <FS:Beq> Colour space and shader fixes for BUG-228586 (Rye)
|
||||
// // 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);
|
||||
// </FS:Beq>
|
||||
|
||||
vec3 dlit = vec3(0, 0, 0);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -92,7 +92,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); // <FS:Beq> Colour space and shader fixes for BUG-228586 (Rye)
|
||||
|
||||
float fa = falloff+1.0;
|
||||
float dist_atten = clamp(1.0-(dist-1.0*(1.0-fa))/fa, 0.0, 1.0);
|
||||
|
|
@ -129,7 +128,7 @@ void main()
|
|||
{
|
||||
discard;
|
||||
}
|
||||
//col.rgb = vec3(0);
|
||||
|
||||
frag_color.rgb = col;
|
||||
frag_color.a = 0.0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ void main()
|
|||
vec4 diffuse = texture2DRect(diffuseRect, tc);
|
||||
|
||||
//convert to gamma space
|
||||
diffuse.rgb = linear_to_srgb(diffuse.rgb);// <FS:Beq> Colour space and shader fixes for BUG-228586 (Rye) uniform sampler2DRect depthMap;
|
||||
diffuse.rgb = linear_to_srgb(diffuse.rgb); // SL-14035
|
||||
|
||||
vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy);
|
||||
vec3 color = vec3(0);
|
||||
|
|
|
|||
|
|
@ -49,10 +49,6 @@ void main()
|
|||
vec4 sunDiscB = texture2D(altDiffuseMap, vary_texcoord0.xy);
|
||||
vec4 c = mix(sunDiscA, sunDiscB, blend_factor);
|
||||
|
||||
c.rgb = srgb_to_linear(c.rgb);
|
||||
c.rgb = clamp(c.rgb, vec3(0), vec3(1));
|
||||
c.rgb = pow(c.rgb, vec3(0.7f));
|
||||
|
||||
//c.rgb = fullbrightAtmosTransport(c.rgb);
|
||||
c.rgb = fullbrightScaleSoftClip(c.rgb);
|
||||
|
||||
|
|
|
|||
|
|
@ -48,15 +48,15 @@ void fullbright_shiny_lighting()
|
|||
{
|
||||
vec4 color = diffuseLookup(vary_texcoord0.xy);
|
||||
color.rgb *= vertex_color.rgb;
|
||||
|
||||
|
||||
// SL-9632 HUDs are affected by Atmosphere
|
||||
if (no_atmo == 0)
|
||||
{
|
||||
vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;
|
||||
color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a*0.75); // MAGIC NUMBER SL-12574; ALM: Off, Quality > Low
|
||||
vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;
|
||||
color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a*0.75); // MAGIC NUMBER SL-12574; ALM: Off, Quality > Low
|
||||
|
||||
color.rgb = fullbrightShinyAtmosTransport(color.rgb);
|
||||
color.rgb = fullbrightScaleSoftClip(color.rgb);
|
||||
color.rgb = fullbrightShinyAtmosTransport(color.rgb);
|
||||
color.rgb = fullbrightScaleSoftClip(color.rgb);
|
||||
}
|
||||
/*
|
||||
// NOTE: HUD objects will be full bright. Uncomment if you want "some" environment lighting effecting these HUD objects.
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
uniform mat3 normal_matrix;
|
||||
uniform mat4 texture_matrix0;
|
||||
uniform vec4 ambient_color; // <FS:Beq/> add ambient color to preview shader
|
||||
uniform mat4 modelview_matrix;
|
||||
uniform mat4 modelview_projection_matrix;
|
||||
|
||||
|
|
@ -87,7 +88,7 @@ void main()
|
|||
|
||||
vec3 norm = normalize(normal_matrix * normal);
|
||||
|
||||
vec4 col = vec4(0,0,0,1);
|
||||
vec4 col = ambient_color; // <FS:Beq/> add ambient color to preview shader
|
||||
|
||||
// Collect normal lights (need to be divided by two, as we later multiply by 2)
|
||||
col.rgb += light_diffuse[1].rgb * calcDirectionalLight(norm, light_position[1].xyz);
|
||||
|
|
|
|||
|
|
@ -1,30 +1,37 @@
|
|||
/**
|
||||
/**
|
||||
* @file class1\windlight\atmosphericVarsF.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2007, 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$
|
||||
*/
|
||||
|
||||
|
||||
vec3 getPositionEye()
|
||||
{
|
||||
return vec3(0,0,0);
|
||||
}
|
||||
VARYING vec3 vary_AdditiveColor;
|
||||
VARYING vec3 vary_AtmosAttenuation;
|
||||
|
||||
vec3 getAmblitColor() { return vec3(0, 0, 0); }
|
||||
|
||||
vec3 getAdditiveColor() { return vary_AdditiveColor; }
|
||||
|
||||
vec3 getAtmosAttenuation() { return vec3(vary_AtmosAttenuation); }
|
||||
|
||||
vec3 getSunlitColor() { return vec3(0, 0, 0); }
|
||||
|
||||
vec3 getPositionEye() { return vec3(0, 0, 0); }
|
||||
|
|
|
|||
|
|
@ -1,36 +1,56 @@
|
|||
/**
|
||||
/**
|
||||
* @file class1\windlight\atmosphericVarsV.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2007, 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$
|
||||
*/
|
||||
|
||||
|
||||
VARYING vec3 vary_AdditiveColor;
|
||||
VARYING vec3 vary_AtmosAttenuation;
|
||||
|
||||
vec3 getPositionEye()
|
||||
vec3 additive_color;
|
||||
vec3 atmos_attenuation;
|
||||
vec3 sunlit_color;
|
||||
vec3 amblit_color;
|
||||
vec3 position_eye;
|
||||
|
||||
vec3 getSunlitColor() { return sunlit_color; }
|
||||
void setSunlitColor(vec3 v) { sunlit_color = v; }
|
||||
|
||||
vec3 getAdditiveColor() { return additive_color; }
|
||||
void setAdditiveColor(vec3 v)
|
||||
{
|
||||
return vec3(0,0,0);
|
||||
additive_color = v;
|
||||
vary_AdditiveColor = v;
|
||||
}
|
||||
|
||||
void setPositionEye(vec3 v)
|
||||
vec3 getAmblitColor() { return amblit_color; }
|
||||
void setAmblitColor(vec3 v) { amblit_color = v; }
|
||||
|
||||
vec3 getAtmosAttenuation() { return atmos_attenuation; }
|
||||
void setAtmosAttenuation(vec3 v)
|
||||
{
|
||||
|
||||
atmos_attenuation = v;
|
||||
vary_AtmosAttenuation = v;
|
||||
}
|
||||
|
||||
vec3 getPositionEye() { return position_eye; }
|
||||
void setPositionEye(vec3 v) { position_eye = v; }
|
||||
|
|
|
|||
|
|
@ -1,33 +1,38 @@
|
|||
/**
|
||||
/**
|
||||
* @file class1\windlight\atmosphericVarsWaterF.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2007, 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$
|
||||
*/
|
||||
|
||||
|
||||
VARYING vec3 vary_PositionEye;
|
||||
VARYING vec3 vary_AdditiveColor;
|
||||
VARYING vec3 vary_AtmosAttenuation;
|
||||
|
||||
vec3 getPositionEye()
|
||||
{
|
||||
return vary_PositionEye;
|
||||
}
|
||||
vec3 getSunlitColor() { return vec3(0, 0, 0); }
|
||||
|
||||
vec3 getAmblitColor() { return vec3(0, 0, 0); }
|
||||
|
||||
vec3 getAdditiveColor() { return vary_AdditiveColor; }
|
||||
|
||||
vec3 getAtmosAttenuation() { return vary_AtmosAttenuation; }
|
||||
|
||||
vec3 getPositionEye() { return vary_PositionEye; }
|
||||
|
|
|
|||
|
|
@ -1,37 +1,51 @@
|
|||
/**
|
||||
/**
|
||||
* @file class1\windlight\atmosphericVarsWaterV.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2007, 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$
|
||||
*/
|
||||
|
||||
|
||||
|
||||
VARYING vec3 vary_PositionEye;
|
||||
VARYING vec3 vary_AdditiveColor;
|
||||
VARYING vec3 vary_AtmosAttenuation;
|
||||
|
||||
vec3 getPositionEye()
|
||||
vec3 atmos_attenuation;
|
||||
vec3 sunlit_color;
|
||||
vec3 amblit_color;
|
||||
|
||||
vec3 getSunlitColor() { return sunlit_color; }
|
||||
void setSunlitColor(vec3 v) { sunlit_color = v; }
|
||||
|
||||
vec3 getAmblitColor() { return amblit_color; }
|
||||
void setAmblitColor(vec3 v) { amblit_color = v; }
|
||||
|
||||
vec3 getAdditiveColor() { return vary_AdditiveColor; }
|
||||
void setAdditiveColor(vec3 v) { vary_AdditiveColor = v; }
|
||||
|
||||
vec3 getAtmosAttenuation() { return atmos_attenuation; }
|
||||
void setAtmosAttenuation(vec3 v)
|
||||
{
|
||||
return vary_PositionEye;
|
||||
atmos_attenuation = v;
|
||||
vary_AtmosAttenuation = v;
|
||||
}
|
||||
|
||||
void setPositionEye(vec3 v)
|
||||
{
|
||||
vary_PositionEye = v;
|
||||
}
|
||||
vec3 getPositionEye() { return vary_PositionEye; }
|
||||
void setPositionEye(vec3 v) { vary_PositionEye = v; }
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ void main()
|
|||
// SL-9806 stars poke through
|
||||
// c.a *= sun_fade;
|
||||
|
||||
c.rgb = pow(c.rgb, vec3(0.7f));
|
||||
c.rgb = fullbrightAtmosTransport(c.rgb);
|
||||
c.rgb = fullbrightScaleSoftClip(c.rgb);
|
||||
frag_color = c;
|
||||
|
|
|
|||
|
|
@ -191,12 +191,7 @@ void main()
|
|||
float da = dot(norm, lv);
|
||||
|
||||
vec3 diff_tex = texture2DRect(diffuseRect, frag.xy).rgb;
|
||||
// <FS:Beq> Colour space and shader fixes for BUG-228586
|
||||
// removing comments as colour space change
|
||||
// // 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 since this shader outputs linear
|
||||
// diff_tex.rgb = srgb_to_linear(diff_tex.rgb);
|
||||
|
||||
vec4 spec = texture2DRect(specularRect, frag.xy);
|
||||
|
||||
vec3 dlit = vec3(0, 0, 0);
|
||||
|
|
|
|||
|
|
@ -73,7 +73,21 @@ uniform float ice_level;
|
|||
|
||||
vec3 rainbow(float d)
|
||||
{
|
||||
d = clamp(d, -1.0, 0.0);
|
||||
// d is the dot product of view and sun directions, so ranging -1.0..1.0
|
||||
// 'interesting' values of d are the range -0.75..-0.825, when view is nearly opposite of sun vec
|
||||
// Rainbox texture mode is GL_REPEAT, so tc of -.75 is equiv to 0.25, -0.825 equiv to 0.175.
|
||||
|
||||
// SL-13629 Rainbow texture has colors within the correct .175...250 range, but order is inverted.
|
||||
// Rather than replace the texture, we mirror and translate the y tc to keep the colors within the
|
||||
// interesting range, but in reversed order: i.e. d = (1 - d) - 1.575
|
||||
d = clamp(-0.575 - d, 0.0, 1.0);
|
||||
|
||||
// With the colors in the lower 1/4 of the texture, inverting the coords leaves most of it inaccessible.
|
||||
// So, we can stretch the texcoord above the colors (ie > 0.25) to fill the entire remaining coordinate
|
||||
// space. This improves gradation, reduces banding within the rainbow interior. (1-0.25) / (0.425/0.25) = 4.2857
|
||||
float interior_coord = max(0.0, d - 0.25) * 4.2857;
|
||||
d = clamp(d, 0.0, 0.25) + interior_coord;
|
||||
|
||||
float rad = (droplet_radius - 5.0f) / 1024.0f;
|
||||
return pow(texture2D(rainbow_map, vec2(rad, d)).rgb, vec3(1.8)) * moisture_level;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,12 +87,9 @@ void main()
|
|||
float light_gamma = 1.0 / 1.3;
|
||||
da = pow(da, light_gamma);
|
||||
|
||||
vec4 diffuse = texture2DRect(diffuseRect, tc);
|
||||
// <FS:Beq> Colour space and shader fixes for BUG-228586 (Rye)
|
||||
// convert to gamma space
|
||||
diffuse.rgb = linear_to_srgb(diffuse.rgb);
|
||||
// </FS:Beq>
|
||||
vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy);
|
||||
vec4 diffuse = texture2DRect(diffuseRect, tc);
|
||||
diffuse.rgb = linear_to_srgb(diffuse.rgb); // SL-14025
|
||||
vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy);
|
||||
|
||||
vec2 scol_ambocc = texture2DRect(lightMap, vary_fragcoord.xy).rg;
|
||||
scol_ambocc = pow(scol_ambocc, vec2(light_gamma));
|
||||
|
|
|
|||
|
|
@ -188,10 +188,8 @@ void main()
|
|||
lv = proj_origin-pos.xyz;
|
||||
lv = normalize(lv);
|
||||
float da = dot(norm, lv);
|
||||
// <FS:Beq> Colour space and shader fixes for BUG-228586 (Rye)
|
||||
// vec3 diff_tex = srgb_to_linear(texture2DRect(diffuseRect, frag.xy).rgb);
|
||||
|
||||
vec3 diff_tex = texture2DRect(diffuseRect, frag.xy).rgb;
|
||||
// </FS:Beq>
|
||||
vec4 spec = texture2DRect(specularRect, frag.xy);
|
||||
vec3 dlit = vec3(0, 0, 0);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* @file class2\wl\atmosphericVars.glsl
|
||||
* @file class2\wl\atmosphericVarsF.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
|
|
|
|||
|
|
@ -26,9 +26,9 @@
|
|||
/*[EXTRA_CODE_HERE]*/
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_data[3];
|
||||
out vec4 frag_color;
|
||||
#else
|
||||
#define frag_data gl_FragData
|
||||
#define frag_color gl_FragColor
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -126,8 +126,6 @@ void main()
|
|||
color.rgb = scaleSoftClip(color.rgb);
|
||||
|
||||
/// Gamma correct for WL (soft clip effect).
|
||||
frag_data[0] = vec4(color.rgb, alpha1);
|
||||
frag_data[1] = vec4(0.0,0.0,0.0,0.0);
|
||||
frag_data[2] = vec4(0,0,0,1);
|
||||
frag_color = vec4(color.rgb, alpha1);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,24 +1,24 @@
|
|||
/**
|
||||
/**
|
||||
* @file class2\wl\cloudsV.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,8 +75,8 @@ 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
|
||||
// SL-13084 EEP added support for custom cloud textures -- flip them horizontally to match the preview of Clouds > Cloud Scroll
|
||||
|
|
@ -93,7 +93,7 @@ void main()
|
|||
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);
|
||||
|
||||
// fade clouds beyond a certain point so the bottom of the sky dome doesn't look silly at high altitude
|
||||
|
|
@ -101,27 +101,27 @@ void main()
|
|||
|
||||
// Adj position vector to clamp altitude
|
||||
if (rel_pos.y > 0.)
|
||||
{
|
||||
{
|
||||
rel_pos *= (max_y / rel_pos.y);
|
||||
}
|
||||
}
|
||||
if (rel_pos.y < 0.)
|
||||
{
|
||||
{
|
||||
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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,117 +0,0 @@
|
|||
/**
|
||||
* @file lightInfo.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2007, 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$
|
||||
*/
|
||||
|
||||
struct DirectionalLightInfo
|
||||
{
|
||||
vec4 pos;
|
||||
float depth;
|
||||
vec4 normal;
|
||||
vec3 normalizedLightDirection;
|
||||
vec3 normalizedToLight;
|
||||
float lightIntensity;
|
||||
vec3 lightDiffuseColor;
|
||||
float specExponent;
|
||||
float shadow;
|
||||
};
|
||||
|
||||
struct SpotLightInfo
|
||||
{
|
||||
vec4 pos;
|
||||
float depth;
|
||||
vec4 normal;
|
||||
vec3 normalizedLightDirection;
|
||||
vec3 normalizedToLight;
|
||||
float lightIntensity;
|
||||
float attenuation;
|
||||
float distanceToLight;
|
||||
vec3 lightDiffuseColor;
|
||||
float innerHalfAngleCos;
|
||||
float outerHalfAngleCos;
|
||||
float spotExponent;
|
||||
float specExponent;
|
||||
float shadow;
|
||||
};
|
||||
|
||||
struct PointLightInfo
|
||||
{
|
||||
vec4 pos;
|
||||
float depth;
|
||||
vec4 normal;
|
||||
vec3 normalizedToLight;
|
||||
float lightIntensity;
|
||||
float attenuation;
|
||||
float distanceToLight;
|
||||
vec3 lightDiffuseColor;
|
||||
float lightRadius;
|
||||
float specExponent;
|
||||
vec3 worldspaceLightDirection;
|
||||
float shadow;
|
||||
};
|
||||
|
||||
float attenuate(float attenuationSelection, float distanceToLight)
|
||||
{
|
||||
// LLRENDER_REVIEW
|
||||
// sh/could eventually consume attenuation func defined in texture
|
||||
return (attenuationSelection == 0.0f) ? 1.0f : // none
|
||||
(attenuationSelection < 1.0f) ? (1.0f / distanceToLight) : // linear atten
|
||||
(attenuationSelection < 2.0f) ? (1.0f / (distanceToLight*distanceToLight)) // quadratic atten
|
||||
: (1.0f / (distanceToLight*distanceToLight*distanceToLight)); // cubic atten
|
||||
}
|
||||
|
||||
|
||||
vec3 lightDirectional(struct DirectionalLightInfo dli)
|
||||
{
|
||||
float lightIntensity = dli.lightIntensity;
|
||||
lightIntensity *= dot(dli.normal.xyz, dli.normalizedLightDirection);
|
||||
//lightIntensity *= directionalShadowSample(vec4(dli.pos.xyz, 1.0f), dli.depth, dli.directionalShadowMap, dli.directionalShadowMatrix);
|
||||
return lightIntensity * dli.lightDiffuseColor;
|
||||
}
|
||||
|
||||
|
||||
vec3 lightSpot(struct SpotLightInfo sli)
|
||||
{
|
||||
float penumbraRange = (sli.outerHalfAngleCos - sli.innerHalfAngleCos);
|
||||
float coneAngleCos = max(dot(sli.normalizedLightDirection, sli.normalizedToLight), 0.0);
|
||||
float coneAttenFactor = (coneAngleCos <= sli.outerHalfAngleCos) ? 1.0f : pow(smoothstep(1,0, sli.outerHalfAngleCos / penumbraRange), sli.spotExponent);
|
||||
float distanceAttenuation = attenuate(sli.attenuation, sli.distanceToLight);
|
||||
float lightIntensity = sli.lightIntensity;
|
||||
lightIntensity *= distanceAttenuation;
|
||||
lightIntensity *= max(dot(sli.normal.xyz, sli.normalizedLightDirection), 0.0);
|
||||
lightIntensity *= coneAttenFactor;
|
||||
lightIntensity *= sli.shadow;
|
||||
return lightIntensity * sli.lightDiffuseColor;
|
||||
}
|
||||
|
||||
vec3 lightPoint(struct PointLightInfo pli)
|
||||
{
|
||||
float padRadius = pli.lightRadius * 0.1; // distance for which to perform smoothed dropoff past light radius
|
||||
float distanceAttenuation = attenuate(pli.attenuation, pli.distanceToLight);
|
||||
float lightIntensity = pli.lightIntensity;
|
||||
lightIntensity*= distanceAttenuation;
|
||||
lightIntensity *= clamp((padRadius - pli.distanceToLight + pli.lightRadius) / padRadius, 0.0, 1.0);
|
||||
lightIntensity *= pli.shadow;
|
||||
lightIntensity *= max(dot(pli.normal.xyz, pli.normalizedToLight), 0.0);
|
||||
return lightIntensity * pli.lightDiffuseColor;
|
||||
}
|
||||
|
|
@ -56,8 +56,23 @@ vec3 GetSkyLuminanceToPoint(vec3 camPos, vec3 pos, float shadow_length, vec3 dir
|
|||
vec3 ColorFromRadiance(vec3 radiance);
|
||||
vec3 rainbow(float d)
|
||||
{
|
||||
float rad = (droplet_radius - 5.0f) / 1024.0f;
|
||||
return pow(texture2D(rainbow_map, vec2(rad, d)).rgb, vec3(1.8)) * moisture_level;
|
||||
// d is the dot product of view and sun directions, so ranging -1.0..1.0
|
||||
// 'interesting' values of d are the range -0.75..-0.825, when view is nearly opposite of sun vec
|
||||
// Rainbox texture mode is GL_REPEAT, so tc of -.75 is equiv to 0.25, -0.825 equiv to 0.175.
|
||||
|
||||
// SL-13629 Rainbow texture has colors within the correct .175...250 range, but order is inverted.
|
||||
// Rather than replace the texture, we mirror and translate the y tc to keep the colors within the
|
||||
// interesting range, but in reversed order: i.e. d = (1 - d) - 1.575
|
||||
d = clamp(-0.575 - d, 0.0, 1.0);
|
||||
|
||||
// With the colors in the lower 1/4 of the texture, inverting the coords leaves most of it inaccessible.
|
||||
// So, we can stretch the texcoord above the colors (ie > 0.25) to fill the entire remaining coordinate
|
||||
// space. This improves gradation, reduces banding within the rainbow interior. (1-0.25) / (0.425/0.25) = 4.2857
|
||||
float interior_coord = max(0.0, d - 0.25) * 4.2857;
|
||||
d = clamp(d, 0.0, 0.25) + interior_coord;
|
||||
|
||||
float rad = (droplet_radius - 5.0f) / 1024.0f;
|
||||
return pow(texture2D(rainbow_map, vec2(rad, d)).rgb, vec3(1.8)) * moisture_level;
|
||||
}
|
||||
|
||||
vec3 halo22(float d)
|
||||
|
|
|
|||
|
|
@ -938,8 +938,8 @@ bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_ge
|
|||
{
|
||||
region_name = LLWeb::escapeURL(revised_text.substr(command.length() + 1));
|
||||
LLVector3d agentPos = gAgent.getPositionGlobal();
|
||||
agent_x = ll_round((F32)fmod(agentPos.mdV[VX], (F64)REGION_WIDTH_METERS));
|
||||
agent_y = ll_round((F32)fmod(agentPos.mdV[VY], (F64)REGION_WIDTH_METERS));
|
||||
agent_x = ll_round((F32)agentPos.mdV[VX]);
|
||||
agent_y = ll_round((F32)agentPos.mdV[VY]);
|
||||
agent_z = ll_round((F32)agentPos.mdV[VZ]);
|
||||
if (!sFSCmdLineMapToKeepPos)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,74 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<COLLADA version="1.4.1" xmlns="http://www.collada.org/2005/11/COLLADASchema">
|
||||
<asset>
|
||||
<contributor>
|
||||
<author>Avastar User</author>
|
||||
<authoring_tool>Avastar 2-0-10 on Blender 2.78 (sub 0)</authoring_tool>
|
||||
</contributor>
|
||||
<created>2017-02-03T17:31:59</created>
|
||||
<modified>2017-02-03T17:31:59</modified>
|
||||
<unit meter="1" name="meter" />
|
||||
<up_axis>Z_UP</up_axis>
|
||||
</asset>
|
||||
<library_cameras />
|
||||
<library_lights />
|
||||
<library_effects />
|
||||
<library_materials />
|
||||
<library_geometries>
|
||||
<geometry id="Cube_023-mesh" name="Cube.023">
|
||||
<mesh>
|
||||
<source id="Cube_023-mesh-positions">
|
||||
<float_array count="24" id="Cube_023-mesh-positions-array">-0.4 -0.4 -0.4 -0.4 -0.4 0.4 -0.4 0.4 -0.4 -0.4 0.4 0.4 0.4 -0.4 -0.4 0.4 -0.4 0.4 0.4 0.4 -0.4 0.4 0.4 0.4 </float_array>
|
||||
<technique_common>
|
||||
<accessor count="8" source="#Cube_023-mesh-positions-array" stride="3">
|
||||
<param name="X" type="float" />
|
||||
<param name="Y" type="float" />
|
||||
<param name="Z" type="float" />
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="Cube_023-mesh-normals">
|
||||
<float_array count="18" id="Cube_023-mesh-normals-array">-1 -0 0 0 1 0 1 -0 0 0 -1 0 0 0 -1 0 -0 1 </float_array>
|
||||
<technique_common>
|
||||
<accessor count="6" source="#Cube_023-mesh-normals-array" stride="3">
|
||||
<param name="X" type="float" />
|
||||
<param name="Y" type="float" />
|
||||
<param name="Z" type="float" />
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<vertices id="Cube_023-mesh-vertices">
|
||||
<input semantic="POSITION" source="#Cube_023-mesh-positions" />
|
||||
</vertices>
|
||||
<polylist count="12">
|
||||
<input offset="0" semantic="VERTEX" source="#Cube_023-mesh-vertices" />
|
||||
<input offset="1" semantic="NORMAL" source="#Cube_023-mesh-normals" />
|
||||
<vcount>4 4 4 4 4 4</vcount>
|
||||
<p>0 0 1 0 3 0 2 0 2 1 3 1 7 1 6 1 6 2 7 2 5 2 4 2 4 3 5 3 1 3 0 3 2 4 6 4 4 4 0 4 7 5 3 5 1 5 5 5 </p>
|
||||
</polylist>
|
||||
</mesh>
|
||||
<extra>
|
||||
<technique profile="MAYA">
|
||||
<double_sided>1</double_sided>
|
||||
</technique>
|
||||
</extra>
|
||||
</geometry>
|
||||
</library_geometries>
|
||||
<library_controllers />
|
||||
<library_visual_scenes>
|
||||
<visual_scene id="Scene" name="Scene">
|
||||
<node id="Cube_023" name="Cube_023" type="NODE">
|
||||
<translate sid="location">5.93563 6.77334 -14.9673</translate>
|
||||
<rotate sid="rotationZ">0 0 1 0</rotate>
|
||||
<rotate sid="rotationY">0 1 0 0</rotate>
|
||||
<rotate sid="rotationX">1 0 0 0</rotate>
|
||||
<scale sid="scale">1 1 1</scale>
|
||||
<instance_geometry url="#Cube_023-mesh" />
|
||||
</node>
|
||||
</visual_scene>
|
||||
</library_visual_scenes>
|
||||
<scene>
|
||||
<instance_visual_scene url="#Scene" />
|
||||
</scene>
|
||||
</COLLADA>
|
||||
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<asset>
|
||||
<contributor>
|
||||
<author>Blender User</author>
|
||||
<authoring_tool>Blender 2.80.43 commit date:2019-01-29, commit time:22:41, hash:a1ae04d15a9f</authoring_tool>
|
||||
</contributor>
|
||||
<created>2019-02-05T14:28:24</created>
|
||||
<modified>2019-02-05T14:28:24</modified>
|
||||
<unit name="meter" meter="1"/>
|
||||
<up_axis>Z_UP</up_axis>
|
||||
</asset>
|
||||
<library_images/>
|
||||
<library_geometries>
|
||||
<geometry id="Cylinder-mesh" name="Cylinder">
|
||||
<mesh>
|
||||
<source id="Cylinder-mesh-positions">
|
||||
<float_array id="Cylinder-mesh-positions-array" count="36">0 1 -1 0 1 1 0.8660255 0.5 -1 0.8660255 0.5 1 0.8660254 -0.5000001 -1 0.8660254 -0.5000001 1 0 -1 -1 0 -1 1 -0.8660255 -0.4999999 -1 -0.8660255 -0.4999999 1 -0.8660255 0.4999999 -1 -0.8660255 0.4999999 1</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#Cylinder-mesh-positions-array" count="12" stride="3">
|
||||
<param name="X" type="float"/>
|
||||
<param name="Y" type="float"/>
|
||||
<param name="Z" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="Cylinder-mesh-normals">
|
||||
<float_array id="Cylinder-mesh-normals-array" count="48">0.5 0.8660255 0 1 0 0 0.5 -0.8660255 0 -0.5000001 -0.8660253 0 0 0 1 -1 0 0 -0.5000001 0.8660255 0 0 0 -1 1 -1.19209e-7 0 0.5 -0.8660255 0 -0.5000001 -0.8660254 0 0 0 1 1.37651e-7 0 1 0 0 1 1.37651e-7 0 -1 1.37651e-7 0 -1</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#Cylinder-mesh-normals-array" count="16" stride="3">
|
||||
<param name="X" type="float"/>
|
||||
<param name="Y" type="float"/>
|
||||
<param name="Z" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="Cylinder-mesh-map">
|
||||
<float_array id="Cylinder-mesh-map-array" count="120">1 1 0.8333333 0.5 1 0.5 0.8333333 1 0.6666666 0.5 0.8333333 0.5 0.6666666 1 0.5 0.5 0.6666666 0.5 0.5 1 0.3333333 0.5 0.5 0.5 0.25 0.49 0.04215389 0.13 0.4578461 0.1299999 0.3333333 1 0.1666666 0.5 0.3333333 0.5 0.1666666 1 0 0.5 0.1666666 0.5 0.5421539 0.13 0.5421539 0.37 0.9578461 0.37 1 1 0.8333333 1 0.8333333 0.5 0.8333333 1 0.6666666 1 0.6666666 0.5 0.6666666 1 0.5 1 0.5 0.5 0.5 1 0.3333333 1 0.3333333 0.5 0.4578461 0.1299999 0.4578461 0.37 0.25 0.49 0.25 0.49 0.04215389 0.37 0.04215389 0.13 0.04215389 0.13 0.25 0.00999999 0.4578461 0.1299999 0.3333333 1 0.1666666 1 0.1666666 0.5 0.1666666 1 0 1 0 0.5 0.5421539 0.37 0.75 0.49 0.9578461 0.37 0.9578461 0.37 0.9578461 0.1299999 0.75 0.00999999 0.75 0.00999999 0.5421539 0.13 0.9578461 0.37</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#Cylinder-mesh-map-array" count="60" stride="2">
|
||||
<param name="S" type="float"/>
|
||||
<param name="T" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<vertices id="Cylinder-mesh-vertices">
|
||||
<input semantic="POSITION" source="#Cylinder-mesh-positions"/>
|
||||
</vertices>
|
||||
<polylist count="20">
|
||||
<input semantic="VERTEX" source="#Cylinder-mesh-vertices" offset="0"/>
|
||||
<input semantic="NORMAL" source="#Cylinder-mesh-normals" offset="1"/>
|
||||
<input semantic="TEXCOORD" source="#Cylinder-mesh-map" offset="2" set="0"/>
|
||||
<vcount>3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 </vcount>
|
||||
<p>1 0 0 2 0 1 0 0 2 3 1 3 4 1 4 2 1 5 5 2 6 6 2 7 4 2 8 7 3 9 8 3 10 6 3 11 1 4 12 9 4 13 5 4 14 9 5 15 10 5 16 8 5 17 11 6 18 0 6 19 10 6 20 8 7 21 10 7 22 2 7 23 1 0 24 3 0 25 2 0 26 3 8 27 5 8 28 4 8 29 5 9 30 7 9 31 6 9 32 7 10 33 9 10 34 8 10 35 5 11 36 3 11 37 1 11 38 1 12 39 11 12 40 9 12 41 9 13 42 7 13 43 5 13 44 9 5 45 11 5 46 10 5 47 11 6 48 1 6 49 0 6 50 10 14 51 0 14 52 2 14 53 2 15 54 4 15 55 6 15 56 6 7 57 8 7 58 2 7 59</p>
|
||||
</polylist>
|
||||
</mesh>
|
||||
</geometry>
|
||||
</library_geometries>
|
||||
<library_visual_scenes>
|
||||
<visual_scene id="Scene" name="Scene">
|
||||
<node id="Cylinder" name="Cylinder" type="NODE">
|
||||
<matrix sid="transform">1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1</matrix>
|
||||
<instance_geometry url="#Cylinder-mesh" name="Cylinder"/>
|
||||
</node>
|
||||
</visual_scene>
|
||||
</library_visual_scenes>
|
||||
<scene>
|
||||
<instance_visual_scene url="#Scene"/>
|
||||
</scene>
|
||||
</COLLADA>
|
||||
|
|
@ -72,6 +72,7 @@ FSFloaterContacts::FSFloaterContacts(const LLSD& seed)
|
|||
mFriendsList(NULL),
|
||||
mGroupList(NULL),
|
||||
mFriendFilter(NULL),
|
||||
mGroupFilter(NULL),
|
||||
mFriendFilterSubString(LLStringUtil::null),
|
||||
mFriendFilterSubStringOrig(LLStringUtil::null),
|
||||
mAllowRightsChange(true),
|
||||
|
|
@ -153,7 +154,10 @@ BOOL FSFloaterContacts::postBuild()
|
|||
mGroupsTab->childSetAction("titles_btn", boost::bind(&FSFloaterContacts::onGroupTitlesButtonClicked, this));
|
||||
mGroupsTab->childSetAction("invite_btn", boost::bind(&FSFloaterContacts::onGroupInviteButtonClicked, this));
|
||||
mGroupsTab->setDefaultBtn("chat_btn");
|
||||
|
||||
|
||||
mGroupFilter = mGroupsTab->getChild<LLFilterEditor>("group_filter_input");
|
||||
mGroupFilter->setCommitCallback(boost::bind(&FSFloaterContacts::onGroupFilterEdit, this, _2));
|
||||
|
||||
mRlvBehaviorCallbackConnection = gRlvHandler.setBehaviourCallback(boost::bind(&FSFloaterContacts::updateRlvRestrictions, this, _1));
|
||||
|
||||
gSavedSettings.getControl("FSFriendListFullNameFormat")->getSignal()->connect(boost::bind(&FSFloaterContacts::onDisplayNameChanged, this));
|
||||
|
|
@ -195,10 +199,18 @@ BOOL FSFloaterContacts::tick()
|
|||
|
||||
BOOL FSFloaterContacts::handleKeyHere(KEY key, MASK mask)
|
||||
{
|
||||
if (FSCommon::isFilterEditorKeyCombo(key, mask) && getActiveTabName() == FRIENDS_TAB_NAME && gSavedSettings.getBOOL("FSContactListShowSearch"))
|
||||
if (FSCommon::isFilterEditorKeyCombo(key, mask))
|
||||
{
|
||||
mFriendFilter->setFocus(TRUE);
|
||||
return TRUE;
|
||||
if (getActiveTabName() == FRIENDS_TAB_NAME && gSavedSettings.getBOOL("FSContactListShowSearch"))
|
||||
{
|
||||
mFriendFilter->setFocus(TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
else if (getActiveTabName() == GROUP_TAB_NAME)
|
||||
{
|
||||
mGroupFilter->setFocus(TRUE);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (mask == MASK_CONTROL && key == 'W' && getHost())
|
||||
|
|
@ -1357,4 +1369,9 @@ void FSFloaterContacts::resetFriendFilter()
|
|||
mFriendFilter->setText(LLStringUtil::null);
|
||||
onFriendFilterEdit("");
|
||||
}
|
||||
|
||||
void FSFloaterContacts::onGroupFilterEdit(const std::string& search_string)
|
||||
{
|
||||
mGroupList->setNameFilter(search_string);
|
||||
}
|
||||
// EOF
|
||||
|
|
|
|||
|
|
@ -120,6 +120,7 @@ private:
|
|||
EAcceptance* accept,
|
||||
std::string& tooltip_msg);
|
||||
void onFriendFilterEdit(const std::string& search_string);
|
||||
void onGroupFilterEdit(const std::string& search_string);
|
||||
|
||||
// friend buttons
|
||||
void onViewProfileButtonClicked();
|
||||
|
|
@ -128,7 +129,6 @@ private:
|
|||
void onPayButtonClicked();
|
||||
void onDeleteFriendButtonClicked();
|
||||
void onAddFriendWizButtonClicked(LLUICtrl* ctrl);
|
||||
void onContactSetsButtonClicked();
|
||||
void onMapButtonClicked();
|
||||
|
||||
// group buttons
|
||||
|
|
@ -144,6 +144,7 @@ private:
|
|||
|
||||
LLTabContainer* mTabContainer;
|
||||
LLFilterEditor* mFriendFilter;
|
||||
LLFilterEditor* mGroupFilter;
|
||||
LLPanel* mFriendsTab;
|
||||
FSScrollListCtrl* mFriendsList;
|
||||
LLPanel* mGroupsTab;
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@
|
|||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "fsfloatergrouptitles.h"
|
||||
#include "fscommon.h"
|
||||
#include "llfiltereditor.h"
|
||||
#include "llgroupactions.h"
|
||||
#include "llscrolllistctrl.h"
|
||||
#include "lltrans.h"
|
||||
|
|
@ -34,7 +36,7 @@
|
|||
/////////////////////////////////////////////////////
|
||||
// FSGroupTitlesObserver class
|
||||
//
|
||||
FSGroupTitlesObserver::FSGroupTitlesObserver(const LLGroupData& group_data, FSFloaterGroupTitles* parent) :
|
||||
FSGroupTitlesObserver::FSGroupTitlesObserver(const LLGroupData& group_data, LLHandle<FSFloaterGroupTitles> parent) :
|
||||
LLGroupMgrObserver(group_data.mID),
|
||||
mGroupData(group_data),
|
||||
mParent(parent)
|
||||
|
|
@ -49,9 +51,9 @@ FSGroupTitlesObserver::~FSGroupTitlesObserver()
|
|||
|
||||
void FSGroupTitlesObserver::changed(LLGroupChange gc)
|
||||
{
|
||||
if (mParent)
|
||||
if (!mParent.isDead())
|
||||
{
|
||||
mParent->processGroupTitleResults(mGroupData);
|
||||
mParent.get()->processGroupTitleResults(mGroupData);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -60,7 +62,9 @@ void FSGroupTitlesObserver::changed(LLGroupChange gc)
|
|||
// FSGroupTitles class
|
||||
//
|
||||
FSFloaterGroupTitles::FSFloaterGroupTitles(const LLSD& key) :
|
||||
LLFloater(key)
|
||||
LLFloater(key),
|
||||
mFilterSubString(LLStringUtil::null),
|
||||
mFilterSubStringOrig(LLStringUtil::null)
|
||||
{
|
||||
// Register observer and event listener
|
||||
LLGroupMgr::getInstance()->addObserver(this);
|
||||
|
|
@ -85,20 +89,41 @@ BOOL FSFloaterGroupTitles::postBuild()
|
|||
mRefreshButton = getChild<LLButton>("btnRefresh");
|
||||
mInfoButton = getChild<LLButton>("btnInfo");
|
||||
mTitleList = getChild<LLScrollListCtrl>("title_list");
|
||||
mFilterEditor = getChild<LLFilterEditor>("filter_input");
|
||||
|
||||
mActivateButton->setCommitCallback(boost::bind(&FSFloaterGroupTitles::activateGroupTitle, this));
|
||||
mRefreshButton->setCommitCallback(boost::bind(&FSFloaterGroupTitles::refreshGroupTitles, this));
|
||||
mInfoButton->setCommitCallback(boost::bind(&FSFloaterGroupTitles::openGroupInfo, this));
|
||||
mTitleList->setDoubleClickCallback(boost::bind(&FSFloaterGroupTitles::activateGroupTitle, this));
|
||||
mTitleList->setCommitCallback(boost::bind(&FSFloaterGroupTitles::selectedTitleChanged, this));
|
||||
mFilterEditor->setCommitCallback(boost::bind(&FSFloaterGroupTitles::onFilterEdit, this, _2));
|
||||
|
||||
mTitleList->sortByColumn("title_sort_column", TRUE);
|
||||
mTitleList->setFilterColumn(0);
|
||||
|
||||
refreshGroupTitles();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void FSFloaterGroupTitles::onOpen(const LLSD& key)
|
||||
{
|
||||
LLFloater::onOpen(key);
|
||||
|
||||
mTitleList->setFocus(TRUE);
|
||||
}
|
||||
|
||||
BOOL FSFloaterGroupTitles::handleKeyHere(KEY key, MASK mask)
|
||||
{
|
||||
if (FSCommon::isFilterEditorKeyCombo(key, mask))
|
||||
{
|
||||
mFilterEditor->setFocus(TRUE);
|
||||
return true;
|
||||
}
|
||||
|
||||
return LLFloater::handleKeyHere(key, mask);
|
||||
}
|
||||
|
||||
void FSFloaterGroupTitles::changed(LLGroupChange gc)
|
||||
{
|
||||
switch (gc)
|
||||
|
|
@ -231,7 +256,7 @@ void FSFloaterGroupTitles::refreshGroupTitles()
|
|||
for (std::vector<LLGroupData>::iterator it = gAgent.mGroups.begin(); it != gAgent.mGroups.end(); ++it)
|
||||
{
|
||||
LLGroupData& group_data = *it;
|
||||
FSGroupTitlesObserver* roleObserver = new FSGroupTitlesObserver(group_data, this);
|
||||
FSGroupTitlesObserver* roleObserver = new FSGroupTitlesObserver(group_data, getDerivedHandle<FSFloaterGroupTitles>());
|
||||
mGroupTitleObserverMap[group_data.mID] = roleObserver;
|
||||
LLGroupMgr::getInstance()->sendGroupTitlesRequest(group_data.mID);
|
||||
}
|
||||
|
|
@ -256,3 +281,22 @@ void FSFloaterGroupTitles::openGroupInfo()
|
|||
LLGroupActions::show(group_id);
|
||||
}
|
||||
}
|
||||
|
||||
void FSFloaterGroupTitles::onFilterEdit(const std::string& search_string)
|
||||
{
|
||||
mFilterSubStringOrig = search_string;
|
||||
LLStringUtil::trimHead(mFilterSubStringOrig);
|
||||
// Searches are case-insensitive
|
||||
std::string search_upper = mFilterSubStringOrig;
|
||||
LLStringUtil::toUpper(search_upper);
|
||||
|
||||
if (mFilterSubString == search_upper)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
mFilterSubString = search_upper;
|
||||
|
||||
// Apply new filter.
|
||||
mTitleList->setFilterString(mFilterSubStringOrig);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,20 +33,21 @@
|
|||
#include "llgroupmgr.h"
|
||||
|
||||
class FSFloaterGroupTitles;
|
||||
class LLFilterEditor;
|
||||
class LLScrollListCtrl;
|
||||
|
||||
class FSGroupTitlesObserver : LLGroupMgrObserver
|
||||
{
|
||||
|
||||
public:
|
||||
FSGroupTitlesObserver(const LLGroupData& group_data, FSFloaterGroupTitles* parent);
|
||||
FSGroupTitlesObserver(const LLGroupData& group_data, LLHandle<FSFloaterGroupTitles> parent);
|
||||
virtual ~FSGroupTitlesObserver();
|
||||
|
||||
virtual void changed(LLGroupChange gc);
|
||||
|
||||
protected:
|
||||
FSFloaterGroupTitles* mParent;
|
||||
LLGroupData mGroupData;
|
||||
LLHandle<FSFloaterGroupTitles> mParent;
|
||||
LLGroupData mGroupData;
|
||||
};
|
||||
|
||||
class FSFloaterGroupTitles : public LLFloater, public LLGroupMgrObserver, public LLOldEvents::LLSimpleListener
|
||||
|
|
@ -57,6 +58,9 @@ public:
|
|||
virtual ~FSFloaterGroupTitles();
|
||||
|
||||
/*virtual*/ BOOL postBuild();
|
||||
/*virtual*/ void onOpen(const LLSD& key);
|
||||
/*virtual*/ BOOL handleKeyHere(KEY key, MASK mask);
|
||||
/*virtual*/ bool hasAccelerators() const { return true; }
|
||||
|
||||
virtual void changed(LLGroupChange gc);
|
||||
bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); // called on agent group list changes
|
||||
|
|
@ -73,11 +77,16 @@ private:
|
|||
void activateGroupTitle();
|
||||
void selectedTitleChanged();
|
||||
void openGroupInfo();
|
||||
void onFilterEdit(const std::string& search_string);
|
||||
|
||||
LLButton* mActivateButton;
|
||||
LLButton* mRefreshButton;
|
||||
LLButton* mInfoButton;
|
||||
LLScrollListCtrl* mTitleList;
|
||||
LLFilterEditor* mFilterEditor;
|
||||
|
||||
std::string mFilterSubString;
|
||||
std::string mFilterSubStringOrig;
|
||||
|
||||
typedef std::map<LLUUID, FSGroupTitlesObserver*> observer_map_t;
|
||||
observer_map_t mGroupTitleObserverMap;
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@
|
|||
#include "llpanelplaceprofile.h"
|
||||
#include "llpanellandmarkinfo.h"
|
||||
#include "llparcel.h"
|
||||
#include "llregionhandle.h" // <FS:Beq/> Var region support
|
||||
#include "llteleporthistorystorage.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llviewermessage.h"
|
||||
|
|
@ -355,7 +356,15 @@ void FSFloaterPlaceDetails::onOpen(const LLSD& key)
|
|||
key["z"].asReal());
|
||||
|
||||
mPanelPlaceInfo->setParcelDetailLoadedCallback(boost::bind(&FSFloaterPlaceDetails::processParcelDetails, this, _1));
|
||||
mPanelPlaceInfo->displayParcelInfo(LLUUID(), mGlobalPos);
|
||||
if(key.has("ox"))
|
||||
{
|
||||
auto region_handle = to_region_handle(key["ox"].asInteger(), key["oy"].asInteger());
|
||||
mPanelPlaceInfo->displayParcelInfo(LLUUID(), region_handle, mGlobalPos);
|
||||
}
|
||||
else
|
||||
{
|
||||
mPanelPlaceInfo->displayParcelInfo(LLUUID(), mGlobalPos);
|
||||
}
|
||||
}
|
||||
|
||||
updateVerbs();
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "llcommandhandler.h"
|
||||
#include "lllogininstance.h" // to check if logged in yet
|
||||
#include "llnotifications.h"
|
||||
#include "llnotificationsutil.h"
|
||||
|
|
@ -36,6 +37,7 @@
|
|||
#include "llviewercontrol.h"
|
||||
#include "llsdserialize.h"
|
||||
#include "llsecapi.h"
|
||||
#include "llstartup.h"
|
||||
|
||||
#include "lltrans.h"
|
||||
#include "llweb.h"
|
||||
|
|
@ -48,6 +50,7 @@
|
|||
#include "llstartup.h"
|
||||
|
||||
#include "fscorehttputil.h"
|
||||
#include "fspanellogin.h"
|
||||
#include "lfsimfeaturehandler.h" // <COLOSI opensim multi-currency support />
|
||||
|
||||
void gridDownloadError( LLSD const &aData, LLGridManager* mOwner, GridEntry* mData, LLGridManager::AddState mState )
|
||||
|
|
@ -819,7 +822,6 @@ void LLGridManager::addGrid(GridEntry* grid_entry, AddState state)
|
|||
if (list_changed)
|
||||
{
|
||||
mGridListChangedSignal(true);
|
||||
mGridListChangedSignal.disconnect_all_slots();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -841,7 +843,6 @@ void LLGridManager::addGrid(GridEntry* grid_entry, AddState state)
|
|||
if (FAIL == state)
|
||||
{
|
||||
mGridListChangedSignal(false);
|
||||
mGridListChangedSignal.disconnect_all_slots();
|
||||
}
|
||||
|
||||
if (grid_entry)
|
||||
|
|
@ -1384,10 +1385,6 @@ std::string LLGridManager::getAppSLURLBase(const std::string& grid)
|
|||
{
|
||||
ret = mGridList[grid][GRID_APP_SLURL_BASE].asString();
|
||||
}
|
||||
else if (grid == INWORLDZ_URI)
|
||||
{
|
||||
ret = "inworldz:///app";
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string app_base;
|
||||
|
|
@ -1422,3 +1419,61 @@ std::string LLGridManager::getAppSLURLBase(const std::string& grid)
|
|||
LL_DEBUGS("GridManager") << "App slurl base: " << ret << " - grid = " << grid << LL_ENDL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
class FSGridManagerCommandHandler : public LLCommandHandler
|
||||
{
|
||||
public:
|
||||
// not allowed from outside the app
|
||||
FSGridManagerCommandHandler() : LLCommandHandler("gridmanager", UNTRUSTED_THROTTLE),
|
||||
mDownloadConnection()
|
||||
{ }
|
||||
|
||||
~FSGridManagerCommandHandler()
|
||||
{
|
||||
if (mDownloadConnection.connected())
|
||||
{
|
||||
mDownloadConnection.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web)
|
||||
{
|
||||
if (params.size() < 2)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (params[0].asString() == "addgrid")
|
||||
{
|
||||
std::string login_uri = LLURI::unescape(params[1].asString());
|
||||
mDownloadConnection = LLGridManager::instance().addGridListChangedCallback(boost::bind(&FSGridManagerCommandHandler::handleGridDownloadComplete, this, _1));
|
||||
LLGridManager::instance().addGrid(login_uri);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private:
|
||||
boost::signals2::connection mDownloadConnection;
|
||||
|
||||
void handleGridDownloadComplete(bool success)
|
||||
{
|
||||
if (mDownloadConnection.connected())
|
||||
{
|
||||
mDownloadConnection.disconnect();
|
||||
}
|
||||
|
||||
if (success)
|
||||
{
|
||||
LLGridManager::getInstance()->saveGridList();
|
||||
if (LLStartUp::getStartupState() <= STATE_LOGIN_WAIT)
|
||||
{
|
||||
FSPanelLogin::updateServer();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Creating the object registers with the dispatcher.
|
||||
FSGridManagerCommandHandler gFSGridManagerCommandHandler;
|
||||
|
|
|
|||
|
|
@ -184,7 +184,8 @@ FSPanelLogin::FSPanelLogin(const LLRect &rect,
|
|||
mPasswordLength(0),
|
||||
mLocationLength(0),
|
||||
mShowFavorites(false),
|
||||
mInitialized(false)
|
||||
mInitialized(false),
|
||||
mGridListChangedCallbackConnection()
|
||||
{
|
||||
setBackgroundVisible(FALSE);
|
||||
setBackgroundOpaque(TRUE);
|
||||
|
|
@ -387,6 +388,11 @@ void FSPanelLogin::addFavoritesToStartLocation()
|
|||
|
||||
FSPanelLogin::~FSPanelLogin()
|
||||
{
|
||||
if (mGridListChangedCallbackConnection.connected())
|
||||
{
|
||||
mGridListChangedCallbackConnection.disconnect();
|
||||
}
|
||||
|
||||
FSPanelLogin::sInstance = NULL;
|
||||
|
||||
// Controls having keyboard focus by default
|
||||
|
|
@ -1113,14 +1119,18 @@ void FSPanelLogin::onSelectServer()
|
|||
LLComboBox* server_combo = getChild<LLComboBox>("server_combo");
|
||||
LLSD server_combo_val = server_combo->getSelectedValue();
|
||||
#if OPENSIM && !SINGLEGRID
|
||||
LL_INFOS("AppInit") << "grid "<<(!server_combo_val.isUndefined()?server_combo_val.asString():server_combo->getValue().asString())<< LL_ENDL;
|
||||
LL_INFOS("AppInit") << "grid " << (!server_combo_val.isUndefined() ? server_combo_val.asString() : server_combo->getValue().asString()) << LL_ENDL;
|
||||
if (server_combo_val.isUndefined() && sPendingNewGridURI.empty())
|
||||
{
|
||||
sPendingNewGridURI = server_combo->getValue().asString();
|
||||
LLStringUtil::trim(sPendingNewGridURI);
|
||||
LL_INFOS("AppInit") << "requesting unknown grid "<< sPendingNewGridURI << LL_ENDL;
|
||||
LL_INFOS("AppInit") << "requesting unknown grid " << sPendingNewGridURI << LL_ENDL;
|
||||
// Previously unknown gridname was entered
|
||||
LLGridManager::getInstance()->addGridListChangedCallback(boost::bind(&FSPanelLogin::gridListChanged, this, _1));
|
||||
if (mGridListChangedCallbackConnection.connected())
|
||||
{
|
||||
mGridListChangedCallbackConnection.disconnect();
|
||||
}
|
||||
mGridListChangedCallbackConnection = LLGridManager::getInstance()->addGridListChangedCallback(boost::bind(&FSPanelLogin::gridListChanged, this, _1));
|
||||
LLGridManager::getInstance()->addGrid(sPendingNewGridURI);
|
||||
}
|
||||
else
|
||||
|
|
@ -1452,6 +1462,11 @@ std::string FSPanelLogin::credentialName()
|
|||
|
||||
void FSPanelLogin::gridListChanged(bool success)
|
||||
{
|
||||
if (mGridListChangedCallbackConnection.connected())
|
||||
{
|
||||
mGridListChangedCallbackConnection.disconnect();
|
||||
}
|
||||
|
||||
updateServer();
|
||||
sPendingNewGridURI.clear(); // success or fail we clear the pending URI as we will not get another callback.
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,6 +114,8 @@ private:
|
|||
static std::string credentialName();
|
||||
|
||||
private:
|
||||
boost::signals2::connection mGridListChangedCallbackConnection;
|
||||
|
||||
void updateLoginButtons();
|
||||
|
||||
void (*mCallback)(S32 option, void *userdata);
|
||||
|
|
|
|||
|
|
@ -59,11 +59,6 @@ const char* LLSLURL::SLURL_REGION_PATH = "region";
|
|||
const char* LLSLURL::SIM_LOCATION_HOME = "home";
|
||||
const char* LLSLURL::SIM_LOCATION_LAST = "last";
|
||||
|
||||
// Inworldz special
|
||||
const char* LLSLURL::SLURL_INWORLDZ_SCHEME = "inworldz";
|
||||
const char* LLSLURL::SLURL_IW_SCHEME = "iw";
|
||||
const char* LLSLURL::PLACES_INWORLDZ_COM = "places.inworldz.com";
|
||||
|
||||
// resolve a simstring from a slurl
|
||||
LLSLURL::LLSLURL(const std::string& slurl)
|
||||
: mHypergrid(false)
|
||||
|
|
@ -244,55 +239,6 @@ LLSLURL::LLSLURL(const std::string& slurl)
|
|||
path_array.insert(0, slurl_uri.hostNameAndPort());
|
||||
}
|
||||
}
|
||||
else if (slurl_uri.scheme() == LLSLURL::SLURL_INWORLDZ_SCHEME ||
|
||||
slurl_uri.scheme() == LLSLURL::SLURL_IW_SCHEME)
|
||||
{
|
||||
LL_DEBUGS("SLURL") << "inworldz scheme" << LL_ENDL;
|
||||
|
||||
mGrid = INWORLDZ_URI;
|
||||
|
||||
if (path_array[0].asString() == LLSLURL::SLURL_APP_PATH)
|
||||
{
|
||||
// it's in the form iw://<grid>/(app)
|
||||
// so parse the grid name to derive the grid ID
|
||||
if (!slurl_uri.hostNameAndPort().empty())
|
||||
{
|
||||
LL_DEBUGS("SLURL") << "(inworldz|iw)://<grid>/app" << LL_ENDL;
|
||||
|
||||
mGrid = LLGridManager::getInstance()->getGridByProbing(slurl_uri.hostNameAndPort());
|
||||
if (mGrid.empty())
|
||||
{
|
||||
mGrid = LLGridManager::getInstance()->getGridByProbing(slurl_uri.hostName());
|
||||
}
|
||||
}
|
||||
else if (path_array[0].asString() == LLSLURL::SLURL_APP_PATH)
|
||||
{
|
||||
LL_DEBUGS("SLURL") << "(inworldz|iw):///app" << LL_ENDL;
|
||||
|
||||
// for app style slurls, where no grid name is specified, assume the currently
|
||||
// selected or logged in grid.
|
||||
mGrid = LLGridManager::getInstance()->getGridId();
|
||||
}
|
||||
|
||||
if (mGrid.empty() && LLStartUp::getStartupState() == STATE_STARTED)
|
||||
{
|
||||
// we couldn't find the grid in the grid manager, so bail
|
||||
LL_WARNS("SLURL")<<"unable to find grid"<<LL_ENDL;
|
||||
return;
|
||||
}
|
||||
|
||||
mType = APP;
|
||||
path_array.erase(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
// it wasn't a /inworldz/<region> or /app/<params>, so it must be iw://<region>
|
||||
// therefore the hostname will be the region name, and it's a location type
|
||||
mType = LOCATION;
|
||||
// 'normalize' it so the region name is in fact the head of the path_array
|
||||
path_array.insert(0, slurl_uri.hostName());
|
||||
}
|
||||
}
|
||||
else if((slurl_uri.scheme() == LLSLURL::SLURL_HTTP_SCHEME)
|
||||
|| (slurl_uri.scheme() == LLSLURL::SLURL_HTTPS_SCHEME)
|
||||
|| (slurl_uri.scheme() == LLSLURL::SLURL_X_GRID_LOCATION_INFO_SCHEME)
|
||||
|
|
@ -309,13 +255,6 @@ LLSLURL::LLSLURL(const std::string& slurl)
|
|||
else
|
||||
mGrid = default_grid;
|
||||
}
|
||||
// places.inworldz.com isn't your regular everyday slurl
|
||||
else if (slurl_uri.hostName() == LLSLURL::PLACES_INWORLDZ_COM)
|
||||
{
|
||||
// likewise, places.inworldz.com implies inworldz and a location
|
||||
mGrid = INWORLDZ_URI;
|
||||
mType = LOCATION;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_DEBUGS("SLURL") << "slurl style Standalone" << LL_ENDL;
|
||||
|
|
@ -402,7 +341,7 @@ LLSLURL::LLSLURL(const std::string& slurl)
|
|||
LL_DEBUGS("SLURL") << "It's a location hop" << LL_ENDL;
|
||||
mType = LOCATION;
|
||||
}
|
||||
else if (slurl_uri.hostName() != LLSLURL::PLACES_INWORLDZ_COM)
|
||||
else
|
||||
{
|
||||
LL_DEBUGS("SLURL") << "Not a valid https/http/x-grid-location-info slurl " << slurl << LL_ENDL;
|
||||
// not a valid https/http/x-grid-location-info slurl, so it'll likely just be a URL
|
||||
|
|
@ -530,29 +469,46 @@ LLSLURL::LLSLURL(const std::string& region, const LLVector3& position, bool hype
|
|||
*this = LLSLURL(LLGridManager::getInstance()->getGrid(), region, position);
|
||||
}
|
||||
|
||||
// <FS:Beq pp Oren> FIRE-30768: SLURL's don't work in VarRegions
|
||||
// create a slurl from a global position
|
||||
LLSLURL::LLSLURL(const std::string& grid, const std::string& region, const LLVector3d& global_position, bool hypergrid)
|
||||
: mHypergrid(hypergrid)
|
||||
{
|
||||
//LLSLURL::LLSLURL(const std::string& grid, const std::string& region, const LLVector3d& global_position, bool hypergrid)
|
||||
//: mHypergrid(hypergrid)
|
||||
//{
|
||||
// <FS:CR> Aurora-sim var region teleports
|
||||
//*this = LLSLURL(grid,
|
||||
// region, LLVector3(global_position.mdV[VX],
|
||||
// global_position.mdV[VY],
|
||||
// global_position.mdV[VZ]));
|
||||
S32 x = ll_round( (F32)fmod( (F32)global_position.mdV[VX], (F32)REGION_WIDTH_METERS ) );
|
||||
S32 y = ll_round( (F32)fmod( (F32)global_position.mdV[VY], (F32)REGION_WIDTH_METERS ) );
|
||||
S32 z = ll_round( (F32)global_position.mdV[VZ] );
|
||||
// S32 x = ll_round( (F32)fmod( (F32)global_position.mdV[VX], (F32)REGION_WIDTH_METERS ) );
|
||||
// S32 y = ll_round( (F32)fmod( (F32)global_position.mdV[VY], (F32)REGION_WIDTH_METERS ) );
|
||||
// S32 z = ll_round( (F32)global_position.mdV[VZ] );
|
||||
|
||||
*this = LLSLURL(grid, region, LLVector3(x, y, z));
|
||||
// *this = LLSLURL(grid, region, LLVector3(x, y, z));
|
||||
// </FS:CR>
|
||||
//}
|
||||
//
|
||||
// create a slurl from a global position
|
||||
//LLSLURL::LLSLURL(const std::string& region, const LLVector3d& global_position, bool hypergrid)
|
||||
//: mHypergrid(hypergrid)
|
||||
//{
|
||||
// *this = LLSLURL(LLGridManager::getInstance()->getGrid(), region, global_position);
|
||||
//}
|
||||
|
||||
// create a slurl from a global position
|
||||
LLSLURL::LLSLURL(const std::string& grid, const std::string& region, const LLVector3d& region_origin, const LLVector3d& global_position, bool hypergrid)
|
||||
: mHypergrid(hypergrid)
|
||||
{
|
||||
LLVector3 local_position = LLVector3(global_position - region_origin);
|
||||
*this = LLSLURL(grid, region, local_position);
|
||||
}
|
||||
|
||||
// create a slurl from a global position
|
||||
LLSLURL::LLSLURL(const std::string& region, const LLVector3d& global_position, bool hypergrid)
|
||||
: mHypergrid(hypergrid)
|
||||
LLSLURL::LLSLURL(const std::string& region, const LLVector3d& region_origin, const LLVector3d& global_position, bool hypergrid)
|
||||
: mHypergrid(hypergrid)
|
||||
{
|
||||
*this = LLSLURL(LLGridManager::getInstance()->getGrid(), region, global_position);
|
||||
*this = LLSLURL(LLGridManager::getInstance()->getGrid(), region, region_origin, global_position);
|
||||
}
|
||||
// </FS:Beq pp Oren>
|
||||
|
||||
LLSLURL::LLSLURL(const std::string& command, const LLUUID&id, const std::string& verb)
|
||||
: mHypergrid(false)
|
||||
|
|
|
|||
|
|
@ -52,11 +52,6 @@ public:
|
|||
static const char* SIM_LOCATION_LAST;
|
||||
static const char* SLURL_APP_PATH;
|
||||
static const char* SLURL_REGION_PATH;
|
||||
|
||||
// Inworldz special
|
||||
static const char* SLURL_INWORLDZ_SCHEME;
|
||||
static const char* SLURL_IW_SCHEME;
|
||||
static const char* PLACES_INWORLDZ_COM;
|
||||
|
||||
enum SLURL_TYPE
|
||||
{
|
||||
|
|
@ -73,8 +68,12 @@ public:
|
|||
LLSLURL(const std::string& grid, const std::string& region, bool hypergrid = false);
|
||||
LLSLURL(const std::string& region, const LLVector3& position, bool hypergrid = false);
|
||||
LLSLURL(const std::string& grid, const std::string& region, const LLVector3& position, bool hypergrid = false);
|
||||
LLSLURL(const std::string& grid, const std::string& region, const LLVector3d& global_position, bool hypergrid = false);
|
||||
LLSLURL(const std::string& region, const LLVector3d& global_position, bool hypergrid = false);
|
||||
// <FS:Beq> FIRE-30768: SLURL's don't work in VarRegions (patch from Oren)
|
||||
//LLSLURL(const std::string& region, const LLVector3d& global_position, bool hypergrid = false);
|
||||
//LLSLURL(const std::string& grid, const std::string& region, const LLVector3d& global_position, bool hypergrid = false);
|
||||
LLSLURL(const std::string& grid, const std::string& region, const LLVector3d& region_origin, const LLVector3d& global_position, bool hypergrid = false);
|
||||
LLSLURL(const std::string& region, const LLVector3d& region_origin, const LLVector3d& global_position, bool hypergrid = false);
|
||||
// </FS:Beq>
|
||||
LLSLURL(const std::string& command, const LLUUID&id, const std::string& verb);
|
||||
LLSLURL(const LLSD& path_array, bool from_app);
|
||||
|
||||
|
|
|
|||
|
|
@ -4586,7 +4586,19 @@ bool LLAgent::teleportBridgeLocal(LLVector3& pos_local)
|
|||
|
||||
bool LLAgent::teleportBridgeGlobal(const LLVector3d& pos_global)
|
||||
{
|
||||
U64 region_handle = to_region_handle(pos_global);
|
||||
// <FS:Beq> FIRE-30534 VarRegion fixes
|
||||
// U64 region_handle = to_region_handle(pos_global);
|
||||
U64 region_handle{};
|
||||
auto regionp = getRegion();
|
||||
if(regionp)
|
||||
{
|
||||
region_handle = to_region_handle(pos_global, regionp->getOriginGlobal(), regionp->getWidth());
|
||||
}
|
||||
else
|
||||
{
|
||||
region_handle = to_region_handle(pos_global);
|
||||
}
|
||||
// </FS:Beq>
|
||||
LLVector3 pos_local = (LLVector3)(pos_global - from_region_handle(region_handle));
|
||||
|
||||
return teleportBridgeLocal(pos_local);
|
||||
|
|
@ -5064,23 +5076,83 @@ void LLAgent::doTeleportViaLocation(const LLVector3d& pos_global)
|
|||
{
|
||||
return;
|
||||
}
|
||||
// <FS:Beq> FIRE-30534 Var Region tp / map locaton fixes
|
||||
// U64 handle = to_region_handle(pos_global);
|
||||
// bool isLocal = (regionp->getHandle() == to_region_handle_global((F32)pos_global.mdV[VX], (F32)pos_global.mdV[VY]));
|
||||
// LLSimInfo* info = LLWorldMap::getInstance()->simInfoFromHandle(handle);
|
||||
// if(regionp && info)
|
||||
// {
|
||||
// LLVector3d region_origin = info->getGlobalOrigin();
|
||||
// LLVector3 pos_local(
|
||||
// (F32)(pos_global.mdV[VX] - region_origin.mdV[VX]),
|
||||
// (F32)(pos_global.mdV[VY] - region_origin.mdV[VY]),
|
||||
// (F32)(pos_global.mdV[VZ]));
|
||||
// // <FS:CR> Aurora-sim var region teleports
|
||||
// //teleportRequest(handle, pos_local);
|
||||
// teleportRequest(info->getHandle(), pos_local);
|
||||
// // </FS:CR>
|
||||
// }
|
||||
// else if(regionp && teleportCore(isLocal))
|
||||
// {
|
||||
// // send the message
|
||||
// LLMessageSystem* msg = gMessageSystem;
|
||||
// msg->newMessageFast(_PREHASH_TeleportLocationRequest);
|
||||
// msg->nextBlockFast(_PREHASH_AgentData);
|
||||
// msg->addUUIDFast(_PREHASH_AgentID, getID());
|
||||
// msg->addUUIDFast(_PREHASH_SessionID, getSessionID());
|
||||
|
||||
U64 handle = to_region_handle(pos_global);
|
||||
bool isLocal = (regionp->getHandle() == to_region_handle_global((F32)pos_global.mdV[VX], (F32)pos_global.mdV[VY]));
|
||||
LLSimInfo* info = LLWorldMap::getInstance()->simInfoFromHandle(handle);
|
||||
if(regionp && info)
|
||||
// msg->nextBlockFast(_PREHASH_Info);
|
||||
// // <FS:Ansariel> FIRE-17262: Wrong local teleports on a large opensim region (apparently need to divide by grid unit size)
|
||||
// F32 width = REGION_WIDTH_METERS;// regionp->getWidth();
|
||||
// LLVector3 pos(fmod((F32)pos_global.mdV[VX], width),
|
||||
// fmod((F32)pos_global.mdV[VY], width),
|
||||
// (F32)pos_global.mdV[VZ]);
|
||||
// F32 region_x = (F32)(pos_global.mdV[VX]);
|
||||
// F32 region_y = (F32)(pos_global.mdV[VY]);
|
||||
// U64 region_handle = to_region_handle_global(region_x, region_y);
|
||||
// msg->addU64Fast(_PREHASH_RegionHandle, region_handle);
|
||||
// msg->addVector3Fast(_PREHASH_Position, pos);
|
||||
// pos.mV[VX] += 1;
|
||||
// msg->addVector3Fast(_PREHASH_LookAt, pos);
|
||||
|
||||
// LL_WARNS("Teleport") << "Sending deprecated(?) TeleportLocationRequest."
|
||||
// << " pos_global " << pos_global
|
||||
// << " region_x " << region_x
|
||||
// << " region_y " << region_y
|
||||
// << " region_handle " << region_handle
|
||||
// << LL_ENDL;
|
||||
|
||||
// sendReliableMessage();
|
||||
auto region_origin { regionp->getOriginGlobal() };
|
||||
LLVector3 pos_local{};
|
||||
U64 handle { to_region_handle(pos_global, region_origin, regionp->getWidth()) };
|
||||
bool is_local { regionp->getHandle() == handle };
|
||||
if(is_local)
|
||||
{
|
||||
LLVector3d region_origin = info->getGlobalOrigin();
|
||||
LLVector3 pos_local(
|
||||
pos_local.set(
|
||||
(F32)(pos_global.mdV[VX] - region_origin.mdV[VX]),
|
||||
(F32)(pos_global.mdV[VY] - region_origin.mdV[VY]),
|
||||
(F32)(pos_global.mdV[VZ]));
|
||||
// <FS:CR> Aurora-sim var region teleports
|
||||
//teleportRequest(handle, pos_local);
|
||||
teleportRequest(info->getHandle(), pos_local);
|
||||
// </FS:CR>
|
||||
LL_INFOS("Teleport") << "Local in-region TP:"
|
||||
<< " pos_global " << pos_global
|
||||
<< " region " << region_origin
|
||||
<< " local " << pos_local
|
||||
<< " region_handle " << handle
|
||||
<< LL_ENDL;
|
||||
}
|
||||
else if(regionp && teleportCore(isLocal))
|
||||
else
|
||||
{
|
||||
// determine non-local region location as best we can using global coords
|
||||
// In SL we have uniform region size. This is normal.
|
||||
// In opensim the handle will resolve to a 256m quantised world tile which the server maps back to a region
|
||||
// it "should" also compensate for the local coords. Handle has been "correctly" determined already so we use global % 256
|
||||
static const auto width{LLWorld::getInstance()->getRegionWidthInMeters()};
|
||||
pos_local.set( fmod((F32)pos_global.mdV[VX], width),
|
||||
fmod((F32)pos_global.mdV[VY], width),
|
||||
(F32)pos_global.mdV[VZ] );
|
||||
}
|
||||
|
||||
if(teleportCore(is_local)) // Rather a pointless if as teleportCore currently always returns true
|
||||
{
|
||||
// send the message
|
||||
LLMessageSystem* msg = gMessageSystem;
|
||||
|
|
@ -5090,30 +5162,23 @@ void LLAgent::doTeleportViaLocation(const LLVector3d& pos_global)
|
|||
msg->addUUIDFast(_PREHASH_SessionID, getSessionID());
|
||||
|
||||
msg->nextBlockFast(_PREHASH_Info);
|
||||
// <FS:Ansariel> FIRE-17262: Wrong local teleports on a large opensim region (apparently need to divide by grid unit size)
|
||||
F32 width = REGION_WIDTH_METERS;// regionp->getWidth();
|
||||
LLVector3 pos(fmod((F32)pos_global.mdV[VX], width),
|
||||
fmod((F32)pos_global.mdV[VY], width),
|
||||
(F32)pos_global.mdV[VZ]);
|
||||
F32 region_x = (F32)(pos_global.mdV[VX]);
|
||||
F32 region_y = (F32)(pos_global.mdV[VY]);
|
||||
U64 region_handle = to_region_handle_global(region_x, region_y);
|
||||
msg->addU64Fast(_PREHASH_RegionHandle, region_handle);
|
||||
msg->addVector3Fast(_PREHASH_Position, pos);
|
||||
pos.mV[VX] += 1;
|
||||
msg->addVector3Fast(_PREHASH_LookAt, pos);
|
||||
|
||||
LL_WARNS("Teleport") << "Sending deprecated(?) TeleportLocationRequest."
|
||||
<< " pos_global " << pos_global
|
||||
<< " region_x " << region_x
|
||||
<< " region_y " << region_y
|
||||
<< " region_handle " << region_handle
|
||||
<< LL_ENDL;
|
||||
msg->addU64Fast(_PREHASH_RegionHandle, handle);
|
||||
msg->addVector3Fast(_PREHASH_Position, pos_local);
|
||||
pos_local.mV[VX] += 1;
|
||||
msg->addVector3Fast(_PREHASH_LookAt, pos_local);
|
||||
|
||||
sendReliableMessage();
|
||||
LL_INFOS("Teleport") << "Sending deprecated TeleportLocationRequest."
|
||||
<< " pos_global " << pos_global
|
||||
<< " region coord (" << (pos_global.mdV[VX] - pos_local.mV[VX])
|
||||
<< "," << (pos_global.mdV[VY] - pos_local.mV[VY])
|
||||
<< " pos_local " << pos_local
|
||||
<< ") region_handle " << handle
|
||||
<< LL_ENDL;
|
||||
// </FS:Beq>
|
||||
}
|
||||
// <FS:TT> Client LSL Bridge
|
||||
if (FSLSLBridge::instance().canUseBridge() && isLocal)
|
||||
if (FSLSLBridge::instance().canUseBridge() && is_local)
|
||||
{
|
||||
teleportBridgeGlobal(pos_global);
|
||||
}
|
||||
|
|
@ -5154,6 +5219,37 @@ void LLAgent::teleportViaLocationLookAt(const LLVector3d& pos_global, const LLVe
|
|||
//}
|
||||
|
||||
// [RLVa:KB] - Checked: RLVa-2.0.0
|
||||
// <FS:Beq> FIRE-30534 VarRegion TP fixes
|
||||
// void LLAgent::doTeleportViaLocationLookAt(const LLVector3d& pos_global, const LLVector3& look_at)
|
||||
// {
|
||||
// mbTeleportKeepsLookAt = look_at.isExactlyZero();
|
||||
|
||||
// if(!gAgentCamera.isfollowCamLocked())
|
||||
// {
|
||||
// gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE); // detach camera form avatar, so it keeps direction
|
||||
// }
|
||||
|
||||
// U64 region_handle = to_region_handle(pos_global);
|
||||
// // <FS:CR> Aurora-sim var region teleports
|
||||
// LLSimInfo* simInfo = LLWorldMap::instance().simInfoFromHandle(region_handle);
|
||||
// if (simInfo)
|
||||
// {
|
||||
// region_handle = simInfo->getHandle();
|
||||
// }
|
||||
// // </FS:CR>
|
||||
// LLVector3 pos_local = (LLVector3)(pos_global - from_region_handle(region_handle));
|
||||
// teleportRequest(region_handle, pos_local, look_at);
|
||||
|
||||
// // <FS:TT> Client LSL Bridge
|
||||
// if (FSLSLBridge::instance().canUseBridge())
|
||||
// {
|
||||
// if (region_handle == to_region_handle(getPositionGlobal()))
|
||||
// {
|
||||
// teleportBridgeLocal(pos_local);
|
||||
// }
|
||||
// }
|
||||
// // </FS:TT>
|
||||
// }
|
||||
void LLAgent::doTeleportViaLocationLookAt(const LLVector3d& pos_global, const LLVector3& look_at)
|
||||
{
|
||||
mbTeleportKeepsLookAt = look_at.isExactlyZero();
|
||||
|
|
@ -5163,28 +5259,34 @@ void LLAgent::doTeleportViaLocationLookAt(const LLVector3d& pos_global, const LL
|
|||
gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE); // detach camera form avatar, so it keeps direction
|
||||
}
|
||||
|
||||
U64 region_handle = to_region_handle(pos_global);
|
||||
// <FS:CR> Aurora-sim var region teleports
|
||||
LLSimInfo* simInfo = LLWorldMap::instance().simInfoFromHandle(region_handle);
|
||||
if (simInfo)
|
||||
U64 region_handle{};
|
||||
auto regionp = getRegion();
|
||||
if(regionp)
|
||||
{
|
||||
region_handle = simInfo->getHandle();
|
||||
region_handle = to_region_handle(pos_global, regionp->getOriginGlobal(), regionp->getWidth());
|
||||
}
|
||||
// </FS:CR>
|
||||
LLVector3 pos_local = (LLVector3)(pos_global - from_region_handle(region_handle));
|
||||
teleportRequest(region_handle, pos_local, look_at);
|
||||
else
|
||||
{
|
||||
region_handle = to_region_handle(pos_global);
|
||||
}
|
||||
// Beq Note: if region_handle was obtained to the nearest 256m tile map lookup might give us a better result.
|
||||
|
||||
LLVector3 pos_within_target_region = (LLVector3)(pos_global - from_region_handle(region_handle));
|
||||
teleportRequest(region_handle, pos_within_target_region, look_at);
|
||||
|
||||
// <FS:TT> Client LSL Bridge
|
||||
if (FSLSLBridge::instance().canUseBridge())
|
||||
if ( FSLSLBridge::instance().canUseBridge() )
|
||||
{
|
||||
if (region_handle == to_region_handle(getPositionGlobal()))
|
||||
// refresh regionp
|
||||
regionp = getRegion();
|
||||
if( regionp && ( region_handle == regionp->getHandle() ) )
|
||||
{
|
||||
teleportBridgeLocal(pos_local);
|
||||
teleportBridgeLocal(pos_within_target_region);
|
||||
}
|
||||
}
|
||||
// </FS:TT>
|
||||
}
|
||||
|
||||
// </FS:Beq>
|
||||
LLAgent::ETeleportState LLAgent::getTeleportState() const
|
||||
{
|
||||
return (mTeleportRequest && (mTeleportRequest->getStatus() == LLTeleportRequest::kFailed)) ?
|
||||
|
|
|
|||
|
|
@ -72,7 +72,10 @@ void LLAgentUI::buildSLURL(LLSLURL& slurl, const bool escaped /*= true*/)
|
|||
else
|
||||
#endif
|
||||
// </FS:CR>
|
||||
return_slurl = LLSLURL(regionp->getName(), gAgent.getPositionGlobal());
|
||||
// <FS:Oren> FIRE-30768: SLURL's don't work in VarRegions
|
||||
//return_slurl = LLSLURL(regionp->getName(), gAgent.getPositionGlobal());
|
||||
return_slurl = LLSLURL(regionp->getName(), regionp->getOriginGlobal(), gAgent.getPositionGlobal());
|
||||
// </FS:Oren>
|
||||
}
|
||||
slurl = return_slurl;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,6 +90,7 @@
|
|||
#include "llsdutil_math.h"
|
||||
#include "lllocationhistory.h"
|
||||
#include "llfasttimerview.h"
|
||||
#include "lltelemetry.h"
|
||||
#include "llvector4a.h"
|
||||
#include "llviewermenufile.h"
|
||||
#include "llvoicechannel.h"
|
||||
|
|
@ -285,9 +286,9 @@
|
|||
|
||||
#include "fstelemetry.h" // <FS:Beq> Tracy profiler support
|
||||
|
||||
#if (LL_LINUX || LL_SOLARIS) && LL_GTK
|
||||
#if LL_LINUX && LL_GTK
|
||||
#include "glib.h"
|
||||
#endif // (LL_LINUX || LL_SOLARIS) && LL_GTK
|
||||
#endif // (LL_LINUX) && LL_GTK
|
||||
|
||||
#if LL_MSVC
|
||||
// disable boost::lexical_cast warning
|
||||
|
|
@ -735,6 +736,7 @@ LLAppViewer* LLAppViewer::sInstance = NULL;
|
|||
LLTextureCache* LLAppViewer::sTextureCache = NULL;
|
||||
LLImageDecodeThread* LLAppViewer::sImageDecodeThread = NULL;
|
||||
LLTextureFetch* LLAppViewer::sTextureFetch = NULL;
|
||||
FSPurgeDiskCacheThread* LLAppViewer::sPurgeDiskCacheThread = NULL; // <FS:Ansariel> Regular disk cache cleanup
|
||||
|
||||
std::string getRuntime()
|
||||
{
|
||||
|
|
@ -1288,6 +1290,46 @@ bool LLAppViewer::init()
|
|||
}
|
||||
}
|
||||
|
||||
#if LL_WINDOWS && ADDRESS_SIZE == 64
|
||||
if (gGLManager.mIsIntel)
|
||||
{
|
||||
// Check intel driver's version
|
||||
// Ex: "3.1.0 - Build 8.15.10.2559";
|
||||
std::string version = ll_safe_string((const char *)glGetString(GL_VERSION));
|
||||
|
||||
const boost::regex is_intel_string("[0-9].[0-9].[0-9] - Build [0-9]{1,2}.[0-9]{2}.[0-9]{2}.[0-9]{4}");
|
||||
|
||||
if (boost::regex_search(version, is_intel_string))
|
||||
{
|
||||
// Valid string, extract driver version
|
||||
std::size_t found = version.find("Build ");
|
||||
std::string driver = version.substr(found + 6);
|
||||
S32 v1, v2, v3, v4;
|
||||
S32 count = sscanf(driver.c_str(), "%d.%d.%d.%d", &v1, &v2, &v3, &v4);
|
||||
if (count > 0 && v1 <= 10)
|
||||
{
|
||||
LL_INFOS("AppInit") << "Detected obsolete intel driver: " << driver << LL_ENDL;
|
||||
LLUIString details = LLNotifications::instance().getGlobalString("UnsupportedIntelDriver");
|
||||
std::string gpu_name = ll_safe_string((const char *)glGetString(GL_RENDERER));
|
||||
details.setArg("[VERSION]", driver);
|
||||
details.setArg("[GPUNAME]", gpu_name);
|
||||
S32 button = OSMessageBox(details.getString(),
|
||||
LLStringUtil::null,
|
||||
OSMB_YESNO);
|
||||
if (OSBTN_YES == button && gViewerWindow)
|
||||
{
|
||||
std::string url = LLWeb::escapeURL(LLTrans::getString("IntelDriverPage"));
|
||||
if (gViewerWindow->getWindow())
|
||||
{
|
||||
gViewerWindow->getWindow()->spawnWebBrowser(url, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Obsolete? mExpectedGLVersion is always zero
|
||||
#if LL_WINDOWS
|
||||
if (gGLManager.mGLVersion < LLFeatureManager::getInstance()->getExpectedGLVersion())
|
||||
{
|
||||
|
|
@ -1527,55 +1569,13 @@ void LLAppViewer::initMaxHeapSize()
|
|||
|
||||
//F32 max_heap_size_gb = llmin(1.6f, (F32)gSavedSettings.getF32("MaxHeapSize")) ;
|
||||
F32Gigabytes max_heap_size_gb = (F32Gigabytes)gSavedSettings.getF32("MaxHeapSize") ;
|
||||
BOOL enable_mem_failure_prevention = (BOOL)gSavedSettings.getBOOL("MemoryFailurePreventionEnabled") ;
|
||||
// <FS:Ansariel> Enable low memory checks on 32bit builds
|
||||
#if ADDRESS_SIZE == 64
|
||||
max_heap_size_gb = F32Gigabytes(128);
|
||||
enable_mem_failure_prevention = FALSE;
|
||||
#endif
|
||||
// </FS:Ansariel>
|
||||
|
||||
LLMemory::initMaxHeapSizeGB(max_heap_size_gb, enable_mem_failure_prevention) ;
|
||||
}
|
||||
|
||||
void LLAppViewer::checkMemory()
|
||||
{
|
||||
const static F32 MEMORY_CHECK_INTERVAL = 1.0f ; //second
|
||||
//const static F32 MAX_QUIT_WAIT_TIME = 30.0f ; //seconds
|
||||
//static F32 force_quit_timer = MAX_QUIT_WAIT_TIME + MEMORY_CHECK_INTERVAL ;
|
||||
|
||||
// <FS:Ansariel> Enable low memory checks on 32bit builds
|
||||
//if(!gGLManager.mDebugGPU)
|
||||
//{
|
||||
// return ;
|
||||
//}
|
||||
#if ADDRESS_SIZE == 32
|
||||
static LLCachedControl<bool> mem_failure_prevention(gSavedSettings, "MemoryFailurePreventionEnabled");
|
||||
if (!mem_failure_prevention)
|
||||
#endif
|
||||
{
|
||||
return ;
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
|
||||
if(MEMORY_CHECK_INTERVAL > mMemCheckTimer.getElapsedTimeF32())
|
||||
{
|
||||
return ;
|
||||
}
|
||||
mMemCheckTimer.reset() ;
|
||||
|
||||
//update the availability of memory
|
||||
LLMemory::updateMemoryInfo() ;
|
||||
|
||||
bool is_low = LLMemory::isMemoryPoolLow() ;
|
||||
|
||||
LLPipeline::throttleNewMemoryAllocation(is_low) ;
|
||||
|
||||
if(is_low)
|
||||
{
|
||||
// <FS:Ansariel> Causes spammy log output
|
||||
//LLMemory::logMemoryInfo() ;
|
||||
}
|
||||
LLMemory::initMaxHeapSizeGB(max_heap_size_gb);
|
||||
}
|
||||
|
||||
static LLTrace::BlockTimerStatHandle FTM_MESSAGES("System Messages");
|
||||
|
|
@ -1683,9 +1683,6 @@ bool LLAppViewer::doFrame()
|
|||
//clear call stack records
|
||||
LL_CLEAR_CALLSTACKS();
|
||||
|
||||
//check memory availability information
|
||||
checkMemory() ;
|
||||
|
||||
{
|
||||
// <FS:Ansariel> MaxFPS Viewer-Chui merge error
|
||||
// Check if we need to restore rendering masks.
|
||||
|
|
@ -1882,8 +1879,13 @@ bool LLAppViewer::doFrame()
|
|||
S32 work_pending = 0;
|
||||
S32 io_pending = 0;
|
||||
F32 max_time = llmin(gFrameIntervalSeconds.value() *10.f, 1.f);
|
||||
|
||||
// <FS:Beq> instrument image decodes
|
||||
{
|
||||
FSZoneN("updateTextureThreads");
|
||||
// FSPlot("max_time_ms",max_time);
|
||||
// <FS:Beq/>
|
||||
work_pending += updateTextureThreads(max_time);
|
||||
} // <FS:Beq/> instrument image decodes
|
||||
|
||||
{
|
||||
LL_RECORD_BLOCK_TIME(FTM_LFS);
|
||||
|
|
@ -1967,6 +1969,8 @@ bool LLAppViewer::doFrame()
|
|||
LL_INFOS() << "Exiting main_loop" << LL_ENDL;
|
||||
}
|
||||
FSFrameMark; // <FS:Beq> Tracy support delineate Frame
|
||||
LLPROFILE_UPDATE();
|
||||
|
||||
return ! LLApp::isRunning();
|
||||
}
|
||||
|
||||
|
|
@ -2442,6 +2446,7 @@ bool LLAppViewer::cleanup()
|
|||
sTextureFetch->shutdown();
|
||||
sTextureCache->shutdown();
|
||||
sImageDecodeThread->shutdown();
|
||||
sPurgeDiskCacheThread->shutdown(); // <FS:Ansariel> Regular disk cache cleanup
|
||||
|
||||
sTextureFetch->shutDownTextureCacheThread() ;
|
||||
sTextureFetch->shutDownImageDecodeThread() ;
|
||||
|
|
@ -2464,6 +2469,10 @@ bool LLAppViewer::cleanup()
|
|||
sImageDecodeThread = NULL;
|
||||
delete mFastTimerLogThread;
|
||||
mFastTimerLogThread = NULL;
|
||||
// <FS:Ansariel> Regular disk cache cleanup
|
||||
delete sPurgeDiskCacheThread;
|
||||
sPurgeDiskCacheThread = NULL;
|
||||
// </FS:Ansariel>
|
||||
|
||||
if (LLFastTimerView::sAnalyzePerformance)
|
||||
{
|
||||
|
|
@ -2577,13 +2586,18 @@ bool LLAppViewer::initThreads()
|
|||
|
||||
LLLFSThread::initClass(enable_threads && false);
|
||||
|
||||
//<FS:ND> Image thread pool from CoolVL
|
||||
U32 imageThreads = gSavedSettings.getU32("FSImageDecodeThreads");
|
||||
// </FS:ND>
|
||||
|
||||
// Image decoding
|
||||
LLAppViewer::sImageDecodeThread = new LLImageDecodeThread(enable_threads && true);
|
||||
LLAppViewer::sImageDecodeThread = new LLImageDecodeThread(enable_threads && true, imageThreads);
|
||||
LLAppViewer::sTextureCache = new LLTextureCache(enable_threads && true);
|
||||
LLAppViewer::sTextureFetch = new LLTextureFetch(LLAppViewer::getTextureCache(),
|
||||
sImageDecodeThread,
|
||||
enable_threads && true,
|
||||
app_metrics_qa_mode);
|
||||
LLAppViewer::sPurgeDiskCacheThread = new FSPurgeDiskCacheThread(); // <FS:Ansariel> Regular disk cache cleanup
|
||||
|
||||
if (LLTrace::BlockTimer::sLog || LLTrace::BlockTimer::sMetricLog)
|
||||
{
|
||||
|
|
@ -3818,6 +3832,7 @@ LLSD LLAppViewer::getViewerInfo() const
|
|||
// CPU
|
||||
info["CPU"] = gSysCPU.getCPUString();
|
||||
info["MEMORY_MB"] = LLSD::Integer(gSysMemory.getPhysicalMemoryKB().valueInUnits<LLUnits::Megabytes>());
|
||||
info["CONCURRENCY"] = LLSD::Integer((S32)boost::thread::hardware_concurrency()); // <FS:Beq> Add hardware concurrency to info
|
||||
// Moved hack adjustment to Windows memory size into llsys.cpp
|
||||
info["OS_VERSION"] = LLOSInfo::instance().getOSString();
|
||||
info["GRAPHICS_CARD_VENDOR"] = ll_safe_string((const char*)(glGetString(GL_VENDOR)));
|
||||
|
|
@ -4959,11 +4974,16 @@ bool LLAppViewer::initCache()
|
|||
|
||||
// note that the maximum size of this cache is defined as a percentage of the
|
||||
// total cache size - the 'CacheSize' pref - for all caches.
|
||||
const unsigned int cache_total_size_mb = gSavedSettings.getU32("CacheSize");
|
||||
const double disk_cache_percent = gSavedSettings.getF32("DiskCachePercentOfTotal");
|
||||
const unsigned int disk_cache_mb = cache_total_size_mb * disk_cache_percent / 100;
|
||||
const unsigned int disk_cache_bytes = disk_cache_mb * 1024 * 1024;
|
||||
const bool enable_cache_debug_info = gSavedSettings.getBOOL("EnableCacheDebugInfo");
|
||||
// <FS:Ansariel> Better asset cache size control
|
||||
//const unsigned int cache_total_size_mb = gSavedSettings.getU32("CacheSize");
|
||||
//const double disk_cache_percent = gSavedSettings.getF32("DiskCachePercentOfTotal");
|
||||
//const unsigned int disk_cache_mb = cache_total_size_mb * disk_cache_percent / 100;
|
||||
const unsigned int disk_cache_mb = gSavedSettings.getU32("FSDiskCacheSize");
|
||||
// </FS:Ansariel>
|
||||
// <FS:Ansariel> Fix integer overflow
|
||||
//const unsigned int disk_cache_bytes = disk_cache_mb * 1024 * 1024;
|
||||
const uintmax_t disk_cache_bytes = disk_cache_mb * 1024 * 1024;
|
||||
const bool enable_cache_debug_info = gSavedSettings.getBOOL("EnableDiskCacheDebugInfo");
|
||||
// <FS:Ansariel> Don't ignore cache path for asset cache; Moved further down until cache path has been set correctly
|
||||
//const std::string cache_dir = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, cache_dir_name);
|
||||
//LLDiskCache::initParamSingleton(cache_dir, disk_cache_bytes, enable_cache_debug_info);
|
||||
|
|
@ -5059,6 +5079,8 @@ bool LLAppViewer::initCache()
|
|||
LLDiskCache::getInstance()->purge();
|
||||
}
|
||||
}
|
||||
// <FS:Ansariel> Regular disk cache cleanup
|
||||
LLAppViewer::getPurgeDiskCacheThread()->start();
|
||||
|
||||
// <FS:Ansariel> FIRE-13066
|
||||
if (mPurgeTextures && !read_only)
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue