diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/pipeline.h | 241 |
1 files changed, 118 insertions, 123 deletions
diff --git a/linden/indra/newview/pipeline.h b/linden/indra/newview/pipeline.h index 5d00959..158c420 100644 --- a/linden/indra/newview/pipeline.h +++ b/linden/indra/newview/pipeline.h | |||
@@ -28,7 +28,6 @@ | |||
28 | #ifndef LL_PIPELINE_H | 28 | #ifndef LL_PIPELINE_H |
29 | #define LL_PIPELINE_H | 29 | #define LL_PIPELINE_H |
30 | 30 | ||
31 | #include "llagparray.h" | ||
32 | #include "lldarrayptr.h" | 31 | #include "lldarrayptr.h" |
33 | #include "lldqueueptr.h" | 32 | #include "lldqueueptr.h" |
34 | #include "llstat.h" | 33 | #include "llstat.h" |
@@ -50,8 +49,7 @@ class LLAgent; | |||
50 | class LLDisplayPrimitive; | 49 | class LLDisplayPrimitive; |
51 | class LLTextureEntry; | 50 | class LLTextureEntry; |
52 | class LLRenderFunc; | 51 | class LLRenderFunc; |
53 | class LLAGPMemPool; | 52 | class LLCubeMap; |
54 | class LLAGPMemBlock; | ||
55 | 53 | ||
56 | typedef enum e_avatar_skinning_method | 54 | typedef enum e_avatar_skinning_method |
57 | { | 55 | { |
@@ -62,6 +60,7 @@ typedef enum e_avatar_skinning_method | |||
62 | BOOL compute_min_max(LLMatrix4& box, LLVector2& min, LLVector2& max); // Shouldn't be defined here! | 60 | BOOL compute_min_max(LLMatrix4& box, LLVector2& min, LLVector2& max); // Shouldn't be defined here! |
63 | bool LLRayAABB(const LLVector3 ¢er, const LLVector3 &size, const LLVector3& origin, const LLVector3& dir, LLVector3 &coord, F32 epsilon = 0); | 61 | bool LLRayAABB(const LLVector3 ¢er, const LLVector3 &size, const LLVector3& origin, const LLVector3& dir, LLVector3 &coord, F32 epsilon = 0); |
64 | BOOL LLLineSegmentAABB(const LLVector3& start, const LLVector3& end, const LLVector3& center, const LLVector3& size); | 62 | BOOL LLLineSegmentAABB(const LLVector3& start, const LLVector3& end, const LLVector3& center, const LLVector3& size); |
63 | BOOL setup_hud_matrices(BOOL for_select); | ||
65 | 64 | ||
66 | class LLGLSLShader | 65 | class LLGLSLShader |
67 | { | 66 | { |
@@ -91,7 +90,6 @@ public: | |||
91 | void bind(); | 90 | void bind(); |
92 | void unbind(); | 91 | void unbind(); |
93 | 92 | ||
94 | |||
95 | GLhandleARB mProgramObject; | 93 | GLhandleARB mProgramObject; |
96 | std::vector<GLint> mAttribute; | 94 | std::vector<GLint> mAttribute; |
97 | std::vector<GLint> mUniform; | 95 | std::vector<GLint> mUniform; |
@@ -107,6 +105,11 @@ public: | |||
107 | 105 | ||
108 | void destroyGL(); | 106 | void destroyGL(); |
109 | void restoreGL(); | 107 | void restoreGL(); |
108 | void resetVertexBuffers(); | ||
109 | void resetVertexBuffers(LLDrawable* drawable); | ||
110 | void setUseVBO(BOOL use_vbo); | ||
111 | void generateReflectionMap(LLCubeMap* cube_map, LLCamera& camera, GLsizei res); | ||
112 | void blurReflectionMap(LLCubeMap* cube_in, LLCubeMap* cube_out, U32 res); | ||
110 | 113 | ||
111 | void init(); | 114 | void init(); |
112 | void cleanup(); | 115 | void cleanup(); |
@@ -121,6 +124,7 @@ public: | |||
121 | 124 | ||
122 | /// @brief Figures out draw pool type from texture entry. Creates pool if necessary. | 125 | /// @brief Figures out draw pool type from texture entry. Creates pool if necessary. |
123 | static LLDrawPool* getPoolFromTE(const LLTextureEntry* te, LLViewerImage* te_image); | 126 | static LLDrawPool* getPoolFromTE(const LLTextureEntry* te, LLViewerImage* te_image); |
127 | static U32 getPoolTypeFromTE(const LLTextureEntry* te, LLViewerImage* imagep); | ||
124 | 128 | ||
125 | void addPool(LLDrawPool *poolp); // Only to be used by LLDrawPool classes for splitting pools! | 129 | void addPool(LLDrawPool *poolp); // Only to be used by LLDrawPool classes for splitting pools! |
126 | void removePool( LLDrawPool* poolp ); | 130 | void removePool( LLDrawPool* poolp ); |
@@ -130,28 +134,25 @@ public: | |||
130 | void unlinkDrawable(LLDrawable*); | 134 | void unlinkDrawable(LLDrawable*); |
131 | 135 | ||
132 | // Object related methods | 136 | // Object related methods |
133 | void markVisible(LLDrawable *drawablep); | 137 | void markVisible(LLDrawable *drawablep, LLCamera& camera); |
134 | void doOcclusion(); | 138 | void doOcclusion(LLCamera& camera); |
135 | void markNotCulled(LLDrawable* drawablep, LLCamera& camera); | 139 | void markNotCulled(LLSpatialGroup* group, LLCamera &camera, BOOL active = FALSE); |
136 | void markMoved(LLDrawable *drawablep, BOOL damped_motion = FALSE); | 140 | void markMoved(LLDrawable *drawablep, BOOL damped_motion = FALSE); |
137 | void markShift(LLDrawable *drawablep); | 141 | void markShift(LLDrawable *drawablep); |
138 | void markTextured(LLDrawable *drawablep); | 142 | void markTextured(LLDrawable *drawablep); |
139 | void markMaterialed(LLDrawable *drawablep); | ||
140 | void markRebuild(LLDrawable *drawablep, LLDrawable::EDrawableFlags flag = LLDrawable::REBUILD_ALL, BOOL priority = FALSE); | 143 | void markRebuild(LLDrawable *drawablep, LLDrawable::EDrawableFlags flag = LLDrawable::REBUILD_ALL, BOOL priority = FALSE); |
141 | void markRelight(LLDrawable *drawablep, const BOOL now = FALSE); | 144 | void markRelight(LLDrawable *drawablep, const BOOL now = FALSE); |
142 | 145 | ||
143 | //get the object between start and end that's closest to start. Return the point of collision in collision. | 146 | //get the object between start and end that's closest to start. Return the point of collision in collision. |
144 | LLViewerObject* pickObject(const LLVector3 &start, const LLVector3 &end, LLVector3 &collision); | 147 | LLViewerObject* pickObject(const LLVector3 &start, const LLVector3 &end, LLVector3 &collision); |
145 | 148 | ||
146 | void dirtyPoolObjectTextures(const LLViewerImage *texture); // Something about this texture has changed. Dirty it. | 149 | // Something about these textures has changed. Dirty them. |
150 | void dirtyPoolObjectTextures(const std::set<LLViewerImage*>& textures); | ||
147 | 151 | ||
148 | void resetDrawOrders(); | 152 | void resetDrawOrders(); |
149 | 153 | ||
150 | U32 addObject(LLViewerObject *obj); | 154 | U32 addObject(LLViewerObject *obj); |
151 | 155 | ||
152 | BOOL usingAGP() const; | ||
153 | void setUseAGP(const BOOL use_agp); // Attempt to use AGP; | ||
154 | |||
155 | void enableShadows(const BOOL enable_shadows); | 156 | void enableShadows(const BOOL enable_shadows); |
156 | 157 | ||
157 | // void setLocalLighting(const BOOL local_lighting); | 158 | // void setLocalLighting(const BOOL local_lighting); |
@@ -174,61 +175,42 @@ public: | |||
174 | BOOL validateProgramObject(GLhandleARB obj); | 175 | BOOL validateProgramObject(GLhandleARB obj); |
175 | GLhandleARB loadShader(const LLString& filename, S32 cls, GLenum type); | 176 | GLhandleARB loadShader(const LLString& filename, S32 cls, GLenum type); |
176 | 177 | ||
177 | void setUseOcclusionCulling(BOOL b) { mUseOcclusionCulling = b; } | ||
178 | BOOL getUseOcclusionCulling() const { return mUseOcclusionCulling; } | ||
179 | |||
180 | BOOL initAGP(); | ||
181 | void cleanupAGP(); | ||
182 | LLAGPMemBlock *allocAGPFromPool(const S32 bytes, const U32 target); // Static flag is ignored for now. | ||
183 | void flushAGPMemory(); // Clear all AGP memory blocks (to pack & reduce fragmentation) | ||
184 | |||
185 | // phases | 178 | // phases |
186 | void resetFrameStats(); | 179 | void resetFrameStats(); |
187 | 180 | ||
188 | void updateMoveDampedAsync(LLDrawable* drawablep); | 181 | void updateMoveDampedAsync(LLDrawable* drawablep); |
189 | void updateMoveNormalAsync(LLDrawable* drawablep); | 182 | void updateMoveNormalAsync(LLDrawable* drawablep); |
183 | void updateMovedList(LLDrawable::drawable_vector_t& move_list); | ||
190 | void updateMove(); | 184 | void updateMove(); |
191 | void updateCull(); | 185 | void updateCull(LLCamera& camera); |
192 | void updateGeom(F32 max_dtime); | 186 | void updateGeom(F32 max_dtime); |
193 | 187 | ||
194 | void stateSort(); | 188 | //calculate pixel area of given box from vantage point of given camera |
189 | static F32 calcPixelArea(LLVector3 center, LLVector3 size, LLCamera& camera); | ||
195 | 190 | ||
196 | void renderGeom(); | 191 | void stateSort(LLCamera& camera); |
192 | void stateSort(LLSpatialGroup* group, LLCamera& camera); | ||
193 | void stateSort(LLSpatialBridge* bridge, LLCamera& camera); | ||
194 | void stateSort(LLDrawable* drawablep, LLCamera& camera); | ||
195 | void postSort(LLCamera& camera); | ||
196 | void forAllDrawables(LLSpatialGroup::sg_vector_t& groups, void (*func)(LLDrawable*)); | ||
197 | void forAllVisibleDrawables(void (*func)(LLDrawable*)); | ||
198 | static void highlightPhysical(LLDrawable* drawablep); | ||
199 | |||
200 | void renderObjects(U32 type, U32 mask, BOOL texture = TRUE); | ||
201 | |||
202 | void renderGeom(LLCamera& camera); | ||
197 | void renderHighlights(); | 203 | void renderHighlights(); |
198 | void renderDebug(); | 204 | void renderDebug(); |
205 | void processOcclusion(LLCamera& camera); | ||
199 | 206 | ||
200 | void renderForSelect(); | 207 | void renderForSelect(std::set<LLViewerObject*>& objects); |
201 | void renderFaceForUVSelect(LLFace* facep); | 208 | void renderFaceForUVSelect(LLFace* facep); |
202 | void rebuildPools(); // Rebuild pools | 209 | void rebuildPools(); // Rebuild pools |
203 | 210 | ||
204 | // bindAGP and unbindAGP are used to bind AGP memory. | ||
205 | // AGP should never be bound if you're writing/copying data to AGP. | ||
206 | // bindAGP will do the correct thing if AGP rendering has been disabled globally. | ||
207 | void bindAGP(); | ||
208 | void unbindAGP(); | ||
209 | inline BOOL isAGPBound() const { return mAGPBound; } | ||
210 | |||
211 | void setupVisibility(); | ||
212 | void computeVisibility(); | ||
213 | |||
214 | LLViewerObject *nearestObjectAt(F32 yaw, F32 pitch); // CCW yaw from +X = 0 radians, pitch down from +Y = 0 radians, NULL if no object | ||
215 | |||
216 | void displayPools(); | ||
217 | void displayAGP(); | ||
218 | void displayMap(); | ||
219 | void displaySSBB(); | ||
220 | void displayQueues(); | ||
221 | void printPools(); | ||
222 | |||
223 | void findReferences(LLDrawable *drawablep); // Find the lists which have references to this object | 211 | void findReferences(LLDrawable *drawablep); // Find the lists which have references to this object |
224 | BOOL verify(); // Verify that all data in the pipeline is "correct" | 212 | BOOL verify(); // Verify that all data in the pipeline is "correct" |
225 | 213 | ||
226 | // just the AGP part | ||
227 | S32 getAGPMemUsage(); | ||
228 | |||
229 | // all pools | ||
230 | S32 getMemUsage(const BOOL print = FALSE); | ||
231 | |||
232 | S32 getVisibleCount() const { return mVisibleList.size(); } | 214 | S32 getVisibleCount() const { return mVisibleList.size(); } |
233 | S32 getLightCount() const { return mLights.size(); } | 215 | S32 getLightCount() const { return mLights.size(); } |
234 | 216 | ||
@@ -253,18 +235,15 @@ public: | |||
253 | BOOL hasRenderDebugFeatureMask(const U32 mask) const { return (mRenderDebugFeatureMask & mask) ? TRUE : FALSE; } | 235 | BOOL hasRenderDebugFeatureMask(const U32 mask) const { return (mRenderDebugFeatureMask & mask) ? TRUE : FALSE; } |
254 | BOOL hasRenderFeatureMask(const U32 mask) const { return (mRenderFeatureMask & mask) ? TRUE : FALSE; } | 236 | BOOL hasRenderFeatureMask(const U32 mask) const { return (mRenderFeatureMask & mask) ? TRUE : FALSE; } |
255 | BOOL hasRenderDebugMask(const U32 mask) const { return (mRenderDebugMask & mask) ? TRUE : FALSE; } | 237 | BOOL hasRenderDebugMask(const U32 mask) const { return (mRenderDebugMask & mask) ? TRUE : FALSE; } |
256 | 238 | void setRenderTypeMask(const U32 mask) { mRenderTypeMask = mask; } | |
257 | // Vertex buffer stuff? | 239 | U32 getRenderTypeMask() const { return mRenderTypeMask; } |
258 | U8* bufferGetScratchMemory(void); | 240 | static void toggleRenderType(U32 type); |
259 | void bufferWaitFence(void); | ||
260 | void bufferSendFence(void); | ||
261 | void bufferRotate(void); | ||
262 | 241 | ||
263 | // For UI control of render features | 242 | // For UI control of render features |
264 | static void toggleRenderType(void* data); | 243 | static BOOL hasRenderTypeControl(void* data); |
265 | static void toggleRenderDebug(void* data); | 244 | static void toggleRenderDebug(void* data); |
266 | static void toggleRenderDebugFeature(void* data); | 245 | static void toggleRenderDebugFeature(void* data); |
267 | static BOOL toggleRenderTypeControl(void* data); | 246 | static void toggleRenderTypeControl(void* data); |
268 | static BOOL toggleRenderTypeControlNegated(void* data); | 247 | static BOOL toggleRenderTypeControlNegated(void* data); |
269 | static BOOL toggleRenderDebugControl(void* data); | 248 | static BOOL toggleRenderDebugControl(void* data); |
270 | static BOOL toggleRenderDebugFeatureControl(void* data); | 249 | static BOOL toggleRenderDebugFeatureControl(void* data); |
@@ -314,20 +293,17 @@ public: | |||
314 | RENDER_TYPE_GROUND = LLDrawPool::POOL_GROUND, | 293 | RENDER_TYPE_GROUND = LLDrawPool::POOL_GROUND, |
315 | RENDER_TYPE_TERRAIN = LLDrawPool::POOL_TERRAIN, | 294 | RENDER_TYPE_TERRAIN = LLDrawPool::POOL_TERRAIN, |
316 | RENDER_TYPE_SIMPLE = LLDrawPool::POOL_SIMPLE, | 295 | RENDER_TYPE_SIMPLE = LLDrawPool::POOL_SIMPLE, |
317 | RENDER_TYPE_MEDIA = LLDrawPool::POOL_MEDIA, | ||
318 | RENDER_TYPE_BUMP = LLDrawPool::POOL_BUMP, | 296 | RENDER_TYPE_BUMP = LLDrawPool::POOL_BUMP, |
319 | RENDER_TYPE_AVATAR = LLDrawPool::POOL_AVATAR, | 297 | RENDER_TYPE_AVATAR = LLDrawPool::POOL_AVATAR, |
320 | RENDER_TYPE_TREE = LLDrawPool::POOL_TREE, | 298 | RENDER_TYPE_TREE = LLDrawPool::POOL_TREE, |
321 | RENDER_TYPE_TREE_NEW = LLDrawPool::POOL_TREE_NEW, | ||
322 | RENDER_TYPE_WATER = LLDrawPool::POOL_WATER, | 299 | RENDER_TYPE_WATER = LLDrawPool::POOL_WATER, |
323 | RENDER_TYPE_CLOUDS = LLDrawPool::POOL_CLOUDS, | ||
324 | RENDER_TYPE_ALPHA = LLDrawPool::POOL_ALPHA, | 300 | RENDER_TYPE_ALPHA = LLDrawPool::POOL_ALPHA, |
325 | RENDER_TYPE_HUD = LLDrawPool::POOL_HUD, | ||
326 | |||
327 | // Following are object types (only used in drawable mRenderType) | 301 | // Following are object types (only used in drawable mRenderType) |
302 | RENDER_TYPE_HUD = LLDrawPool::NUM_POOL_TYPES, | ||
328 | RENDER_TYPE_VOLUME, | 303 | RENDER_TYPE_VOLUME, |
329 | RENDER_TYPE_GRASS, | 304 | RENDER_TYPE_GRASS, |
330 | RENDER_TYPE_PARTICLES, | 305 | RENDER_TYPE_PARTICLES, |
306 | RENDER_TYPE_CLOUDS, | ||
331 | }; | 307 | }; |
332 | 308 | ||
333 | enum LLRenderDebugFeatureMask | 309 | enum LLRenderDebugFeatureMask |
@@ -341,13 +317,12 @@ public: | |||
341 | RENDER_DEBUG_FEATURE_FOG = 0x0020, | 317 | RENDER_DEBUG_FEATURE_FOG = 0x0020, |
342 | RENDER_DEBUG_FEATURE_PALETTE = 0x0040, | 318 | RENDER_DEBUG_FEATURE_PALETTE = 0x0040, |
343 | RENDER_DEBUG_FEATURE_FR_INFO = 0x0080, | 319 | RENDER_DEBUG_FEATURE_FR_INFO = 0x0080, |
344 | RENDER_DEBUG_FEATURE_CHAIN_FACES = 0x0100 | 320 | RENDER_DEBUG_FEATURE_FOOT_SHADOWS = 0x0100, |
345 | }; | 321 | }; |
346 | 322 | ||
347 | enum LLRenderFeatureMask | 323 | enum LLRenderFeatureMask |
348 | { | 324 | { |
349 | RENDER_FEATURE_AGP = 0x01, | 325 | RENDER_FEATURE_LOCAL_LIGHTING = 0x02, |
350 | // RENDER_FEATURE_LOCAL_LIGHTING = 0x02, | ||
351 | RENDER_FEATURE_OBJECT_BUMP = 0x04, | 326 | RENDER_FEATURE_OBJECT_BUMP = 0x04, |
352 | RENDER_FEATURE_AVATAR_BUMP = 0x08, | 327 | RENDER_FEATURE_AVATAR_BUMP = 0x08, |
353 | // RENDER_FEATURE_SHADOWS = 0x10, | 328 | // RENDER_FEATURE_SHADOWS = 0x10, |
@@ -356,26 +331,46 @@ public: | |||
356 | 331 | ||
357 | enum LLRenderDebugMask | 332 | enum LLRenderDebugMask |
358 | { | 333 | { |
359 | RENDER_DEBUG_LIGHT_TRACE = 0x0001, | 334 | RENDER_DEBUG_LIGHT_TRACE = 0x00001, |
360 | RENDER_DEBUG_POOLS = 0x0002, | 335 | RENDER_DEBUG_COMPOSITION = 0x00020, |
361 | RENDER_DEBUG_MAP = 0x0004, | 336 | RENDER_DEBUG_VERIFY = 0x00080, |
362 | RENDER_DEBUG_AGP_MEM = 0x0008, | 337 | RENDER_DEBUG_SHADOW_MAP = 0x00100, |
363 | RENDER_DEBUG_QUEUES = 0x0010, | 338 | RENDER_DEBUG_BBOXES = 0x00200, |
364 | RENDER_DEBUG_COMPOSITION = 0x0020, | 339 | RENDER_DEBUG_OCTREE = 0x00400, |
365 | RENDER_DEBUG_SSBB = 0x0040, | 340 | RENDER_DEBUG_PICKING = 0x00800, |
366 | RENDER_DEBUG_VERIFY = 0x0080, | 341 | RENDER_DEBUG_OCCLUSION = 0x01000, |
367 | RENDER_DEBUG_SHADOW_MAP = 0x0100, | 342 | RENDER_DEBUG_POINTS = 0x02000, |
368 | RENDER_DEBUG_BBOXES = 0x0200, | 343 | RENDER_DEBUG_TEXTURE_PRIORITY = 0x04000, |
369 | RENDER_DEBUG_OCTREE = 0x0400, | 344 | RENDER_DEBUG_TEXTURE_AREA = 0x08000, |
370 | RENDER_DEBUG_FACE_CHAINS = 0x0800, | 345 | RENDER_DEBUG_FACE_AREA = 0x10000, |
371 | RENDER_DEBUG_OCCLUSION = 0x1000, | 346 | RENDER_DEBUG_PARTICLES = 0x20000, |
372 | RENDER_DEBUG_POINTS = 0x2000, | 347 | RENDER_DEBUG_TEXTURE_ANIM = 0x40000, |
373 | RENDER_DEBUG_TEXTURE_PRIORITY = 0x4000, | ||
374 | }; | 348 | }; |
375 | 349 | ||
376 | LLPointer<LLViewerImage> mAlphaSizzleImagep; | 350 | LLPointer<LLViewerImage> mAlphaSizzleImagep; |
377 | 351 | ||
378 | LLSpatialPartition *mObjectPartition; | 352 | //MUST MATCH THE ORDER OF DECLARATION IN LLPipeline::init() |
353 | typedef enum | ||
354 | { | ||
355 | PARTITION_VOLUME = 0, | ||
356 | PARTITION_BRIDGE, | ||
357 | PARTITION_HUD, | ||
358 | PARTITION_TERRAIN, | ||
359 | PARTITION_WATER, | ||
360 | PARTITION_TREE, | ||
361 | PARTITION_PARTICLE, | ||
362 | PARTITION_CLOUD, | ||
363 | PARTITION_GRASS, | ||
364 | PARTITION_NONE, | ||
365 | NUM_PARTITIONS | ||
366 | } eObjectPartitions; | ||
367 | |||
368 | private: | ||
369 | std::vector<LLSpatialPartition*> mObjectPartition; | ||
370 | public: | ||
371 | |||
372 | LLSpatialPartition* getSpatialPartition(LLViewerObject* vobj); | ||
373 | LLSpatialPartition* getSpatialPartition(U32 index); | ||
379 | 374 | ||
380 | BOOL mBackfaceCull; | 375 | BOOL mBackfaceCull; |
381 | S32 mTrianglesDrawn; | 376 | S32 mTrianglesDrawn; |
@@ -394,10 +389,16 @@ public: | |||
394 | LLStat mNumVisibleFacesStat; | 389 | LLStat mNumVisibleFacesStat; |
395 | LLStat mNumVisibleDrawablesStat; | 390 | LLStat mNumVisibleDrawablesStat; |
396 | 391 | ||
397 | static S32 sAGPMaxPoolSize; | ||
398 | static S32 sCompiles; | 392 | static S32 sCompiles; |
399 | 393 | ||
400 | BOOL mUseVBO; // Use ARB vertex buffer objects, if available | 394 | static BOOL sShowHUDAttachments; |
395 | static BOOL sUseOcclusion; | ||
396 | static BOOL sSkipUpdate; //skip lod updates | ||
397 | static BOOL sDynamicReflections; | ||
398 | |||
399 | //cube map for anti-aliasing reflections | ||
400 | LLCubeMap* mCubeBuffer; | ||
401 | GLuint mCubeList; | ||
401 | 402 | ||
402 | class LLScatterShader | 403 | class LLScatterShader |
403 | { | 404 | { |
@@ -432,15 +433,25 @@ public: | |||
432 | GLSL_SPECULAR_MAP, | 433 | GLSL_SPECULAR_MAP, |
433 | GLSL_BUMP_MAP, | 434 | GLSL_BUMP_MAP, |
434 | GLSL_ENVIRONMENT_MAP, | 435 | GLSL_ENVIRONMENT_MAP, |
435 | GLSL_SCATTER_MAP, | ||
436 | GLSL_END_RESERVED_UNIFORMS | 436 | GLSL_END_RESERVED_UNIFORMS |
437 | } eGLSLReservedUniforms; | 437 | } eGLSLReservedUniforms; |
438 | 438 | ||
439 | static const char* sShinyUniforms[]; | ||
440 | static U32 sShinyUniformCount; | ||
441 | |||
442 | typedef enum | ||
443 | { | ||
444 | GLSL_SHINY_ORIGIN = GLSL_END_RESERVED_UNIFORMS | ||
445 | } eShinyUniforms; | ||
446 | |||
447 | LLVector4 mShinyOrigin; | ||
448 | |||
439 | //object shaders | 449 | //object shaders |
440 | LLGLSLShader mObjectSimpleProgram; | 450 | LLGLSLShader mObjectSimpleProgram; |
441 | LLGLSLShader mObjectAlphaProgram; | 451 | LLGLSLShader mObjectAlphaProgram; |
442 | LLGLSLShader mObjectBumpProgram; | 452 | LLGLSLShader mObjectBumpProgram; |
443 | 453 | LLGLSLShader mObjectShinyProgram; | |
454 | |||
444 | //water parameters | 455 | //water parameters |
445 | static const char* sWaterUniforms[]; | 456 | static const char* sWaterUniforms[]; |
446 | static U32 sWaterUniformCount; | 457 | static U32 sWaterUniformCount; |
@@ -515,15 +526,17 @@ public: | |||
515 | 526 | ||
516 | LLColor4 mSunDiffuse; | 527 | LLColor4 mSunDiffuse; |
517 | LLVector3 mSunDir; | 528 | LLVector3 mSunDir; |
529 | |||
530 | LLSpatialGroup::sg_vector_t mActiveGroups; | ||
531 | std::vector<LLDrawInfo*> mRenderMap[LLRenderPass::NUM_RENDER_TYPES]; | ||
532 | std::vector<LLSpatialGroup* > mAlphaGroups; | ||
533 | std::vector<LLSpatialGroup* > mAlphaGroupsPostWater; | ||
534 | LLSpatialGroup::sg_vector_t mVisibleGroups; | ||
535 | LLSpatialGroup::sg_vector_t mDrawableGroups; | ||
536 | |||
537 | void clearRenderMap(); | ||
518 | 538 | ||
519 | protected: | 539 | protected: |
520 | class SelectedFaceInfo | ||
521 | { | ||
522 | public: | ||
523 | LLFace *mFacep; | ||
524 | S32 mTE; | ||
525 | }; | ||
526 | |||
527 | BOOL mVertexShadersEnabled; | 540 | BOOL mVertexShadersEnabled; |
528 | S32 mVertexShadersLoaded; // 0 = no, 1 = yes, -1 = failed | 541 | S32 mVertexShadersLoaded; // 0 = no, 1 = yes, -1 = failed |
529 | S32 mVertexShaderLevel[SHADER_COUNT]; | 542 | S32 mVertexShaderLevel[SHADER_COUNT]; |
@@ -534,12 +547,16 @@ protected: | |||
534 | U32 mRenderDebugFeatureMask; | 547 | U32 mRenderDebugFeatureMask; |
535 | U32 mRenderDebugMask; | 548 | U32 mRenderDebugMask; |
536 | 549 | ||
550 | U32 mOldRenderDebugMask; | ||
551 | |||
537 | ///////////////////////////////////////////// | 552 | ///////////////////////////////////////////// |
538 | // | 553 | // |
539 | // | 554 | // |
540 | LLDrawable::drawable_vector_t mVisibleList; | 555 | LLDrawable::drawable_vector_t mVisibleList; |
541 | LLDrawable::drawable_set_t mMovedList; | 556 | LLSpatialBridge::bridge_vector_t mVisibleBridge; |
542 | 557 | LLSpatialBridge::bridge_vector_t mOccludedBridge; | |
558 | LLDrawable::drawable_vector_t mMovedList; | ||
559 | LLDrawable::drawable_vector_t mMovedBridge; | ||
543 | LLDrawable::drawable_vector_t mShiftList; | 560 | LLDrawable::drawable_vector_t mShiftList; |
544 | 561 | ||
545 | ///////////////////////////////////////////// | 562 | ///////////////////////////////////////////// |
@@ -578,13 +595,12 @@ protected: | |||
578 | // | 595 | // |
579 | // Different queues of drawables being processed. | 596 | // Different queues of drawables being processed. |
580 | // | 597 | // |
581 | LLDrawable::drawable_set_t mBuildQ1; // priority | 598 | LLDrawable::drawable_list_t mBuildQ1; // priority |
582 | LLDrawable::drawable_list_t mBuildQ2; // non-priority | 599 | LLDrawable::drawable_list_t mBuildQ2; // non-priority |
583 | 600 | ||
584 | LLDrawable::drawable_set_t mActiveQ; | 601 | LLDrawable::drawable_set_t mActiveQ; |
585 | 602 | ||
586 | LLDrawable::drawable_set_t mRetexturedList; | 603 | LLDrawable::drawable_set_t mRetexturedList; |
587 | LLDrawable::drawable_set_t mRematerialedList; | ||
588 | 604 | ||
589 | ////////////////////////////////////////////////// | 605 | ////////////////////////////////////////////////// |
590 | // | 606 | // |
@@ -617,45 +633,27 @@ protected: | |||
617 | LLDrawPool* mLastRebuildPool; | 633 | LLDrawPool* mLastRebuildPool; |
618 | 634 | ||
619 | // For quick-lookups into mPools (mapped by texture pointer) | 635 | // For quick-lookups into mPools (mapped by texture pointer) |
620 | std::map<uintptr_t, LLDrawPool*> mSimplePools; | ||
621 | std::map<uintptr_t, LLDrawPool*> mTerrainPools; | 636 | std::map<uintptr_t, LLDrawPool*> mTerrainPools; |
622 | std::map<uintptr_t, LLDrawPool*> mTreePools; | 637 | std::map<uintptr_t, LLDrawPool*> mTreePools; |
623 | std::map<uintptr_t, LLDrawPool*> mTreeNewPools; | ||
624 | std::map<uintptr_t, LLDrawPool*> mBumpPools; | ||
625 | std::map<uintptr_t, LLDrawPool*> mMediaPools; | ||
626 | LLDrawPool* mAlphaPool; | 638 | LLDrawPool* mAlphaPool; |
639 | LLDrawPool* mAlphaPoolPostWater; | ||
627 | LLDrawPool* mSkyPool; | 640 | LLDrawPool* mSkyPool; |
628 | LLDrawPool* mStarsPool; | 641 | LLDrawPool* mStarsPool; |
629 | LLDrawPool* mCloudsPool; | ||
630 | LLDrawPool* mTerrainPool; | 642 | LLDrawPool* mTerrainPool; |
631 | LLDrawPool* mWaterPool; | 643 | LLDrawPool* mWaterPool; |
632 | LLDrawPool* mGroundPool; | 644 | LLDrawPool* mGroundPool; |
633 | LLDrawPool* mHUDPool; | 645 | LLRenderPass* mSimplePool; |
646 | LLDrawPool* mBumpPool; | ||
634 | // Note: no need to keep an quick-lookup to avatar pools, since there's only one per avatar | 647 | // Note: no need to keep an quick-lookup to avatar pools, since there's only one per avatar |
635 | 648 | ||
636 | 649 | ||
637 | LLDynamicArray<LLFace*> mHighlightFaces; // highlight faces on physical objects | 650 | std::vector<LLFace*> mHighlightFaces; // highlight faces on physical objects |
638 | LLDynamicArray<SelectedFaceInfo> mSelectedFaces; | 651 | std::vector<LLFace*> mSelectedFaces; |
639 | 652 | ||
640 | LLPointer<LLViewerImage> mFaceSelectImagep; | 653 | LLPointer<LLViewerImage> mFaceSelectImagep; |
641 | LLPointer<LLViewerImage> mBloomImagep; | 654 | LLPointer<LLViewerImage> mBloomImagep; |
642 | LLPointer<LLViewerImage> mBloomImage2p; | 655 | LLPointer<LLViewerImage> mBloomImage2p; |
643 | |||
644 | BOOL mAGPBound; | ||
645 | LLAGPMemPool *mAGPMemPool; | ||
646 | U32 mGlobalFence; | ||
647 | |||
648 | // Round-robin AGP buffers for use by the software skinner | ||
649 | enum | ||
650 | { | ||
651 | kMaxBufferCount = 4 | ||
652 | }; | ||
653 | 656 | ||
654 | S32 mBufferIndex; | ||
655 | S32 mBufferCount; | ||
656 | LLAGPArray<U8> *mBufferMemory[kMaxBufferCount]; | ||
657 | U32 mBufferFence[kMaxBufferCount]; | ||
658 | BOOL mUseOcclusionCulling; // object-object occlusion culling | ||
659 | U32 mLightMask; | 657 | U32 mLightMask; |
660 | U32 mLightMovingMask; | 658 | U32 mLightMovingMask; |
661 | S32 mLightingDetail; | 659 | S32 mLightingDetail; |
@@ -671,8 +669,5 @@ void render_bbox(const LLVector3 &min, const LLVector3 &max); | |||
671 | 669 | ||
672 | extern LLPipeline gPipeline; | 670 | extern LLPipeline gPipeline; |
673 | extern BOOL gRenderForSelect; | 671 | extern BOOL gRenderForSelect; |
674 | extern F32 gPickAlphaThreshold; | ||
675 | extern F32 gPickAlphaTargetThreshold; | ||
676 | extern BOOL gUsePickAlpha; | ||
677 | 672 | ||
678 | #endif | 673 | #endif |