Remove orphaned VRAM handling code

master
Ansariel 2024-06-17 15:42:06 +02:00 committed by Andrey Lihatskiy
parent 57ade10b70
commit ea83746cda
9 changed files with 12 additions and 60 deletions

View File

@ -409,7 +409,6 @@ LLWindow* LLWindowManager::createWindow(
bool ignore_pixel_depth, bool ignore_pixel_depth,
U32 fsaa_samples, U32 fsaa_samples,
U32 max_cores, U32 max_cores,
U32 max_vram,
F32 max_gl_version) F32 max_gl_version)
{ {
LLWindow* new_window; LLWindow* new_window;
@ -427,11 +426,11 @@ LLWindow* LLWindowManager::createWindow(
#elif LL_WINDOWS #elif LL_WINDOWS
new_window = new LLWindowWin32(callbacks, new_window = new LLWindowWin32(callbacks,
title, name, x, y, width, height, flags, title, name, x, y, width, height, flags,
fullscreen, clearBg, enable_vsync, use_gl, ignore_pixel_depth, fsaa_samples, max_cores, max_vram, max_gl_version); fullscreen, clearBg, enable_vsync, use_gl, ignore_pixel_depth, fsaa_samples, max_cores, max_gl_version);
#elif LL_DARWIN #elif LL_DARWIN
new_window = new LLWindowMacOSX(callbacks, new_window = new LLWindowMacOSX(callbacks,
title, name, x, y, width, height, flags, title, name, x, y, width, height, flags,
fullscreen, clearBg, enable_vsync, use_gl, ignore_pixel_depth, fsaa_samples, max_vram); fullscreen, clearBg, enable_vsync, use_gl, ignore_pixel_depth, fsaa_samples);
#endif #endif
} }
else else

View File

@ -164,8 +164,6 @@ public:
virtual F32 getPixelAspectRatio() = 0; virtual F32 getPixelAspectRatio() = 0;
virtual void setNativeAspectRatio(F32 aspect) = 0; virtual void setNativeAspectRatio(F32 aspect) = 0;
virtual void setMaxVRAMMegabytes(U32 max_vram) = 0;
virtual void beforeDialog() {}; // prepare to put up an OS dialog (if special measures are required, such as in fullscreen mode) virtual void beforeDialog() {}; // prepare to put up an OS dialog (if special measures are required, such as in fullscreen mode)
virtual void afterDialog() {}; // undo whatever was done in beforeDialog() virtual void afterDialog() {}; // undo whatever was done in beforeDialog()
@ -286,14 +284,14 @@ protected:
// Platform-neutral for accessing the platform specific message box // Platform-neutral for accessing the platform specific message box
S32 OSMessageBox(const std::string& text, const std::string& caption, U32 type); S32 OSMessageBox(const std::string& text, const std::string& caption, U32 type);
const U32 OSMB_OK = 0; constexpr U32 OSMB_OK = 0;
const U32 OSMB_OKCANCEL = 1; constexpr U32 OSMB_OKCANCEL = 1;
const U32 OSMB_YESNO = 2; constexpr U32 OSMB_YESNO = 2;
const S32 OSBTN_YES = 0; constexpr S32 OSBTN_YES = 0;
const S32 OSBTN_NO = 1; constexpr S32 OSBTN_NO = 1;
const S32 OSBTN_OK = 2; constexpr S32 OSBTN_OK = 2;
const S32 OSBTN_CANCEL = 3; constexpr S32 OSBTN_CANCEL = 3;
// //
// LLWindowManager // LLWindowManager
@ -313,7 +311,6 @@ public:
bool ignore_pixel_depth = false, bool ignore_pixel_depth = false,
U32 fsaa_samples = 0, U32 fsaa_samples = 0,
U32 max_cores = 0, U32 max_cores = 0,
U32 max_vram = 0,
F32 max_gl_version = 4.6f); F32 max_gl_version = 4.6f);
static bool destroyWindow(LLWindow* window); static bool destroyWindow(LLWindow* window);
static bool isWindowValid(LLWindow *window); static bool isWindowValid(LLWindow *window);
@ -329,6 +326,4 @@ extern const S32 gURLProtocolWhitelistCount;
extern const std::string gURLProtocolWhitelist[]; extern const std::string gURLProtocolWhitelist[];
//extern const std::string gURLProtocolWhitelistHandler[]; //extern const std::string gURLProtocolWhitelistHandler[];
void simpleEscapeString ( std::string& stringIn );
#endif // _LL_window_h_ #endif // _LL_window_h_

