Skip to content

Commit a877db5

Browse files
committed
Disable SDL splash prompt due to linux video init order fragility and GL context bringup
1 parent 27992f1 commit a877db5

4 files changed

Lines changed: 17 additions & 33 deletions

File tree

indra/llwindow/llsdl.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ bool gSDLMainHandled = false;
4646
#include "llwin32headers.h" // CS_BYTEALIGNCLIENT / CS_OWNDC
4747
#endif
4848

49-
#ifndef LL_SDL_WINDOW
5049
void sdl_logger(void *userdata, int category, SDL_LogPriority priority, const char *message)
5150
{
5251
switch (priority)
@@ -70,8 +69,6 @@ void sdl_logger(void *userdata, int category, SDL_LogPriority priority, const ch
7069
}
7170
}
7271

73-
#endif
74-
7572
void set_sdl_hints()
7673
{
7774
#if LL_SDL_WINDOW

indra/llwindow/llsdl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
extern bool gSDLMainHandled;
3232

33+
void sdl_logger(void *userdata, int category, SDL_LogPriority priority, const char *message);
3334
// Apply our SDL hints. Must run before the *first* SDL_InitSubSystem(SDL_INIT_VIDEO)
3435
// of the process: some hints (notably SDL_HINT_MAC_SCROLL_MOMENTUM and
3536
// SDL_HINT_MAC_PRESS_AND_HOLD) are consumed by SDL's Cocoa registerUserDefaults,

indra/llwindow/llwindowsdl.cpp

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3518,8 +3518,8 @@ void LLWindowSDL::showCursorFromMouseMove()
35183518
//
35193519
namespace
35203520
{
3521-
constexpr int SPLASH_W = 480;
3522-
constexpr int SPLASH_H = 120;
3521+
constexpr int SPLASH_W = 440;
3522+
constexpr int SPLASH_H = 100;
35233523
constexpr float SPLASH_FONT_PT = 18.0f;
35243524
// Inter (variable WOFF2) — FreeType decompresses WOFF2 via brotli, which the
35253525
// viewer's freetype build (shared with SDL3_ttf) enables.
@@ -3544,6 +3544,7 @@ LLSplashScreenSDL::~LLSplashScreenSDL()
35443544

35453545
void LLSplashScreenSDL::showImpl()
35463546
{
3547+
#if 0
35473548
// The splash is shown before createWindow()/init_sdl(), so the video
35483549
// subsystem may not be up yet. SDL_InitSubSystem is reference-counted, so
35493550
// initialising it here is safe; hideImpl() releases exactly this reference,
@@ -3595,11 +3596,12 @@ void LLSplashScreenSDL::showImpl()
35953596
// GL/D3D device on the splash window, which can collide with the main
35963597
// window's OpenGL context initialisation that follows — keep the splash
35973598
// entirely off the GPU.
3598-
SDL_Surface* winsurf = SDL_GetWindowSurface(mWindow);
3599-
if (winsurf)
3600-
{
3601-
mRenderer = SDL_CreateSoftwareRenderer(winsurf);
3602-
}
3599+
SDL_PropertiesID render_props = SDL_CreateProperties();
3600+
SDL_SetStringProperty(render_props, SDL_PROP_RENDERER_CREATE_NAME_STRING, "software");
3601+
SDL_SetPointerProperty(render_props, SDL_PROP_RENDERER_CREATE_WINDOW_POINTER, mWindow);
3602+
mRenderer = SDL_CreateRendererWithProperties(render_props);
3603+
SDL_DestroyProperties(props);
3604+
36033605
if (!mRenderer)
36043606
{
36053607
LL_WARNS() << "Splash: software renderer creation failed: " << SDL_GetError() << LL_ENDL;
@@ -3643,16 +3645,20 @@ void LLSplashScreenSDL::showImpl()
36433645
}
36443646

36453647
render();
3648+
#endif
36463649
}
36473650

36483651
void LLSplashScreenSDL::updateImpl(const std::string& mesg)
36493652
{
3653+
#if 0
36503654
mMessage = mesg;
36513655
render();
3656+
#endif
36523657
}
36533658

36543659
void LLSplashScreenSDL::render()
36553660
{
3661+
#if 0
36563662
if (!mRenderer)
36573663
{
36583664
return;
@@ -3708,10 +3714,12 @@ void LLSplashScreenSDL::render()
37083714
// No SDL event loop is running yet (the splash precedes the main window and
37093715
// SDL_AppIterate), so pump once here to let the window actually composite.
37103716
SDL_PumpEvents();
3717+
#endif
37113718
}
37123719

37133720
void LLSplashScreenSDL::hideImpl()
37143721
{
3722+
#if 0
37153723
if (mIcon)
37163724
{
37173725
SDL_DestroyTexture(mIcon);
@@ -3744,6 +3752,7 @@ void LLSplashScreenSDL::hideImpl()
37443752
SDL_QuitSubSystem(SDL_INIT_VIDEO);
37453753
mInitedVideo = false;
37463754
}
3755+
#endif
37473756
}
37483757

37493758
S32 OSMessageBoxSDL(const std::string& text, const std::string& caption, U32 type)

indra/newview/llappviewersdl.cpp

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -553,29 +553,6 @@ static void exceptionTerminateHandler()
553553
gOldTerminateHandler(); // call old terminate() handler
554554
}
555555

556-
void sdl_logger(void *userdata, int category, SDL_LogPriority priority, const char *message)
557-
{
558-
switch (priority)
559-
{
560-
case SDL_LOG_PRIORITY_TRACE:
561-
case SDL_LOG_PRIORITY_VERBOSE:
562-
case SDL_LOG_PRIORITY_DEBUG:
563-
LL_DEBUGS("SDL") << "log='" << message << "'" << LL_ENDL;
564-
break;
565-
case SDL_LOG_PRIORITY_INFO:
566-
LL_INFOS("SDL") << "log='" << message << "'" << LL_ENDL;
567-
break;
568-
case SDL_LOG_PRIORITY_WARN:
569-
case SDL_LOG_PRIORITY_ERROR:
570-
case SDL_LOG_PRIORITY_CRITICAL:
571-
LL_WARNS("SDL") << "log='" << message << "'" << LL_ENDL;
572-
break;
573-
case SDL_LOG_PRIORITY_INVALID:
574-
default:
575-
break;
576-
}
577-
}
578-
579556
SDL_AppResult SDL_AppInit(void **appstate, int argc, char **argv)
580557
{
581558
#if LL_WINDOWS && LL_VELOPACK

0 commit comments

Comments
 (0)