summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorruslantproductengine <ruslantproductengine@lindenlab.com>2018-02-03 14:11:26 +0200
committerruslantproductengine <ruslantproductengine@lindenlab.com>2018-02-03 14:11:26 +0200
commitcc30a9e2f5b9410dcdf323d3ecdd3f6f1e2985db (patch)
tree8f3aa5ac22cf2f54f281dcb490c0367936bebe22 /indra
parent0f690ab4dae4c2888ace57362497752592d6fc77 (diff)
MAINT-3178 [MAINTENANCE RC] Ribbon particles using textures containing alpha flash white at certain camera angles
FIXED. Based on: https://bitbucket.org/lindenlab/viewer-cougar/commits/6317cce88ffc5eeb3481344d0ff254c7846357fc#chg-indra/newview/llvopartgroup.cpp and http://hg.phoenixviewer.com/phoenix-firestorm-lgpl/rev/9ecea804a06d
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llviewerpartsim.cpp3
-rw-r--r--indra/newview/llvopartgroup.cpp22
-rw-r--r--indra/newview/llvopartgroup.h3
3 files changed, 17 insertions, 11 deletions
diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp
index b4617566ac..2c81e2835c 100644
--- a/indra/newview/llviewerpartsim.cpp
+++ b/indra/newview/llviewerpartsim.cpp
@@ -661,9 +661,6 @@ void LLViewerPartSim::updateSimulation()
{
static LLFrameTimer update_timer;
- //reset VBO cursor
- LLVOPartGroup::sVBSlotCursor = 0;
-
const F32 dt = llmin(update_timer.getElapsedTimeAndResetF32(), 0.1f);
if (!(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_PARTICLES)))
diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp
index f006ad2867..b31afca61d 100644
--- a/indra/newview/llvopartgroup.cpp
+++ b/indra/newview/llvopartgroup.cpp
@@ -47,11 +47,17 @@
extern U64MicrosecondsImplicit gFrameTime;
LLPointer<LLVertexBuffer> LLVOPartGroup::sVB = NULL;
-S32 LLVOPartGroup::sVBSlotCursor = 0;
+S32 LLVOPartGroup::sVBSlotFree[];
+S32* LLVOPartGroup::sVBSlotCursor = NULL;
void LLVOPartGroup::initClass()
{
+ for (S32 i = 0; i < LL_MAX_PARTICLE_COUNT; ++i)
+ {
+ sVBSlotFree[i] = i;
+ }
+ sVBSlotCursor = sVBSlotFree;
}
//static
@@ -124,12 +130,14 @@ void LLVOPartGroup::destroyGL()
//static
S32 LLVOPartGroup::findAvailableVBSlot()
{
- if (sVBSlotCursor >= LL_MAX_PARTICLE_COUNT)
+ if (sVBSlotCursor >= sVBSlotFree + LL_MAX_PARTICLE_COUNT)
{ //no more available slots
return -1;
}
- return sVBSlotCursor++;
+ S32 ret = *sVBSlotCursor;
+ sVBSlotCursor++;
+ return ret;
}
bool ll_is_part_idx_allocated(S32 idx, S32* start, S32* end)
@@ -150,7 +158,7 @@ bool ll_is_part_idx_allocated(S32 idx, S32* start, S32* end)
//static
void LLVOPartGroup::freeVBSlot(S32 idx)
{
- /*llassert(idx < LL_MAX_PARTICLE_COUNT && idx >= 0);
+ llassert(idx < LL_MAX_PARTICLE_COUNT && idx >= 0);
//llassert(sVBSlotCursor > sVBSlotFree);
//llassert(ll_is_part_idx_allocated(idx, sVBSlotCursor, sVBSlotFree+LL_MAX_PARTICLE_COUNT));
@@ -158,7 +166,7 @@ void LLVOPartGroup::freeVBSlot(S32 idx)
{
sVBSlotCursor--;
*sVBSlotCursor = idx;
- }*/
+ }
}
LLVOPartGroup::LLVOPartGroup(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp)
@@ -870,7 +878,7 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group)
LLFace* facep = *i;
LLAlphaObject* object = (LLAlphaObject*) facep->getViewerObject();
- //if (!facep->isState(LLFace::PARTICLE))
+ if (!facep->isState(LLFace::PARTICLE))
{ //set the indices of this face
S32 idx = LLVOPartGroup::findAvailableVBSlot();
if (idx >= 0)
@@ -879,7 +887,7 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group)
facep->setIndicesIndex(idx*6);
facep->setVertexBuffer(LLVOPartGroup::sVB);
facep->setPoolType(LLDrawPool::POOL_ALPHA);
- //facep->setState(LLFace::PARTICLE);
+ facep->setState(LLFace::PARTICLE);
}
else
{
diff --git a/indra/newview/llvopartgroup.h b/indra/newview/llvopartgroup.h
index 2ef8b1c848..4e4d6e609d 100644
--- a/indra/newview/llvopartgroup.h
+++ b/indra/newview/llvopartgroup.h
@@ -42,7 +42,8 @@ public:
//vertex buffer for holding all particles
static LLPointer<LLVertexBuffer> sVB;
- static S32 sVBSlotCursor;
+ static S32 sVBSlotFree[LL_MAX_PARTICLE_COUNT];
+ static S32 *sVBSlotCursor;
static void initClass();
static void restoreGL();