Revert upstream change to particle index accounting. (Fixes flicker issues)
This commit is contained in:
@@ -656,7 +656,6 @@ void LLViewerPartSim::updateSimulation()
|
||||
static LLFrameTimer update_timer;
|
||||
|
||||
//reset VBO cursor
|
||||
LLVOPartGroup::sVBSlotCursor = 0;
|
||||
|
||||
const F32 dt = llmin(update_timer.getElapsedTimeAndResetF32(), 0.1f);
|
||||
|
||||
|
||||
@@ -55,18 +55,18 @@ const F32 MAX_PART_LIFETIME = 120.f;
|
||||
extern U64 gFrameTime;
|
||||
|
||||
LLPointer<LLVertexBuffer> LLVOPartGroup::sVB = NULL;
|
||||
/*S32 LLVOPartGroup::sVBSlotFree[];
|
||||
S32* LLVOPartGroup::sVBSlotCursor = NULL;*/
|
||||
S32 LLVOPartGroup::sVBSlotCursor = 0;
|
||||
S32 LLVOPartGroup::sVBSlotFree[];
|
||||
S32* LLVOPartGroup::sVBSlotCursor = NULL;
|
||||
//S32 LLVOPartGroup::sVBSlotCursor = 0;
|
||||
|
||||
void LLVOPartGroup::initClass()
|
||||
{
|
||||
/*for (S32 i = 0; i < LL_MAX_PARTICLE_COUNT; ++i)
|
||||
for (S32 i = 0; i < LL_MAX_PARTICLE_COUNT; ++i)
|
||||
{
|
||||
sVBSlotFree[i] = i;
|
||||
}
|
||||
|
||||
sVBSlotCursor = sVBSlotFree;*/
|
||||
sVBSlotCursor = sVBSlotFree;
|
||||
}
|
||||
|
||||
//static
|
||||
@@ -131,22 +131,22 @@ void LLVOPartGroup::destroyGL()
|
||||
//static
|
||||
S32 LLVOPartGroup::findAvailableVBSlot()
|
||||
{
|
||||
if (sVBSlotCursor >= /*sVBSlotFree+*/LL_MAX_PARTICLE_COUNT)
|
||||
if (sVBSlotCursor >= sVBSlotFree+LL_MAX_PARTICLE_COUNT)
|
||||
{ //no more available slots
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*S32 ret = *sVBSlotCursor;
|
||||
S32 ret = *sVBSlotCursor;
|
||||
sVBSlotCursor++;
|
||||
|
||||
return ret;*/
|
||||
return ret;
|
||||
|
||||
return sVBSlotCursor++;
|
||||
//return sVBSlotCursor++;
|
||||
}
|
||||
|
||||
bool ll_is_part_idx_allocated(S32 idx, S32* start, S32* end)
|
||||
{
|
||||
/*while (start < end)
|
||||
while (start < end)
|
||||
{
|
||||
if (*start == idx)
|
||||
{ //not allocated (in free list)
|
||||
@@ -156,14 +156,14 @@ bool ll_is_part_idx_allocated(S32 idx, S32* start, S32* end)
|
||||
}
|
||||
|
||||
//allocated (not in free list)
|
||||
return true;*/
|
||||
return false;
|
||||
return true;
|
||||
//return false;
|
||||
}
|
||||
|
||||
//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));
|
||||
|
||||
@@ -171,7 +171,7 @@ void LLVOPartGroup::freeVBSlot(S32 idx)
|
||||
{
|
||||
sVBSlotCursor--;
|
||||
*sVBSlotCursor = idx;
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
LLVOPartGroup::LLVOPartGroup(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp)
|
||||
@@ -881,7 +881,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)
|
||||
@@ -890,7 +890,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
|
||||
{
|
||||
|
||||
@@ -48,9 +48,9 @@ public:
|
||||
|
||||
//vertex buffer for holding all particles
|
||||
static LLPointer<LLVertexBuffer> sVB;
|
||||
/*static S32 sVBSlotFree[LL_MAX_PARTICLE_COUNT];
|
||||
static S32* sVBSlotCursor;*/
|
||||
static S32 sVBSlotCursor;
|
||||
static S32 sVBSlotFree[LL_MAX_PARTICLE_COUNT];
|
||||
static S32* sVBSlotCursor;
|
||||
//static S32 sVBSlotCursor;
|
||||
|
||||
static void initClass();
|
||||
static void restoreGL();
|
||||
|
||||
Reference in New Issue
Block a user