summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2011-01-26 17:06:35 -0600
committerDave Parks <davep@lindenlab.com>2011-01-26 17:06:35 -0600
commitfaac42bca702d9b4126c3ca4b5656074dc7846f4 (patch)
treed288d3e14d3f6fa3518d27b497ff99f9756e6e3c
parent714ba52df0397b58769e02ae9a7d9877a4505d34 (diff)
SH-469 Stop using framebuffer objects for hi-res snapshots.
-rw-r--r--indra/newview/llviewerwindow.cpp42
1 files changed, 5 insertions, 37 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 166b110412..1bb45fd494 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -4002,9 +4002,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
S32 window_width = mWindowRectRaw.getWidth();
S32 window_height = mWindowRectRaw.getHeight();
LLRect window_rect = mWindowRectRaw;
- BOOL use_fbo = FALSE;
-
- LLRenderTarget target;
+
F32 scale_factor = 1.0f ;
if(!keep_window_aspect) //image cropping
{
@@ -4017,35 +4015,11 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
{
if(image_width > window_width || image_height > window_height) //need to enlarge the scene
{
- if (!LLPipeline::sRenderDeferred && gGLManager.mHasFramebufferObject && !show_ui)
- {
- GLint max_size = 0;
- glGetIntegerv(GL_MAX_RENDERBUFFER_SIZE_EXT, &max_size);
-
- if (image_width <= max_size && image_height <= max_size) //re-project the scene
- {
- use_fbo = TRUE;
-
- snapshot_width = image_width;
- snapshot_height = image_height;
- target.allocate(snapshot_width, snapshot_height, GL_RGBA, TRUE, TRUE, LLTexUnit::TT_RECT_TEXTURE, TRUE);
- window_width = snapshot_width;
- window_height = snapshot_height;
- scale_factor = 1.f;
- mWindowRectRaw.set(0, snapshot_height, snapshot_width, 0);
- target.bindTarget();
- }
- }
-
- if(!use_fbo) //no re-projection, so tiling the scene
- {
- F32 ratio = llmin( (F32)window_width / image_width , (F32)window_height / image_height) ;
- snapshot_width = (S32)(ratio * image_width) ;
- snapshot_height = (S32)(ratio * image_height) ;
- scale_factor = llmax(1.0f, 1.0f / ratio) ;
- }
+ F32 ratio = llmin( (F32)window_width / image_width , (F32)window_height / image_height) ;
+ snapshot_width = (S32)(ratio * image_width) ;
+ snapshot_height = (S32)(ratio * image_height) ;
+ scale_factor = llmax(1.0f, 1.0f / ratio) ;
}
- //else: keep the current scene scale, re-scale it if necessary after reading out.
}
// if not showing ui, use full window to render world view
@@ -4177,12 +4151,6 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
output_buffer_offset_y += subimage_y_offset;
}
- if (use_fbo)
- {
- mWindowRectRaw = window_rect;
- target.flush();
- glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
- }
gDisplaySwapBuffers = FALSE;
gDepthDirty = TRUE;