View File

@ -101,8 +101,6 @@ public:
/*virtual*/ F32 getPixelAspectRatio() override { return 1.0f; } /*virtual*/ F32 getPixelAspectRatio() override { return 1.0f; }
/*virtual*/ void setNativeAspectRatio(F32 ratio) override {} /*virtual*/ void setNativeAspectRatio(F32 ratio) override {}
void setMaxVRAMMegabytes(U32 max_vram) override {}
/*virtual*/ void *getPlatformWindow() override { return 0; } /*virtual*/ void *getPlatformWindow() override { return 0; }
/*virtual*/ void bringToFront() override {} /*virtual*/ void bringToFront() override {}

View File

@ -122,8 +122,7 @@ LLWindowMacOSX::LLWindowMacOSX(LLWindowCallbacks* callbacks,
bool fullscreen, bool clearBg, bool fullscreen, bool clearBg,
bool enable_vsync, bool use_gl, bool enable_vsync, bool use_gl,
bool ignore_pixel_depth, bool ignore_pixel_depth,
U32 fsaa_samples, U32 fsaa_samples)
U32 max_vram)
: LLWindow(NULL, fullscreen, flags) : LLWindow(NULL, fullscreen, flags)
{ {
// *HACK: During window construction we get lots of OS events for window // *HACK: During window construction we get lots of OS events for window

View File

@ -100,8 +100,6 @@ public:
F32 getPixelAspectRatio() override; F32 getPixelAspectRatio() override;
void setNativeAspectRatio(F32 ratio) override { mOverrideAspectRatio = ratio; } void setNativeAspectRatio(F32 ratio) override { mOverrideAspectRatio = ratio; }
virtual void setMaxVRAMMegabytes(U32 max_vram) override {}
void beforeDialog() override; void beforeDialog() override;
void afterDialog() override; void afterDialog() override;
@ -154,8 +152,7 @@ protected:
const std::string& title, const std::string& name, int x, int y, int width, int height, U32 flags, const std::string& title, const std::string& name, int x, int y, int width, int height, U32 flags,
bool fullscreen, bool clearBg, bool enable_vsync, bool use_gl, bool fullscreen, bool clearBg, bool enable_vsync, bool use_gl,
bool ignore_pixel_depth, bool ignore_pixel_depth,
U32 fsaa_samples, U32 fsaa_samples);
U32 max_vram);
~LLWindowMacOSX(); ~LLWindowMacOSX();
void initCursors(); void initCursors();

View File

