master
Ansariel 2021-10-28 12:47:09 +02:00
commit 02bc150a7f
8 changed files with 45 additions and 83 deletions

View File

@ -273,6 +273,7 @@ Beq Janus
SL-14766
SL-14927
SL-15709
SL-16027
Beth Walcher
Bezilon Kasei
Biancaluce Robbiani

View File

@ -1,53 +0,0 @@
//
// Tracy profiler
// ----------------
//
// For fast integration, compile and
// link with this source file (and none
// other) in your executable (or in the
// main DLL / shared object on multi-DLL
// projects).
//
// Define TRACY_ENABLE to enable profiler.
#include "common/TracySystem.cpp"
#ifdef TRACY_ENABLE
#ifdef LL_WINDOWS
# pragma warning(push, 0)
#endif
#include "common/tracy_lz4.cpp"
#include "client/TracyProfiler.cpp"
#include "client/TracyCallstack.cpp"
#include "client/TracySysTime.cpp"
#include "client/TracySysTrace.cpp"
#include "common/TracySocket.cpp"
#include "client/tracy_rpmalloc.cpp"
#include "client/TracyDxt1.cpp"
#if TRACY_HAS_CALLSTACK == 2 || TRACY_HAS_CALLSTACK == 3 || TRACY_HAS_CALLSTACK == 4 || TRACY_HAS_CALLSTACK == 6
# include "libbacktrace/alloc.cpp"
# include "libbacktrace/dwarf.cpp"
# include "libbacktrace/fileline.cpp"
# include "libbacktrace/mmapio.cpp"
# include "libbacktrace/posix.cpp"
# include "libbacktrace/sort.cpp"
# include "libbacktrace/state.cpp"
# if TRACY_HAS_CALLSTACK == 4
# include "libbacktrace/macho.cpp"
# else
# include "libbacktrace/elf.cpp"
# endif
#endif
#ifdef LL_WINDOWS
# pragma comment(lib, "ws2_32.lib")
# pragma comment(lib, "dbghelp.lib")
# pragma warning(pop)
#endif
#endif

View File

@ -28,8 +28,7 @@
#define LL_LINDEN_COMMON_H
#include "llprofiler.h"
// <FS:Beq/> #if TRACY_ENABLE && !defined(LL_PROFILER_ENABLE_TRACY_OPENGL) // hooks for memory profiling
#if TRACY_ENABLE && LL_PROFILER_ENABLE_TRACY_MEMORY // hooks for memory profiling
#if TRACY_ENABLE // hooks for memory profiling
void *tracy_aligned_malloc(size_t size, size_t alignment);
void tracy_aligned_free(void *memblock);
#define _aligned_malloc(X, Y) tracy_aligned_malloc((X), (Y))

View File

