From Lionel Lagarde, "Support for paging and shared PBO"
"The attached file contains: - a per-context read counter in GLBufferObject::BufferEntry - a global client counter in BufferData - the glue between Texture* and Image client counter "
This commit is contained in:
@@ -39,13 +39,17 @@ Texture2DArray::Texture2DArray(const Texture2DArray& text,const CopyOp& copyop):
|
||||
// copy all images by iterating through all of them
|
||||
for (int i=0; i < text._textureDepth; i++)
|
||||
{
|
||||
_images.push_back(copyop(text._images[i].get()));
|
||||
setImage(i, copyop(text._images[i].get()));
|
||||
_modifiedCount.push_back(ImageModifiedCount());
|
||||
}
|
||||
}
|
||||
|
||||
Texture2DArray::~Texture2DArray()
|
||||
{
|
||||
for (int i=0; i<_textureDepth; ++i)
|
||||
{
|
||||
setImage(i, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
int Texture2DArray::compare(const StateAttribute& sa) const
|
||||
@@ -118,9 +122,19 @@ void Texture2DArray::setImage(unsigned int layer, Image* image)
|
||||
if (_images[i].valid() && _images[i]->requiresUpdateCall()) ++numImageRequireUpdateBefore;
|
||||
}
|
||||
|
||||
if (_images[layer].valid())
|
||||
{
|
||||
_images[layer]->removeClient(this);
|
||||
}
|
||||
|
||||
// set image
|
||||
_images[layer] = image;
|
||||
_modifiedCount[layer].setAllElementsTo(0);
|
||||
_modifiedCount[layer].setAllElementsTo(0);
|
||||
|
||||
if (_images[layer].valid())
|
||||
{
|
||||
_images[layer]->addClient(this);
|
||||
}
|
||||
|
||||
// find out if we need to reset the update callback to handle the animation of image
|
||||
unsigned numImageRequireUpdateAfter = 0;
|
||||
|
||||
Reference in New Issue
Block a user