diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 7a66ff915676d2facca6d26fcf5320b7983e1e2c..82b23de62c478b15734497f3add41fd520af19fe 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -683,7 +683,7 @@ void LLImageBase::deleteData() U8* LLImageBase::allocateData(S32 size) { //make this function thread-safe. - static const U32 MAX_BUFFER_SIZE = 4096 * 4096 * 16; //256 MB + static const U32 MAX_BUFFER_SIZE = 8192 * 8192 * 16; //1073.74 MB mBadBufferAllocation = false; if (size < 0) diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp index b192cef1d9e7c27f74e6fe7e548d89ba152b4b11..ce86e23f3b228ddf201eab3db050e2962eac52cd 100644 --- a/indra/newview/llsnapshotlivepreview.cpp +++ b/indra/newview/llsnapshotlivepreview.cpp @@ -645,18 +645,19 @@ LLViewerTexture* LLSnapshotLivePreview::getBigThumbnailImage() //static BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview ) { + BOOL success = FALSE; LLSnapshotLivePreview* previewp = (LLSnapshotLivePreview*)snapshot_preview; if (previewp->getWidth() == 0 || previewp->getHeight() == 0) { LL_WARNS("Snapshot") << "Incorrect dimensions: " << previewp->getWidth() << "x" << previewp->getHeight() << LL_ENDL; - return FALSE; + return success; } if (previewp->mSnapshotDelayTimer.getStarted()) // Wait for a snapshot delay timer { if (!previewp->mSnapshotDelayTimer.hasExpired()) { - return FALSE; + return success; } previewp->mSnapshotDelayTimer.stop(); } @@ -664,7 +665,7 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview ) if (LLToolCamera::getInstance()->hasMouseCapture()) // Hide full-screen preview while camming, either don't take snapshots while ALT-zoom active { previewp->setVisible(FALSE); - return FALSE; + return success; } // If we're in freeze-frame and/or auto update mode and camera has moved, update snapshot. @@ -689,9 +690,12 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview ) if (previewp->getSnapshotUpToDate() && previewp->getThumbnailUpToDate()) { - return FALSE; + return success; } + auto last_image = previewp->mFormattedImage; + auto last_preview = previewp->mPreviewImage; + auto last_preview_encoded = previewp->mPreviewImageEncoded; // time to produce a snapshot if(!previewp->getSnapshotUpToDate()) { @@ -710,7 +714,7 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview ) previewp->setImageScaled(FALSE); // grab the raw image - if (gViewerWindow->rawSnapshot( + success = gViewerWindow->rawSnapshot( previewp->mPreviewImage, previewp->getWidth(), previewp->getHeight(), @@ -720,7 +724,8 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview ) gSavedSettings.getBOOL("RenderHUDInSnapshot"), FALSE, previewp->mSnapshotBufferType, - previewp->getMaxImageSize())) + previewp->getMaxImageSize()); + if (success) { // Invalidate/delete any existing encoded image previewp->mPreviewImageEncoded = NULL; @@ -740,26 +745,39 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview ) // We need to update the thumbnail though previewp->setThumbnailImageSize(); - previewp->generateThumbnailImage(TRUE) ; + + previewp->generateThumbnailImage(TRUE) ; + previewp->getWindow()->decBusyCount(); + previewp->setVisible(gSavedSettings.getBOOL("UseFreezeFrame") && previewp->mAllowFullScreenPreview); // only show fullscreen preview when in freeze frame mode + previewp->mSnapshotActive = FALSE; + LL_DEBUGS("Snapshot") << "done creating snapshot" << LL_ENDL; } - previewp->getWindow()->decBusyCount(); - previewp->setVisible(gSavedSettings.getBOOL("UseFreezeFrame") && previewp->mAllowFullScreenPreview); // only show fullscreen preview when in freeze frame mode - previewp->mSnapshotActive = FALSE; - LL_DEBUGS("Snapshot") << "done creating snapshot" << LL_ENDL; + else + { + LL_WARNS() << "Failed creating snapshot" << LL_ENDL; + previewp->mSnapshotDelayTimer.stop(); + + // previewp->setVisible(gSavedSettings.getBOOL("UseFreezeFrame") && previewp->mAllowFullScreenPreview); // only show fullscreen preview when in freeze frame mode + // Restore the old data + previewp->mSnapshotActive = FALSE; + previewp->mThumbnailUpdateLock = FALSE; + previewp->mSnapshotUpToDate = TRUE; + previewp->mThumbnailUpToDate = TRUE; + previewp->mFormattedImage = last_image; + previewp->mPreviewImageEncoded = last_preview; + previewp->mPreviewImageEncoded = last_preview_encoded; + previewp->generateThumbnailImage(FALSE); + previewp->getWindow()->decBusyCount(); + gPipeline.doResetVertexBuffers(true); + } } - - if (!previewp->getThumbnailUpToDate()) - { - previewp->generateThumbnailImage() ; - } - // Tell the floater container that the snapshot is updated now if (previewp->mViewContainer) { previewp->mViewContainer->notify(LLSD().with("snapshot-updated", true)); } - return TRUE; + return success; } void LLSnapshotLivePreview::prepareFreezeFrame() diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index e92e7d34198f0a7d52167cf1b8956f5469a9245d..c0a0e62c66e590fb033775b77b24da33855e347e 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -136,7 +136,7 @@ class LLPickInfo }; -static const U32 MAX_SNAPSHOT_IMAGE_SIZE = 7680; // max snapshot image size 7680 * 7680 UHDTV2 +static const U32 MAX_SNAPSHOT_IMAGE_SIZE = 15360; // Anything bigger would require TBs of (video) RAM and 64bit code class LLViewerWindow final : public LLWindowCallbacks { diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml index bb464d60d98176fa3afd17733a7f8b8b47607925..aa6c6b04250db181159284cfd9fbf9f5c8d9601b 100644 --- a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml +++ b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml @@ -62,18 +62,78 @@ label="800x600" name="800x600" value="[i800,i600]" /> + <combo_box.item + label="720p" + name="1280x720" + value="[i1280,i720]" /> <combo_box.item label="1024x768" name="1024x768" value="[i1024,i768]" /> + <combo_box.item + label="SL Texture (1024x1024)" + name="1024x1024" + value="[i1024,i1024]" /> <combo_box.item label="1280x1024" name="1280x1024" value="[i1280,i1024]" /> + <combo_box.item + label="1080p (16:9)" + name="1920x1080" + value="[i1920,i1080]" /> <combo_box.item label="1600x1200" name="1600x1200" value="[i1600,i1200]" /> + <combo_box.item + label="1080p FHD (21:9)" + name="2560x1080" + value="[i2560,i1080]" /> + <combo_box.item + label="1440p QHD (16:9)" + name="2560x1440" + value="[i2560,i1440]" /> + <combo_box.item + label="1440p WQHD "Ultra-Wide" (21:9)" + name="3440x1440" + value="[i3440,i1440]" /> + <combo_box.item + label="1440p DQHD (32:9)" + name="5120x1440" + value="[i5120,i1440]" /> + <combo_box.item + label="4K (16:9)" + name="3840x2160" + value="[i3840,i2160]" /> + <combo_box.item + label="4K (1.90:1)" + name="4096x2160" + value="[i4096,i2160]" /> + <combo_box.item + label="4K UWD (21:9)" + name="5120x2160" + value="[i5120,i2160]" /> + <combo_box.item + label="4K (4:3)" + name="4096x3072" + value="[i4096,i3072]" /> + <combo_box.item + label="8K (16:9)" + name="7680x4320" + value="[i7680,i4320]" /> + <combo_box.item + label="8K (21:9)" + name="10240x4320" + value="[i10240,i4320]" /> + <combo_box.item + label="Max size (1:1)" + name="15360x15360" + value="[i15360,i15360]" /> + <combo_box.item + label="Max size (16:9)" + name="15360x8640" + value="[i15360,i8640]" /> <combo_box.item label="Custom" name="Custom" @@ -89,7 +149,6 @@ label_width="90" layout="topleft" left="10" - max_val="6016" min_val="32" name="local_snapshot_width" top_pad="7" @@ -104,7 +163,6 @@ label_width="0" layout="topleft" left_pad="0" - max_val="6016" min_val="32" name="local_snapshot_height" top_delta="0" @@ -200,4 +258,4 @@ name="saveas_item" value="save as" /> </flyout_button> -</panel> \ No newline at end of file +</panel>