@ -404,7 +404,6 @@ struct LLWindowWin32::LLWindowWin32Thread : public LL::ThreadPool
using FuncType = std::function<void()>; using FuncType = std::function<void()>;
// call GetMessage() and pull enqueue messages for later processing // call GetMessage() and pull enqueue messages for later processing
void gatherInput();
HWND mWindowHandleThrd = NULL; HWND mWindowHandleThrd = NULL;
HDC mhDCThrd = 0; HDC mhDCThrd = 0;
@ -412,8 +411,6 @@ struct LLWindowWin32::LLWindowWin32Thread : public LL::ThreadPool
// until after some graphics setup. See SL-20177. -Cosmic,2023-09-18 // until after some graphics setup. See SL-20177. -Cosmic,2023-09-18
bool mGLReady = false; bool mGLReady = false;
bool mGotGLBuffer = false; bool mGotGLBuffer = false;
U32 mMaxVRAM = 0; // maximum amount of vram to allow in the "budget", or 0 for no maximum (see updateVRAMUsage)
}; };
@ -425,7 +422,6 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks,
bool ignore_pixel_depth, bool ignore_pixel_depth,
U32 fsaa_samples, U32 fsaa_samples,
U32 max_cores, U32 max_cores,
U32 max_vram,
F32 max_gl_version) F32 max_gl_version)
: :
LLWindow(callbacks, fullscreen, flags), LLWindow(callbacks, fullscreen, flags),
@ -434,7 +430,6 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks,
{ {
sMainThreadId = LLThread::currentID(); sMainThreadId = LLThread::currentID();
mWindowThread = new LLWindowWin32Thread(); mWindowThread = new LLWindowWin32Thread();
mWindowThread->mMaxVRAM = max_vram;
//MAINT-516 -- force a load of opengl32.dll just in case windows went sideways //MAINT-516 -- force a load of opengl32.dll just in case windows went sideways
LoadLibrary(L"opengl32.dll"); LoadLibrary(L"opengl32.dll");
@ -4545,15 +4540,6 @@ std::vector<std::string> LLWindowWin32::getDynamicFallbackFontList()
// Fonts previously in getFontListSans() have moved to fonts.xml. // Fonts previously in getFontListSans() have moved to fonts.xml.
return std::vector<std::string>(); return std::vector<std::string>();
} }
void LLWindowWin32::setMaxVRAMMegabytes(U32 max_vram)
{
if (mWindowThread)
{
mWindowThread->mMaxVRAM = max_vram;
}
}
#endif // LL_WINDOWS #endif // LL_WINDOWS
inline LLWindowWin32::LLWindowWin32Thread::LLWindowWin32Thread() inline LLWindowWin32::LLWindowWin32Thread::LLWindowWin32Thread()

View File

@ -108,8 +108,6 @@ public:
/*virtual*/ F32 getPixelAspectRatio(); /*virtual*/ F32 getPixelAspectRatio();
/*virtual*/ void setNativeAspectRatio(F32 ratio) { mOverrideAspectRatio = ratio; } /*virtual*/ void setNativeAspectRatio(F32 ratio) { mOverrideAspectRatio = ratio; }
/*virtual*/ void setMaxVRAMMegabytes(U32 max_vram) override;
/*virtual*/ bool dialogColorPicker(F32 *r, F32 *g, F32 *b ); /*virtual*/ bool dialogColorPicker(F32 *r, F32 *g, F32 *b );
/*virtual*/ void *getPlatformWindow(); /*virtual*/ void *getPlatformWindow();
@ -142,11 +140,10 @@ protected:
LLWindowWin32(LLWindowCallbacks* callbacks, LLWindowWin32(LLWindowCallbacks* callbacks,
const std::string& title, const std::string& name, int x, int y, int width, int height, U32 flags, const std::string& title, const std::string& name, int x, int y, int width, int height, U32 flags,
bool fullscreen, bool clearBg, bool enable_vsync, bool use_gl, bool fullscreen, bool clearBg, bool enable_vsync, bool use_gl,
bool ignore_pixel_depth, U32 fsaa_samples, U32 max_cores, U32 max_vram, F32 max_gl_version); bool ignore_pixel_depth, U32 fsaa_samples, U32 max_cores, F32 max_gl_version);
~LLWindowWin32(); ~LLWindowWin32();
void initCursors(); void initCursors();
void initInputDevices();
HCURSOR loadColorCursor(LPCTSTR name); HCURSOR loadColorCursor(LPCTSTR name);
bool isValid(); bool isValid();
void moveWindow(const LLCoordScreen& position,const LLCoordScreen& size); void moveWindow(const LLCoordScreen& position,const LLCoordScreen& size);
@ -163,7 +160,6 @@ protected:
bool shouldPostQuit() { return mPostQuit; } bool shouldPostQuit() { return mPostQuit; }
void fillCompositionForm(const LLRect& bounds, COMPOSITIONFORM *form);
void fillCandidateForm(const LLCoordGL& caret, const LLRect& bounds, CANDIDATEFORM *form); void fillCandidateForm(const LLCoordGL& caret, const LLRect& bounds, CANDIDATEFORM *form);
void fillCharPosition(const LLCoordGL& caret, const LLRect& bounds, const LLRect& control, IMECHARPOSITION *char_position); void fillCharPosition(const LLCoordGL& caret, const LLRect& bounds, const LLRect& control, IMECHARPOSITION *char_position);
void fillCompositionLogfont(LOGFONT *logfont); void fillCompositionLogfont(LOGFONT *logfont);
@ -178,10 +174,8 @@ protected:
// //
bool getClientRectInScreenSpace(RECT* rectp); bool getClientRectInScreenSpace(RECT* rectp);
void updateJoystick( );
static LRESULT CALLBACK mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_param, LPARAM l_param); static LRESULT CALLBACK mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_param, LPARAM l_param);
static bool CALLBACK enumChildWindows(HWND h_wnd, LPARAM l_param);
// //
@ -288,8 +282,6 @@ private:
extern LLW32MsgCallback gAsyncMsgCallback; extern LLW32MsgCallback gAsyncMsgCallback;
extern LPWSTR gIconResource; extern LPWSTR gIconResource;
static void handleMessage( const MSG& msg );
S32 OSMessageBoxWin32(const std::string& text, const std::string& caption, U32 type); S32 OSMessageBoxWin32(const std::string& text, const std::string& caption, U32 type);
#endif //LL_LLWINDOWWIN32_H #endif //LL_LLWINDOWWIN32_H

