Commit dc9d882d authored by BRAMAS Berenger's avatar BRAMAS Berenger

Ensure we are not working with the attributes if the down part of the particules should not be used

parent d92046b0
......@@ -291,7 +291,7 @@ public:
ParticlesAttachedClass leaf(leafHeader[id].nbParticles,
particlePosition[0] + leafHeader[id].offSet,
blockHeader->positionOffset,
particleAttributes[NbSymbAttributes] + leafHeader[id].offSet,
(attributesBuffer?particleAttributes[NbSymbAttributes] + leafHeader[id].offSet:nullptr),
blockHeader->attributeOffset);
function(&leaf);
}
......@@ -307,7 +307,7 @@ public:
return ParticlesAttachedClass(leafHeader[id].nbParticles,
particlePosition[0] + leafHeader[id].offSet,
blockHeader->positionOffset,
particleAttributes[NbSymbAttributes] + leafHeader[id].offSet,
(attributesBuffer?particleAttributes[NbSymbAttributes] + leafHeader[id].offSet:nullptr),
blockHeader->attributeOffset);
}
return ParticlesAttachedClass();
......
......@@ -151,7 +151,7 @@ public:
return ParticlesAttachedClass(leafHeader[id].nbParticles,
particlePosition[0] + leafHeader[id].offSet,
blockHeader->positionOffset,
particleAttributes[NbSymbAttributes] + leafHeader[id].offSet,
(attributesBuffer?particleAttributes[NbSymbAttributes] + leafHeader[id].offSet:nullptr),
blockHeader->attributeOffset);
}
return ParticlesAttachedClass();
......
......@@ -221,8 +221,15 @@ struct FOpenCLGroupAttachedLeaf BuildFOpenCLGroupAttachedLeaf(const int inNbPart
}
// Redirect pointers to data
for(unsigned idxAttribute = 0 ; idxAttribute < NbAttributesPerParticle ; ++idxAttribute){
leaf.attributes[idxAttribute+NbSymbAttributes] = (__global FParticleValueClass*)(((__global unsigned char*)inAttributesBuffer) + idxAttribute*inLeadingAttributes);
if(inAttributesBuffer){
for(unsigned idxAttribute = 0 ; idxAttribute < NbAttributesPerParticle ; ++idxAttribute){
leaf.attributes[idxAttribute+NbSymbAttributes] = (__global FParticleValueClass*)(((__global unsigned char*)inAttributesBuffer) + idxAttribute*inLeadingAttributes);
}
}
else{
for(unsigned idxAttribute = 0 ; idxAttribute < NbAttributesPerParticle ; ++idxAttribute){
leaf.attributes[idxAttribute+NbSymbAttributes] = NULLPTR;
}
}
return leaf;
}
......@@ -360,7 +367,7 @@ struct FOpenCLGroupAttachedLeaf FOpenCLGroupOfParticles_getLeaf(struct FOpenCLGr
return BuildFOpenCLGroupAttachedLeaf(group->leafHeader[id].nbParticles,
group->particlePosition[0] + group->leafHeader[id].offSet,
group->blockHeader->positionOffset,
group->particleAttributes[NbSymbAttributes] + group->leafHeader[id].offSet,
(group.attributesBuffer?group->particleAttributes[NbSymbAttributes] + group->leafHeader[id].offSet:NULLPTR),
group->blockHeader->attributeOffset);
}
return EmptyFOpenCLGroupAttachedLeaf();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment