From 2823b0639e6b020cee138563d34c74ad769b0bae Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Thu, 27 Sep 2018 17:35:12 +0300 Subject: [PATCH 1/7] SL-2642 - Better error logging for missing binormals + remove unreachable code --- indra/newview/llvovolume.cpp | 5 ++++- indra/newview/llweb.cpp | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 7d6881f8a8..42dfcac7a6 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4432,7 +4432,10 @@ static LLTrace::BlockTimerStatHandle FTM_REGISTER_FACE("Register Face"); void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, U32 type) { LL_RECORD_BLOCK_TIME(FTM_REGISTER_FACE); - if (type == LLRenderPass::PASS_ALPHA && facep->getTextureEntry()->getMaterialParams().notNull() && !facep->getVertexBuffer()->hasDataType(LLVertexBuffer::TYPE_TANGENT)) + if ( type == LLRenderPass::PASS_ALPHA + && facep->getTextureEntry()->getMaterialParams().notNull() + && !facep->getVertexBuffer()->hasDataType(LLVertexBuffer::TYPE_TANGENT) + && LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_OBJECT) > 1) { LL_WARNS_ONCE("RenderMaterials") << "Oh no! No binormals for this alpha blended face!" << LL_ENDL; } diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp index 768db047a4..61ec02957e 100644 --- a/indra/newview/llweb.cpp +++ b/indra/newview/llweb.cpp @@ -274,6 +274,5 @@ bool LLWeb::useExternalBrowser(const std::string &url) boost::match_results matches; return boost::regex_search(url, matches, pattern); } - return false; #endif } From 6ce18422de822a195813e5daa890000e1556ac03 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Fri, 19 Oct 2018 19:12:08 +0300 Subject: [PATCH 2/7] SL-9766 [Render] [Mac] Alt + left mouse click has severely impaired functions --- indra/llwindow/llwindowmacosx.cpp | 10 ++++------ indra/newview/llviewerwindow.cpp | 7 ++++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 7f6b30bd37..b02b77ffbd 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -1317,9 +1317,8 @@ BOOL LLWindowMacOSX::convertCoords(LLCoordScreen from, LLCoordWindow* to) convertScreenToWindow(mWindow, mouse_point); - float scale_factor = getDeviceScaleFactor(); - to->mX = mouse_point[0] * scale_factor; - to->mY = mouse_point[1] * scale_factor; + to->mX = mouse_point[0]; + to->mY = mouse_point[1]; return TRUE; } @@ -1337,9 +1336,8 @@ BOOL LLWindowMacOSX::convertCoords(LLCoordWindow from, LLCoordScreen *to) convertWindowToScreen(mWindow, mouse_point); - float scale_factor = getDeviceScaleFactor(); - to->mX = mouse_point[0] / scale_factor; - to->mY = mouse_point[1] / scale_factor; + to->mX = mouse_point[0]; + to->mY = mouse_point[1]; return TRUE; } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 36fbd12e92..024d965c6d 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -3016,12 +3016,13 @@ void LLViewerWindow::moveCursorToCenter() S32 x = getWorldViewWidthScaled() / 2; S32 y = getWorldViewHeightScaled() / 2; + F32 scale_factor = mWindow->getDeviceScaleFactor(); + LLUI::setMousePositionScreen(x/scale_factor, y/scale_factor); + //on a forced move, all deltas get zeroed out to prevent jumping mCurrentMousePoint.set(x,y); mLastMousePoint.set(x,y); - mCurrentMouseDelta.set(0,0); - - LLUI::setMousePositionScreen(x, y); + mCurrentMouseDelta.set(0,0); } } From eaeb8605d078846576304028cb46a57081abe113 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Tue, 23 Oct 2018 19:24:03 +0300 Subject: [PATCH 3/7] SL-9774 [Render] dragging active Second Life session to second monitor zooms in making viewer unusable --- indra/llwindow/llopenglview-objc.mm | 8 ++++++++ indra/llwindow/llwindowcallbacks.cpp | 5 +++++ indra/llwindow/llwindowcallbacks.h | 1 + indra/llwindow/llwindowmacosx-objc.h | 1 + indra/llwindow/llwindowmacosx.cpp | 8 ++++++++ indra/newview/llviewerwindow.cpp | 8 ++++++++ indra/newview/llviewerwindow.h | 1 + 7 files changed, 32 insertions(+) diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index de123d80d5..ee05fd5cc9 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -167,6 +167,9 @@ attributedStringInfo getSegments(NSAttributedString *str) [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowDidBecomeKey:) name:NSWindowDidBecomeKeyNotification object:[self window]]; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(windowDidChangeScreen:) name:NSWindowDidChangeScreenNotification + object:[self window]]; NSRect wnd_rect = [[self window] frame]; @@ -206,6 +209,11 @@ attributedStringInfo getSegments(NSAttributedString *str) mModifiers = [NSEvent modifierFlags]; } +-(void)windowDidChangeScreen:(NSNotification *)notification; +{ + callWindowDidChangeScreen(); +} + - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; diff --git a/indra/llwindow/llwindowcallbacks.cpp b/indra/llwindow/llwindowcallbacks.cpp index 7e90ade423..94c725fc7e 100644 --- a/indra/llwindow/llwindowcallbacks.cpp +++ b/indra/llwindow/llwindowcallbacks.cpp @@ -180,6 +180,11 @@ BOOL LLWindowCallbacks::handleDPIChanged(LLWindow *window, F32 ui_scale_factor, return FALSE; } +BOOL LLWindowCallbacks::handleWindowDidChangeScreen(LLWindow *window) +{ + return FALSE; +} + void LLWindowCallbacks::handlePingWatchdog(LLWindow *window, const char * msg) { diff --git a/indra/llwindow/llwindowcallbacks.h b/indra/llwindow/llwindowcallbacks.h index 47d5a18858..4d753024fe 100644 --- a/indra/llwindow/llwindowcallbacks.h +++ b/indra/llwindow/llwindowcallbacks.h @@ -66,6 +66,7 @@ public: virtual BOOL handleTimerEvent(LLWindow *window); virtual BOOL handleDeviceChange(LLWindow *window); virtual BOOL handleDPIChanged(LLWindow *window, F32 ui_scale_factor, S32 window_width, S32 window_height); + virtual BOOL handleWindowDidChangeScreen(LLWindow *window); enum DragNDropAction { DNDA_START_TRACKING = 0,// Start tracking an incoming drag diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h index ef5f803718..743089be6b 100644 --- a/indra/llwindow/llwindowmacosx-objc.h +++ b/indra/llwindow/llwindowmacosx-objc.h @@ -147,6 +147,7 @@ void callWindowFocus(); void callWindowUnfocus(); void callWindowHide(); void callWindowUnhide(); +void callWindowDidChangeScreen(); void callDeltaUpdate(float *delta, unsigned int mask); void callMiddleMouseDown(float *pos, unsigned int mask); void callMiddleMouseUp(float *pos, unsigned int mask); diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index b02b77ffbd..376b8610b5 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -400,6 +400,14 @@ void callWindowUnhide() } } +void callWindowDidChangeScreen() +{ + if ( gWindowImplementation && gWindowImplementation->getCallbacks() ) + { + gWindowImplementation->getCallbacks()->handleWindowDidChangeScreen(gWindowImplementation); + } +} + void callDeltaUpdate(float *delta, MASK mask) { gWindowImplementation->updateMouseDeltas(delta); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 024d965c6d..0a8076173e 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1607,6 +1607,14 @@ BOOL LLViewerWindow::handleDPIChanged(LLWindow *window, F32 ui_scale_factor, S32 } } +BOOL LLViewerWindow::handleWindowDidChangeScreen(LLWindow *window) +{ + LLCoordScreen window_rect; + mWindow->getSize(&window_rect); + reshape(window_rect.mX, window_rect.mY); + return TRUE; +} + void LLViewerWindow::handlePingWatchdog(LLWindow *window, const char * msg) { LLAppViewer::instance()->pingMainloopTimeout(msg); diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index d8d420e6be..83ca18f85d 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -212,6 +212,7 @@ public: /*virtual*/ BOOL handleTimerEvent(LLWindow *window); /*virtual*/ BOOL handleDeviceChange(LLWindow *window); /*virtual*/ BOOL handleDPIChanged(LLWindow *window, F32 ui_scale_factor, S32 window_width, S32 window_height); + /*virtual*/ BOOL handleWindowDidChangeScreen(LLWindow *window); /*virtual*/ void handlePingWatchdog(LLWindow *window, const char * msg); /*virtual*/ void handlePauseWatchdog(LLWindow *window); From f3a42d070ecf27acc51e53d4ca8632c7036459ff Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Wed, 31 Oct 2018 18:11:00 +0200 Subject: [PATCH 4/7] SL-9984 - [Retina] Camera frustum, do not display correctly on "WORLD MAP" window. --- indra/newview/llworldmapview.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 707fe76cef..ca57f4fb97 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -884,8 +884,8 @@ void LLWorldMapView::drawFrustum() // Compute the frustum coordinates. Take the UI scale into account. F32 ui_scale_factor = gSavedSettings.getF32("UIScaleFactor"); - F32 ctr_x = (getLocalRect().getWidth() * 0.5f + sPanX) * ui_scale_factor; - F32 ctr_y = (getLocalRect().getHeight() * 0.5f + sPanY) * ui_scale_factor; + F32 ctr_x = ((getLocalRect().getWidth() * 0.5f + sPanX) * ui_scale_factor) * LLUI::getScaleFactor().mV[VX]; + F32 ctr_y = ((getLocalRect().getHeight() * 0.5f + sPanY) * ui_scale_factor) * LLUI::getScaleFactor().mV[VY]; gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); From fc2cdf62f186784548934b64ac4a559c32146614 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Fri, 2 Nov 2018 16:27:34 +0200 Subject: [PATCH 5/7] SL-9766 [Render] [Mac] Alt + left mouse click has severely impaired functions FIX #2 --- indra/llui/llui.cpp | 10 ++++++---- indra/newview/llviewerwindow.cpp | 3 +-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 770f13c1c3..2e9188a6a8 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -236,9 +236,10 @@ void LLUI::dirtyRect(LLRect rect) //static void LLUI::setMousePositionScreen(S32 x, S32 y) { + F32 dev_scale_factor = LLView::getWindow()->getDeviceScaleFactor(); S32 screen_x, screen_y; - screen_x = ll_round((F32)x * getScaleFactor().mV[VX]); - screen_y = ll_round((F32)y * getScaleFactor().mV[VY]); + screen_x = ll_round(((F32)x * getScaleFactor().mV[VX]) / dev_scale_factor); + screen_y = ll_round(((F32)y * getScaleFactor().mV[VY]) / dev_scale_factor); LLView::getWindow()->setCursorPosition(LLCoordGL(screen_x, screen_y).convert()); } @@ -247,10 +248,11 @@ void LLUI::setMousePositionScreen(S32 x, S32 y) void LLUI::getMousePositionScreen(S32 *x, S32 *y) { LLCoordWindow cursor_pos_window; + F32 dev_scale_factor = LLView::getWindow()->getDeviceScaleFactor(); getWindow()->getCursorPosition(&cursor_pos_window); LLCoordGL cursor_pos_gl(cursor_pos_window.convert()); - *x = ll_round((F32)cursor_pos_gl.mX / getScaleFactor().mV[VX]); - *y = ll_round((F32)cursor_pos_gl.mY / getScaleFactor().mV[VX]); + *x = ll_round(((F32)cursor_pos_gl.mX / getScaleFactor().mV[VX]) * dev_scale_factor); + *y = ll_round(((F32)cursor_pos_gl.mY / getScaleFactor().mV[VX]) * dev_scale_factor); } //static diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 0a8076173e..392a843d6c 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -3024,8 +3024,7 @@ void LLViewerWindow::moveCursorToCenter() S32 x = getWorldViewWidthScaled() / 2; S32 y = getWorldViewHeightScaled() / 2; - F32 scale_factor = mWindow->getDeviceScaleFactor(); - LLUI::setMousePositionScreen(x/scale_factor, y/scale_factor); + LLUI::setMousePositionScreen(x, y); //on a forced move, all deltas get zeroed out to prevent jumping mCurrentMousePoint.set(x,y); From 060a0bc350f279c6023b061255653b575156b009 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 2 Nov 2018 22:36:56 +0100 Subject: [PATCH 6/7] SL-10005 Make set of copied bits (depth and/or stencil) match those present in the source and dest. May avoid driver crash on Intel HD graphics. --- indra/newview/pipeline.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index e541c1054e..e2c379102d 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -2654,9 +2654,12 @@ void LLPipeline::downsampleDepthBuffer(LLRenderTarget& source, LLRenderTarget& d if (scratch_space) { + GLint bits = 0; + bits |= (source.hasStencil() && dest.hasStencil()) ? GL_STENCIL_BUFFER_BIT : 0; + bits |= GL_DEPTH_BUFFER_BIT; scratch_space->copyContents(source, 0, 0, source.getWidth(), source.getHeight(), - 0, 0, scratch_space->getWidth(), scratch_space->getHeight(), GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT, GL_NEAREST); + 0, 0, scratch_space->getWidth(), scratch_space->getHeight(), bits, GL_NEAREST); } dest.bindTarget(); From 755b4a3a6dc6c158f7cfcd6ab8d88b38d3b79fb4 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Thu, 8 Nov 2018 18:33:42 +0200 Subject: [PATCH 7/7] =?UTF-8?q?SL-10019=20-=20[Mac]=20[Render]=20Right-cli?= =?UTF-8?q?ck=20context=20menu=20immediately=20disappears=20when=20clickin?= =?UTF-8?q?g=20any=20place=20in=20the=20=E2=80=98Inventory=E2=80=99=20floa?= =?UTF-8?q?ter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- indra/llui/llmenugl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 0d42f726fa..752d4a27e6 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -3260,7 +3260,8 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y) menu->arrangeAndClear(); LLUI::getMousePositionLocal(menu->getParent(), &mouse_x, &mouse_y); - LLMenuHolderGL::sContextMenuSpawnPos.set(mouse_x,mouse_y); + F32 dev_scale_factor = LLView::getWindow()->getDeviceScaleFactor(); + LLMenuHolderGL::sContextMenuSpawnPos.set(mouse_x/dev_scale_factor, mouse_y/dev_scale_factor); const LLRect menu_region_rect = LLMenuGL::sMenuContainer->getRect();