summaryrefslogtreecommitdiff
path: root/indra/newview/llvowlsky.cpp
diff options
context:
space:
mode:
authorJonathan Yap <jhwelch@gmail.com>2018-01-12 09:08:49 -0500
committerJonathan Yap <jhwelch@gmail.com>2018-01-12 09:08:49 -0500
commit1e586749efeeb8c40503330572680a8709ae5487 (patch)
tree5c1ebee5dbdb5004f354b9fb0837d60f6dd3cfcc /indra/newview/llvowlsky.cpp
parent32f16633c77564d567ed0752e56eb38abb916ccd (diff)
parent1693ccba58eef676df1f91e50627545ac35bb819 (diff)
STORM-2145 Merge up to viewer-release
Diffstat (limited to 'indra/newview/llvowlsky.cpp')
-rw-r--r--indra/newview/llvowlsky.cpp31
1 files changed, 22 insertions, 9 deletions
diff --git a/indra/newview/llvowlsky.cpp b/indra/newview/llvowlsky.cpp
index 90bc6509a6..3b9b96e9f1 100644
--- a/indra/newview/llvowlsky.cpp
+++ b/indra/newview/llvowlsky.cpp
@@ -313,7 +313,12 @@ BOOL LLVOWLSky::updateGeometry(LLDrawable * drawable)
#if DOME_SLICES
{
mFanVerts = new LLVertexBuffer(LLDrawPoolWLSky::SKY_VERTEX_DATA_MASK, GL_STATIC_DRAW_ARB);
- mFanVerts->allocateBuffer(getFanNumVerts(), getFanNumIndices(), TRUE);
+ if (!mFanVerts->allocateBuffer(getFanNumVerts(), getFanNumIndices(), TRUE))
+ {
+ LL_WARNS() << "Failed to allocate Vertex Buffer on sky update to "
+ << getFanNumVerts() << " vertices and "
+ << getFanNumIndices() << " indices" << LL_ENDL;
+ }
BOOL success = mFanVerts->getVertexStrider(vertices)
&& mFanVerts->getTexCoord0Strider(texCoords)
@@ -375,7 +380,12 @@ BOOL LLVOWLSky::updateGeometry(LLDrawable * drawable)
const U32 num_indices_this_seg = 1+num_stacks_this_seg*(2+2*verts_per_stack);
llassert(num_indices_this_seg * sizeof(U16) <= max_buffer_bytes);
- segment->allocateBuffer(num_verts_this_seg, num_indices_this_seg, TRUE);
+ if (!segment->allocateBuffer(num_verts_this_seg, num_indices_this_seg, TRUE))
+ {
+ LL_WARNS() << "Failed to allocate Vertex Buffer on update to "
+ << num_verts_this_seg << " vertices and "
+ << num_indices_this_seg << " indices" << LL_ENDL;
+ }
// lock the buffer
BOOL success = segment->getVertexStrider(vertices)
@@ -777,7 +787,10 @@ BOOL LLVOWLSky::updateStarGeometry(LLDrawable *drawable)
if (mStarsVerts.isNull() || !mStarsVerts->isWriteable())
{
mStarsVerts = new LLVertexBuffer(LLDrawPoolWLSky::STAR_VERTEX_DATA_MASK, GL_DYNAMIC_DRAW);
- mStarsVerts->allocateBuffer(getStarsNumVerts()*6, 0, TRUE);
+ if (!mStarsVerts->allocateBuffer(getStarsNumVerts()*6, 0, TRUE))
+ {
+ LL_WARNS() << "Failed to allocate Vertex Buffer for Sky to " << getStarsNumVerts() * 6 << " vertices" << LL_ENDL;
+ }
}
BOOL success = mStarsVerts->getVertexStrider(verticesp)
@@ -810,18 +823,18 @@ BOOL LLVOWLSky::updateStarGeometry(LLDrawable *drawable)
up *= sc;
*(verticesp++) = mStarVertices[vtx];
- *(verticesp++) = mStarVertices[vtx]+left;
+ *(verticesp++) = mStarVertices[vtx]+up;
*(verticesp++) = mStarVertices[vtx]+left+up;
- *(verticesp++) = mStarVertices[vtx]+left;
+ *(verticesp++) = mStarVertices[vtx];
*(verticesp++) = mStarVertices[vtx]+left+up;
- *(verticesp++) = mStarVertices[vtx]+up;
+ *(verticesp++) = mStarVertices[vtx]+left;
- *(texcoordsp++) = LLVector2(0,0);
- *(texcoordsp++) = LLVector2(0,1);
+ *(texcoordsp++) = LLVector2(1,0);
*(texcoordsp++) = LLVector2(1,1);
*(texcoordsp++) = LLVector2(0,1);
- *(texcoordsp++) = LLVector2(1,1);
*(texcoordsp++) = LLVector2(1,0);
+ *(texcoordsp++) = LLVector2(0,1);
+ *(texcoordsp++) = LLVector2(0,0);
*(colorsp++) = LLColor4U(mStarColors[vtx]);
*(colorsp++) = LLColor4U(mStarColors[vtx]);