aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/pipeline.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/pipeline.cpp40
1 files changed, 3 insertions, 37 deletions
diff --git a/linden/indra/newview/pipeline.cpp b/linden/indra/newview/pipeline.cpp
index 758455d..e9faccb 100644
--- a/linden/indra/newview/pipeline.cpp
+++ b/linden/indra/newview/pipeline.cpp
@@ -91,11 +91,11 @@
91#include "llvotree.h" 91#include "llvotree.h"
92#include "llvopartgroup.h" 92#include "llvopartgroup.h"
93#include "llworld.h" 93#include "llworld.h"
94#include "viewer.h"
95#include "llcubemap.h" 94#include "llcubemap.h"
96#include "lldebugmessagebox.h" 95#include "lldebugmessagebox.h"
97#include "llglslshader.h" 96#include "llglslshader.h"
98#include "llviewerjoystick.h" 97#include "llviewerjoystick.h"
98#include "llviewerdisplay.h"
99 99
100#ifdef _DEBUG 100#ifdef _DEBUG
101// Debug indices is disabled for now for debug performance - djs 4/24/02 101// Debug indices is disabled for now for debug performance - djs 4/24/02
@@ -135,6 +135,8 @@ S32 gTrivialAccepts = 0;
135 135
136BOOL gRenderForSelect = FALSE; 136BOOL gRenderForSelect = FALSE;
137 137
138LLPipeline gPipeline;
139
138//---------------------------------------- 140//----------------------------------------
139 141
140void stamp(F32 x, F32 y, F32 xs, F32 ys) 142void stamp(F32 x, F32 y, F32 xs, F32 ys)
@@ -383,22 +385,14 @@ void LLPipeline::releaseGLBuffers()
383 385
384 if (mCubeFrameBuffer) 386 if (mCubeFrameBuffer)
385 { 387 {
386#if !defined(__sparc)
387 glDeleteFramebuffersEXT(1, &mCubeFrameBuffer); 388 glDeleteFramebuffersEXT(1, &mCubeFrameBuffer);
388 glDeleteRenderbuffersEXT(1, &mCubeDepth); 389 glDeleteRenderbuffersEXT(1, &mCubeDepth);
389#else
390#error Can we generalize this without a CPU architecture test?
391#endif
392 mCubeDepth = mCubeFrameBuffer = 0; 390 mCubeDepth = mCubeFrameBuffer = 0;
393 } 391 }
394 392
395 if (mFramebuffer[0]) 393 if (mFramebuffer[0])
396 { 394 {
397#if !defined(__sparc)
398 glDeleteFramebuffersEXT(2, mFramebuffer); 395 glDeleteFramebuffersEXT(2, mFramebuffer);
399#else
400#error Can we generalize this without a CPU architecture test?
401#endif
402 mFramebuffer[0] = mFramebuffer[1] = 0; 396 mFramebuffer[0] = mFramebuffer[1] = 0;
403 } 397 }
404} 398}
@@ -3776,12 +3770,8 @@ void LLPipeline::generateReflectionMap(LLCubeMap* cube_map, LLCamera& cube_cam,
3776 BOOL reattach = FALSE; 3770 BOOL reattach = FALSE;
3777 if (mCubeFrameBuffer == 0) 3771 if (mCubeFrameBuffer == 0)
3778 { 3772 {
3779#if !defined(__sparc)
3780 glGenFramebuffersEXT(1, &mCubeFrameBuffer); 3773 glGenFramebuffersEXT(1, &mCubeFrameBuffer);
3781 glGenRenderbuffersEXT(1, &mCubeDepth); 3774 glGenRenderbuffersEXT(1, &mCubeDepth);
3782#else
3783#error Can we generalize this without a CPU architecture test?
3784#endif
3785 reattach = TRUE; 3775 reattach = TRUE;
3786 } 3776 }
3787 3777
@@ -3852,7 +3842,6 @@ void LLPipeline::generateReflectionMap(LLCubeMap* cube_map, LLCamera& cube_cam,
3852 3842
3853 if (reattach) 3843 if (reattach)
3854 { 3844 {
3855#if !defined(__sparc)
3856 glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, mCubeDepth); 3845 glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, mCubeDepth);
3857 GLint res_x, res_y; 3846 GLint res_x, res_y;
3858 glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT, GL_RENDERBUFFER_WIDTH_EXT, &res_x); 3847 glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT, GL_RENDERBUFFER_WIDTH_EXT, &res_x);
@@ -3864,22 +3853,15 @@ void LLPipeline::generateReflectionMap(LLCubeMap* cube_map, LLCamera& cube_cam,
3864 } 3853 }
3865 3854
3866 glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0); 3855 glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);
3867#else
3868#error Can we generalize this without a CPU architecture test?
3869#endif
3870 } 3856 }
3871 3857
3872 for (S32 i = 0; i < 6; i++) 3858 for (S32 i = 0; i < 6; i++)
3873 { 3859 {
3874#if !defined(__sparc)
3875 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, mCubeFrameBuffer); 3860 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, mCubeFrameBuffer);
3876 glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, 3861 glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
3877 cube_face[i], cube_map->getGLName(), 0); 3862 cube_face[i], cube_map->getGLName(), 0);
3878 glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, 3863 glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
3879 GL_RENDERBUFFER_EXT, mCubeDepth); 3864 GL_RENDERBUFFER_EXT, mCubeDepth);
3880#else
3881#error Can we generalize this without a CPU architecture test?
3882#endif
3883 glMatrixMode(GL_PROJECTION); 3865 glMatrixMode(GL_PROJECTION);
3884 glLoadIdentity(); 3866 glLoadIdentity();
3885 gluPerspective(90.f, 1.f, 0.1f, 1024.f); 3867 gluPerspective(90.f, 1.f, 0.1f, 1024.f);
@@ -3899,11 +3881,7 @@ void LLPipeline::generateReflectionMap(LLCubeMap* cube_map, LLCamera& cube_cam,
3899 gPipeline.renderGeom(cube_cam); 3881 gPipeline.renderGeom(cube_cam);
3900 } 3882 }
3901 3883
3902#if !defined(__sparc)
3903 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); 3884 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
3904#else
3905#error Can we generalize this without a CPU architecture test?
3906#endif
3907 3885
3908 cube_cam.setOrigin(origin); 3886 cube_cam.setOrigin(origin);
3909 gPipeline.resetDrawOrders(); 3887 gPipeline.resetDrawOrders();
@@ -4112,14 +4090,10 @@ void LLPipeline::renderBloom(GLuint source, GLuint dest, GLuint buffer, U32 res,
4112 LLGLDisable blend(GL_BLEND); 4090 LLGLDisable blend(GL_BLEND);
4113 LLGLDisable cull(GL_CULL_FACE); 4091 LLGLDisable cull(GL_CULL_FACE);
4114 4092
4115#if !defined(__sparc)
4116 if (mFramebuffer[0] == 0) 4093 if (mFramebuffer[0] == 0)
4117 { 4094 {
4118 glGenFramebuffersEXT(2, mFramebuffer); 4095 glGenFramebuffersEXT(2, mFramebuffer);
4119 } 4096 }
4120#else
4121#error Can we generalize this without a CPU architecture test?
4122#endif
4123 4097
4124 GLint viewport[4]; 4098 GLint viewport[4];
4125 glGetIntegerv(GL_VIEWPORT, viewport); 4099 glGetIntegerv(GL_VIEWPORT, viewport);
@@ -4142,15 +4116,11 @@ void LLPipeline::renderBloom(GLuint source, GLuint dest, GLuint buffer, U32 res,
4142 4116
4143 for (S32 i = 0; i < kernel; i++) 4117 for (S32 i = 0; i < kernel; i++)
4144 { 4118 {
4145#if !defined(__sparc)
4146 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, mFramebuffer[i%2]); 4119 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, mFramebuffer[i%2]);
4147 glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, 4120 glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,
4148 GL_COLOR_ATTACHMENT0_EXT, 4121 GL_COLOR_ATTACHMENT0_EXT,
4149 GL_TEXTURE_2D, 4122 GL_TEXTURE_2D,
4150 i%2 == 0 ? buffer : dest, 0); 4123 i%2 == 0 ? buffer : dest, 0);
4151#else
4152#error Can we generalize this without a CPU architecture test?
4153#endif
4154 4124
4155 glBindTexture(GL_TEXTURE_2D, i == 0 ? source : 4125 glBindTexture(GL_TEXTURE_2D, i == 0 ? source :
4156 i%2==0 ? dest : 4126 i%2==0 ? dest :
@@ -4177,11 +4147,7 @@ void LLPipeline::renderBloom(GLuint source, GLuint dest, GLuint buffer, U32 res,
4177 4147
4178 } 4148 }
4179 4149
4180#if !defined(__sparc)
4181 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); 4150 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
4182#else
4183#error Can we generalize this without a CPU architecture test?
4184#endif
4185 gGlowProgram.unbind(); 4151 gGlowProgram.unbind();
4186 4152
4187 glViewport(viewport[0], viewport[1], viewport[2], viewport[3]); 4153 glViewport(viewport[0], viewport[1], viewport[2], viewport[3]);