View File

@ -1867,15 +1867,6 @@ LLViewerWindow::LLViewerWindow(const Params& p)
U32 max_core_count = gSavedSettings.getU32("EmulateCoreCount"); U32 max_core_count = gSavedSettings.getU32("EmulateCoreCount");
F32 max_gl_version = gSavedSettings.getF32("RenderMaxOpenGLVersion"); F32 max_gl_version = gSavedSettings.getF32("RenderMaxOpenGLVersion");
LLControlVariable* vram_control = gSavedSettings.getControl("RenderMaxVRAMBudget");
U32 max_vram = vram_control->getValue().asInteger();
mMaxVRAMControlConnection = vram_control->getSignal()->connect(
[this](LLControlVariable* control, const LLSD& new_val, const LLSD& old_val)
{
if (mWindow) mWindow->setMaxVRAMMegabytes(new_val.asInteger());
});
mWindow = LLWindowManager::createWindow(this, mWindow = LLWindowManager::createWindow(this,
p.title, p.name, p.x, p.y, p.width, p.height, 0, p.title, p.name, p.x, p.y, p.width, p.height, 0,
p.fullscreen, p.fullscreen,
@ -1885,7 +1876,6 @@ LLViewerWindow::LLViewerWindow(const Params& p)
p.ignore_pixel_depth, p.ignore_pixel_depth,
0, 0,
max_core_count, max_core_count,
max_vram,
max_gl_version); //don't use window level anti-aliasing max_gl_version); //don't use window level anti-aliasing
if (NULL == mWindow) if (NULL == mWindow)
@ -2436,8 +2426,6 @@ LLViewerWindow::~LLViewerWindow()
LLViewerShaderMgr::releaseInstance(); LLViewerShaderMgr::releaseInstance();
LLViewerShaderMgr::sInitialized = false; LLViewerShaderMgr::sInitialized = false;
} }
mMaxVRAMControlConnection.disconnect();
} }

View File

@ -550,8 +550,6 @@ private:
// Object temporarily hovered over while dragging // Object temporarily hovered over while dragging
LLPointer<LLViewerObject> mDragHoveredObject; LLPointer<LLViewerObject> mDragHoveredObject;
boost::signals2::connection mMaxVRAMControlConnection;
static LLTrace::SampleStatHandle<> sMouseVelocityStat; static LLTrace::SampleStatHandle<> sMouseVelocityStat;
}; };