diff options
| author | Ankur Ahlawat <anchor@lindenlab.com> | 2018-01-04 00:54:41 -0800 | 
|---|---|---|
| committer | Ankur Ahlawat <anchor@lindenlab.com> | 2018-01-04 00:54:41 -0800 | 
| commit | d4ce47b09122d1f76601ba402c2b9ad6bb504950 (patch) | |
| tree | 2f9a4aca02618d53d31ac62625645f89fb30c52f /indra/newview/llvopartgroup.cpp | |
| parent | 93100236ae34eaa9cd3fa314e7e770339c13eba7 (diff) | |
| parent | 1693ccba58eef676df1f91e50627545ac35bb819 (diff) | |
Merged lindenlab/viewer-release into default
Diffstat (limited to 'indra/newview/llvopartgroup.cpp')
| -rw-r--r-- | indra/newview/llvopartgroup.cpp | 12 | 
1 files changed, 10 insertions, 2 deletions
| diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp index 6e5db526b0..f7b21338f8 100644 --- a/indra/newview/llvopartgroup.cpp +++ b/indra/newview/llvopartgroup.cpp @@ -61,7 +61,15 @@ void LLVOPartGroup::restoreGL()  	//TODO: optimize out binormal mask here.  Specular and normal coords as well.  	sVB = new LLVertexBuffer(VERTEX_DATA_MASK | LLVertexBuffer::MAP_TANGENT | LLVertexBuffer::MAP_TEXCOORD1 | LLVertexBuffer::MAP_TEXCOORD2, GL_STREAM_DRAW_ARB);  	U32 count = LL_MAX_PARTICLE_COUNT; -	sVB->allocateBuffer(count*4, count*6, true); +	if (!sVB->allocateBuffer(count*4, count*6, true)) +	{ +		LL_WARNS() << "Failed to allocate Vertex Buffer to " +			<< count*4 << " vertices and " +			<< count * 6 << " indices" << LL_ENDL; +		// we are likelly to crash at following getTexCoord0Strider(), so unref and return +		sVB = NULL; +		return; +	}  	//indices and texcoords are always the same, set once  	LLStrider<U16> indicesp; @@ -764,7 +772,7 @@ void LLParticlePartition::rebuildGeom(LLSpatialGroup* group)  	addGeometryCount(group, vertex_count, index_count); -	if (vertex_count > 0 && index_count > 0) +	if (vertex_count > 0 && index_count > 0 && LLVOPartGroup::sVB)  	{   		group->mBuilt = 1.f;  		//use one vertex buffer for all groups | 
