summaryrefslogtreecommitdiff
path: root/indra/newview/pipeline.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/pipeline.h')
-rw-r--r--indra/newview/pipeline.h120
1 files changed, 82 insertions, 38 deletions
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index 8b6532ca25..36abeca295 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -111,13 +111,33 @@ public:
void destroyGL();
void restoreGL();
void resetVertexBuffers();
+ void doResetVertexBuffers();
void resizeScreenTexture();
void releaseGLBuffers();
+ void releaseLUTBuffers();
void releaseScreenBuffers();
void createGLBuffers();
+ void createLUTBuffers();
- void allocateScreenBuffer(U32 resX, U32 resY);
+ //allocate the largest screen buffer possible up to resX, resY
+ //returns true if full size buffer allocated, false if some other size is allocated
+ bool allocateScreenBuffer(U32 resX, U32 resY);
+
+ typedef enum {
+ FBO_SUCCESS_FULLRES = 0,
+ FBO_SUCCESS_LOWRES,
+ FBO_FAILURE
+ } eFBOStatus;
+
+private:
+ //implementation of above, wrapped for easy error handling
+ eFBOStatus doAllocateScreenBuffer(U32 resX, U32 resY);
+public:
+
+ //attempt to allocate screen buffers at resX, resY
+ //returns true if allocation successful, false otherwise
bool allocateScreenBuffer(U32 resX, U32 resY, U32 samples);
+
void allocatePhysicsBuffer();
void resetVertexBuffers(LLDrawable* drawable);
@@ -148,6 +168,8 @@ public:
void unlinkDrawable(LLDrawable*);
+ static void removeMutedAVsLights(LLVOAvatar*);
+
// Object related methods
void markVisible(LLDrawable *drawablep, LLCamera& camera);
void markOccluder(LLSpatialGroup* group);
@@ -160,6 +182,7 @@ public:
void markRebuild(LLSpatialGroup* group, BOOL priority = FALSE);
void markRebuild(LLDrawable *drawablep, LLDrawable::EDrawableFlags flag = LLDrawable::REBUILD_ALL, BOOL priority = FALSE);
void markPartitionMove(LLDrawable* drawablep);
+ void markMeshDirty(LLSpatialGroup* group);
//get the object between start and end that's closest to start.
LLViewerObject* lineSegmentIntersectInWorld(const LLVector3& start, const LLVector3& end,
@@ -219,6 +242,7 @@ public:
void updateGL();
void rebuildPriorityGroups();
void rebuildGroups();
+ void clearRebuildGroups();
//calculate pixel area of given box from vantage point of given camera
static F32 calcPixelArea(LLVector3 center, LLVector3 size, LLCamera& camera);
@@ -231,7 +255,7 @@ public:
void postSort(LLCamera& camera);
void forAllVisibleDrawables(void (*func)(LLDrawable*));
- void renderObjects(U32 type, U32 mask, BOOL texture = TRUE);
+ void renderObjects(U32 type, U32 mask, BOOL texture = TRUE, BOOL batch_texture = FALSE);
void renderGroups(LLRenderPass* pass, U32 type, U32 mask, BOOL texture);
void grabReferences(LLCullResult& result);
@@ -261,7 +285,7 @@ public:
void setHighlightObject(LLDrawable* obj) { mHighlightObject = obj; }
- void renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera& camera, LLCullResult& result, BOOL use_shader = TRUE, BOOL use_occlusion = TRUE);
+ void renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera& camera, LLCullResult& result, BOOL use_shader, BOOL use_occlusion, U32 target_width);
void renderHighlights();
void renderDebug();
void renderPhysicsDisplay();
@@ -290,10 +314,10 @@ public:
void setLight(LLDrawable *drawablep, BOOL is_light);
BOOL hasRenderBatches(const U32 type) const;
- LLCullResult::drawinfo_list_t::iterator beginRenderMap(U32 type);
- LLCullResult::drawinfo_list_t::iterator endRenderMap(U32 type);
- LLCullResult::sg_list_t::iterator beginAlphaGroups();
- LLCullResult::sg_list_t::iterator endAlphaGroups();
+ LLCullResult::drawinfo_iterator beginRenderMap(U32 type);
+ LLCullResult::drawinfo_iterator endRenderMap(U32 type);
+ LLCullResult::sg_iterator beginAlphaGroups();
+ LLCullResult::sg_iterator endAlphaGroups();
void addTrianglesDrawn(S32 index_count, U32 render_type = LLRender::TRIANGLES);
@@ -359,13 +383,18 @@ public:
static BOOL getRenderHighlights(void* data);
static void updateRenderDeferred();
- static void refreshRenderDeferred();
static void refreshCachedSettings();
static void throttleNewMemoryAllocation(BOOL disable);
void addDebugBlip(const LLVector3& position, const LLColor4& color);
+ void hidePermanentObjects( std::vector<U32>& restoreList );
+ void restorePermanentObjects( const std::vector<U32>& restoreList );
+ void skipRenderingOfTerrain( BOOL flag );
+ void hideObject( const LLUUID& id );
+ void restoreHiddenObject( const LLUUID& id );
+
private:
void unloadShaders();
void addToQuickLookup( LLDrawPool* new_poolp );
@@ -373,7 +402,9 @@ private:
BOOL updateDrawableGeom(LLDrawable* drawable, BOOL priority);
void assertInitializedDoError();
bool assertInitialized() { const bool is_init = isInit(); if (!is_init) assertInitializedDoError(); return is_init; };
-
+ void connectRefreshCachedSettingsSafe(const std::string name);
+ void hideDrawable( LLDrawable *pDrawable );
+ void unhideDrawable( LLDrawable *pDrawable );
public:
enum {GPU_CLASS_MAX = 3 };
@@ -408,7 +439,6 @@ public:
RENDER_TYPE_PASS_ALPHA = LLRenderPass::PASS_ALPHA,
RENDER_TYPE_PASS_ALPHA_MASK = LLRenderPass::PASS_ALPHA_MASK,
RENDER_TYPE_PASS_FULLBRIGHT_ALPHA_MASK = LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK,
- RENDER_TYPE_PASS_ALPHA_SHADOW = LLRenderPass::PASS_ALPHA_SHADOW,
// Following are object types (only used in drawable mRenderType)
RENDER_TYPE_HUD = LLRenderPass::NUM_RENDER_TYPES,
RENDER_TYPE_VOLUME,
@@ -434,34 +464,36 @@ public:
enum LLRenderDebugMask
{
- RENDER_DEBUG_COMPOSITION = 0x0000001,
- RENDER_DEBUG_VERIFY = 0x0000002,
- RENDER_DEBUG_BBOXES = 0x0000004,
- RENDER_DEBUG_OCTREE = 0x0000008,
- RENDER_DEBUG_WIND_VECTORS = 0x0000010,
- RENDER_DEBUG_OCCLUSION = 0x0000020,
- RENDER_DEBUG_POINTS = 0x0000040,
- RENDER_DEBUG_TEXTURE_PRIORITY = 0x0000080,
- RENDER_DEBUG_TEXTURE_AREA = 0x0000100,
- RENDER_DEBUG_FACE_AREA = 0x0000200,
- RENDER_DEBUG_PARTICLES = 0x0000400,
- RENDER_DEBUG_GLOW = 0x0000800,
- RENDER_DEBUG_TEXTURE_ANIM = 0x0001000,
- RENDER_DEBUG_LIGHTS = 0x0002000,
- RENDER_DEBUG_BATCH_SIZE = 0x0004000,
- RENDER_DEBUG_ALPHA_BINS = 0x0008000,
- RENDER_DEBUG_RAYCAST = 0x0010000,
- RENDER_DEBUG_SHAME = 0x0020000,
- RENDER_DEBUG_SHADOW_FRUSTA = 0x0040000,
- RENDER_DEBUG_SCULPTED = 0x0080000,
- RENDER_DEBUG_AVATAR_VOLUME = 0x0100000,
- RENDER_DEBUG_BUILD_QUEUE = 0x0200000,
- RENDER_DEBUG_AGENT_TARGET = 0x0400000,
- RENDER_DEBUG_UPDATE_TYPE = 0x0800000,
- RENDER_DEBUG_PHYSICS_SHAPES = 0x1000000,
- RENDER_DEBUG_NORMALS = 0x2000000,
- RENDER_DEBUG_LOD_INFO = 0x4000000,
- RENDER_DEBUG_RENDER_COMPLEXITY = 0x8000000
+ RENDER_DEBUG_COMPOSITION = 0x00000001,
+ RENDER_DEBUG_VERIFY = 0x00000002,
+ RENDER_DEBUG_BBOXES = 0x00000004,
+ RENDER_DEBUG_OCTREE = 0x00000008,
+ RENDER_DEBUG_WIND_VECTORS = 0x00000010,
+ RENDER_DEBUG_OCCLUSION = 0x00000020,
+ RENDER_DEBUG_POINTS = 0x00000040,
+ RENDER_DEBUG_TEXTURE_PRIORITY = 0x00000080,
+ RENDER_DEBUG_TEXTURE_AREA = 0x00000100,
+ RENDER_DEBUG_FACE_AREA = 0x00000200,
+ RENDER_DEBUG_PARTICLES = 0x00000400,
+ RENDER_DEBUG_GLOW = 0x00000800,
+ RENDER_DEBUG_TEXTURE_ANIM = 0x00001000,
+ RENDER_DEBUG_LIGHTS = 0x00002000,
+ RENDER_DEBUG_BATCH_SIZE = 0x00004000,
+ RENDER_DEBUG_ALPHA_BINS = 0x00008000,
+ RENDER_DEBUG_RAYCAST = 0x00010000,
+ RENDER_DEBUG_SHAME = 0x00020000,
+ RENDER_DEBUG_SHADOW_FRUSTA = 0x00040000,
+ RENDER_DEBUG_SCULPTED = 0x00080000,
+ RENDER_DEBUG_AVATAR_VOLUME = 0x00100000,
+ RENDER_DEBUG_BUILD_QUEUE = 0x00200000,
+ RENDER_DEBUG_AGENT_TARGET = 0x00400000,
+ RENDER_DEBUG_UPDATE_TYPE = 0x00800000,
+ RENDER_DEBUG_PHYSICS_SHAPES = 0x01000000,
+ RENDER_DEBUG_NORMALS = 0x02000000,
+ RENDER_DEBUG_LOD_INFO = 0x04000000,
+ RENDER_DEBUG_RENDER_COMPLEXITY = 0x08000000,
+ RENDER_DEBUG_ATTACHMENT_BYTES = 0x10000000,
+ RENDER_DEBUG_TEXEL_DENSITY = 0x20000000
};
public:
@@ -541,6 +573,9 @@ public:
//utility buffer for rendering post effects, gets abused by renderDeferredLighting
LLPointer<LLVertexBuffer> mDeferredVB;
+ //utility buffer for rendering cubes, 8 vertices are corners of a cube [-1, 1]
+ LLPointer<LLVertexBuffer> mCubeVB;
+
//sun shadow map
LLRenderTarget mShadow[6];
std::vector<LLVector3> mShadowFrustPoints[4];
@@ -592,6 +627,7 @@ public:
BOOL mVertexShadersEnabled;
S32 mVertexShadersLoaded; // 0 = no, 1 = yes, -1 = failed
+ U32 mTransformFeedbackPrimitives; //number of primitives expected to be generated by transform feedback
protected:
BOOL mRenderTypeEnabled[NUM_RENDER_TYPES];
std::stack<std::string> mRenderTypeEnableStack;
@@ -649,11 +685,18 @@ protected:
LLSpatialGroup::sg_vector_t mGroupQ1; //priority
LLSpatialGroup::sg_vector_t mGroupQ2; // non-priority
+ LLSpatialGroup::sg_vector_t mGroupSaveQ1; // a place to save mGroupQ1 until it is safe to unref
+
+ LLSpatialGroup::sg_vector_t mMeshDirtyGroup; //groups that need rebuildMesh called
+ U32 mMeshDirtyQueryObject;
+
LLDrawable::drawable_list_t mPartitionQ; //drawables that need to update their spatial partition radius
bool mGroupQ2Locked;
bool mGroupQ1Locked;
+ bool mResetVertexBuffers; //if true, clear vertex buffers on next update
+
LLViewerObject::vobj_list_t mCreateQ;
LLDrawable::drawable_set_t mRetexturedList;
@@ -847,6 +890,7 @@ public:
static BOOL CameraOffset;
static F32 CameraMaxCoF;
static F32 CameraDoFResScale;
+ static F32 RenderAutoHideSurfaceAreaLimit;
};
void render_bbox(const LLVector3 &min, const LLVector3 &max);