@ -114,7 +114,7 @@ template <typename T> T* LL_NEXT_ALIGNED_ADDRESS_64(T* address)
inline void* ll_aligned_malloc_fallback( size_t size, int align )
{
#if defined(LL_WINDOWS)
return (_aligned_malloc)(size, align); // <FS:Beq/> reinstate parens to avoid the recursive #define (not nice)
return (_aligned_malloc)(size, align);
#else
char* aligned = NULL;
void* mem = malloc( size + (align - 1) + sizeof(void*) );
@ -132,7 +132,7 @@ template <typename T> T* LL_NEXT_ALIGNED_ADDRESS_64(T* address)
inline void ll_aligned_free_fallback( void* ptr )
{
#if defined(LL_WINDOWS)
(_aligned_free)(ptr); // <FS:Beq/> reinstate parens to avoid the recursive #define (not nice)
(_aligned_free)(ptr);
#else
if (ptr)
{

View File

@ -99,11 +99,8 @@ namespace LLProfiler
#define LL_RECORD_BLOCK_TIME(name) const LLTrace::BlockTimer& LL_GLUE_TOKENS(block_time_recorder, __LINE__)(LLTrace::timeThisBlock(name)); (void)LL_GLUE_TOKENS(block_time_recorder, __LINE__);
#define LL_PROFILE_ZONE_NAMED(name) // LL_PROFILE_ZONE_NAMED is a no-op when Tracy is disabled
#define LL_PROFILE_ZONE_NAMED_COLOR(name,color) // LL_RECORD_BLOCK_TIME(name)
#define LL_PROFILE_ZONE_SCOPED // LL_PROFILE_ZONE_SCOPED is a no-op when Tracy is disabled
// <FS:Beq> Fix mismatch across ifdef
// #define LL_PROFILE_ZONE_COLOR(name,color)
#define LL_PROFILE_ZONE_COLOR(color)
// </FS:Beq>
#define LL_PROFILE_ZONE_NUM( val ) (void)( val ); // Not supported
#define LL_PROFILE_ZONE_TEXT( text, size ) (void)( text ); void( size ); // Not supported
@ -112,10 +109,10 @@ namespace LLProfiler
#define LL_PROFILE_ZONE_INFO(name) (void)(name); // Not supported
#define LL_PROFILE_ZONE_WARN(name) (void)(name); // Not supported
// <FS:Beq> Additional FS Tracy macros
#define LL_PROFILE_ZONE_NAMED_COLOR(name,color)
#define LL_PROFILE_PLOT( name, value )
#define LL_PROFILE_PLOT_SQ( name, prev, value )
#define LL_PROFILE_IS_CONNECTED
#define LL_PROFILE_ZONE_COLOR(color)
#define LL_PROFILE_PLOT( name, value )
#define LL_PROFILE_PLOT_SQ( name, prev, value )
#define LL_PROFILE_IS_CONNECTED
// </FS:Beq>
#endif
#if LL_PROFILER_CONFIGURATION == LL_PROFILER_CONFIG_TRACY_FAST_TIMER
@ -143,7 +140,7 @@ namespace LLProfiler
#define LL_PROFILE_ZONE_ERR(name) LL_PROFILE_ZONE_NAMED_COLOR( name, 0XFF0000 ) // RGB yellow
#define LL_PROFILE_ZONE_INFO(name) LL_PROFILE_ZONE_NAMED_COLOR( name, 0X00FFFF ) // RGB cyan
#define LL_PROFILE_ZONE_WARN(name) LL_PROFILE_ZONE_NAMED_COLOR( name, 0x0FFFF00 ) // RGB red
// <FS:Beq> Additional FS Tracy macros
// <FS:Beq> Additional FS Tracy macros
#define LL_PROFILE_ZONE_COLOR(color) ZoneNamedC( ___tracy_scoped_zone, color, LLProfiler::active )
#define LL_PROFILE_PLOT( name, value ) TracyPlot( name, value)
#define LL_PROFILE_PLOT_SQ( name, prev, value ) TracyPlot( name, prev );TracyPlot( name, value )
@ -152,7 +149,28 @@ namespace LLProfiler
#endif
#else
#define LL_PROFILER_FRAME_END
#define LL_PROFILER_SET_THREAD_NAME( name ) (void)(name)
#define LL_PROFILER_SET_THREAD_NAME(name)
#define LL_PROFILER_THREAD_BEGIN(name)
#define LL_PROFILER_THREAD_END(name)
#define LL_RECORD_BLOCK_TIME(name)
#define LL_PROFILE_ZONE_NAMED(name)
#define LL_PROFILE_ZONE_NAMED_COLOR(name,color)
#define LL_PROFILE_ZONE_SCOPED
#define LL_PROFILE_ZONE_NUM(val)
#define LL_PROFILE_ZONE_TEXT(text, size)
#define LL_PROFILE_ZONE_ERR(name)
#define LL_PROFILE_ZONE_INFO(name)
#define LL_PROFILE_ZONE_WARN(name)
// <FS:Ansariel> Additional FS Tracy macros
#define LL_PROFILE_ZONE_COLOR(color)
#define LL_PROFILE_PLOT( name, value )
#define LL_PROFILE_PLOT_SQ( name, prev, value )
#define LL_PROFILE_IS_CONNECTED
// </FS:Ansariel>
#endif // LL_PROFILER
#endif // LL_PROFILER_H

View File

@ -25,7 +25,6 @@
*/
#include "linden_common.h"
#include "fstelemetry.h" // <FS:Beq> add telemetry support.
#include "llimageworker.h"
#include "llimagedxt.h"

View File

@ -1751,8 +1751,6 @@ const S32 max_format = (S32)num_formats - 1;
return FALSE;
}
// LL_PROFILER_GPU_CONTEXT // <FS:Beq/> Move this the other side of the init
if (!gGLManager.initGL())
{
close();
@ -1760,7 +1758,7 @@ const S32 max_format = (S32)num_formats - 1;
return FALSE;
}
LL_PROFILER_GPU_CONTEXT // <FS:Beq/> Tracy context now after the init
LL_PROFILER_GPU_CONTEXT
// Disable vertical sync for swap
if (disable_vsync && wglSwapIntervalEXT)

View File

@ -1051,8 +1051,6 @@ bool LLAppViewer::init()
LLNotifications::instance();
LL_INFOS("InitInfo") << "Notifications initialized." << LL_ENDL ;
writeSystemInfo();
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
@ -1178,6 +1176,9 @@ bool LLAppViewer::init()
initWindow();
LL_INFOS("InitInfo") << "Window is initialized." << LL_ENDL ;
// writeSystemInfo can be called after window is initialized (gViewerWindow non-null)
writeSystemInfo();
// initWindow also initializes the Feature List, so now we can initialize this global.
LLCubeMap::sUseCubeMaps = LLFeatureManager::getInstance()->isFeatureAvailable("RenderCubeMap");
@ -4327,16 +4328,15 @@ void LLAppViewer::writeSystemInfo()
gDebugInfo["FirstLogin"] = LLSD::Boolean(gAgent.isFirstLogin());
gDebugInfo["FirstRunThisInstall"] = gSavedSettings.getBOOL("FirstRunThisInstall");
gDebugInfo["StartupState"] = LLStartUp::getStartupStateString();
// <FS:ND> FIRE-31153, do not use gViewerWindow->getWindow which equals nullptr at this point
//std::vector<std::string> resolutions = gViewerWindow->getWindow()->getDisplaysResolutionList();
std::vector<std::string> resolutions = LLWindow::getDisplaysResolutionList();
// </FS:ND>
for (auto res_iter : resolutions)
{
gDebugInfo["DisplayInfo"].append(res_iter);
}
if (gViewerWindow)
{
std::vector<std::string> resolutions = gViewerWindow->getWindow()->getDisplaysResolutionList();
for (auto res_iter : resolutions)
{
gDebugInfo["DisplayInfo"].append(res_iter);
}
}
writeDebugInfo(); // Save out debug_info.log early, in case of crash.
}