Browse Source

Removed licences from HardwareBufferManager

Marko Pintera 13 years ago
parent
commit
514305b806

+ 0 - 7
CamelotRenderer/OgreD3D9Device.cpp

@@ -378,13 +378,6 @@ namespace Ogre
 		// Notify all listener before device is rested
 		renderSystem->notifyOnDeviceLost(this);
 
-		// Release all automatic temporary buffers and free unused
-		// temporary buffers, so we doesn't need to recreate them,
-		// and they will reallocate on demand. This save a lot of
-		// release/recreate of non-managed vertex buffers which
-		// wasn't need at all.
-		HardwareBufferManager::getSingleton()._releaseBufferCopies(true);
-
 		// Cleanup depth stencils surfaces.
 		renderSystem->_cleanupDepthStencils(mpDevice);
 

+ 5 - 339
CamelotRenderer/OgreHardwareBufferManager.cpp

@@ -53,14 +53,8 @@ namespace Ogre {
 	{
 		// mImpl must be deleted by the creator
 	}
-	//---------------------------------------------------------------------
-	//---------------------------------------------------------------------
-    // Free temporary vertex buffers every 5 minutes on 100fps
-    const size_t HardwareBufferManagerBase::UNDER_USED_FRAME_THRESHOLD = 30000;
-    const size_t HardwareBufferManagerBase::EXPIRED_DELAY_FRAME_THRESHOLD = 5;
     //-----------------------------------------------------------------------
     HardwareBufferManagerBase::HardwareBufferManagerBase()
-        : mUnderUsedFrameCount(0)
     {
     }
     //-----------------------------------------------------------------------
@@ -151,20 +145,9 @@ namespace Ogre {
         mVertexBufferBindings.clear();
     }
 	//-----------------------------------------------------------------------
-    void HardwareBufferManagerBase::registerVertexBufferSourceAndCopy(
-			const HardwareVertexBufferPtr& sourceBuffer,
-			const HardwareVertexBufferPtr& copy)
-	{
-		OGRE_LOCK_MUTEX(mTempBuffersMutex)
-		// Add copy to free temporary vertex buffers
-        mFreeTempVertexBufferMap.insert(
-            FreeTemporaryVertexBufferMap::value_type(sourceBuffer.get(), copy));
-	}
-	//-----------------------------------------------------------------------
     HardwareVertexBufferPtr 
     HardwareBufferManagerBase::allocateVertexBufferCopy(
         const HardwareVertexBufferPtr& sourceBuffer, 
-        BufferLicenseType licenseType, HardwareBufferLicensee* licensee,
         bool copyData)
     {
 		// pre-lock the mVertexBuffers mutex, which would usually get locked in
@@ -177,22 +160,11 @@ namespace Ogre {
 			HardwareVertexBufferPtr vbuf;
 
 			// Locate existing buffer copy in temporary vertex buffers
-			FreeTemporaryVertexBufferMap::iterator i = 
-				mFreeTempVertexBufferMap.find(sourceBuffer.get());
-			if (i == mFreeTempVertexBufferMap.end())
-			{
-				// copy buffer, use shadow buffer and make dynamic
-				vbuf = makeBufferCopy(
-					sourceBuffer, 
-					HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE, 
-					true);
-			}
-			else
-			{
-				// Allocate existing copy
-				vbuf = i->second;
-				mFreeTempVertexBufferMap.erase(i);
-			}
+			// copy buffer, use shadow buffer and make dynamic
+			vbuf = makeBufferCopy(
+				sourceBuffer, 
+				HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE, 
+				true);
 
 			// Copy data?
 			if (copyData)
@@ -200,193 +172,9 @@ namespace Ogre {
 				vbuf->copyData(*(sourceBuffer.get()), 0, 0, sourceBuffer->getSizeInBytes(), true);
 			}
 
-			// Insert copy into licensee list
-			mTempVertexBufferLicenses.insert(
-				TemporaryVertexBufferLicenseMap::value_type(
-					vbuf.get(),
-					VertexBufferLicense(sourceBuffer.get(), licenseType, EXPIRED_DELAY_FRAME_THRESHOLD, vbuf, licensee)));
 			return vbuf;
 		}
 
-    }
-    //-----------------------------------------------------------------------
-    void HardwareBufferManagerBase::releaseVertexBufferCopy(
-        const HardwareVertexBufferPtr& bufferCopy)
-    {
-		OGRE_LOCK_MUTEX(mTempBuffersMutex)
-
-		TemporaryVertexBufferLicenseMap::iterator i =
-            mTempVertexBufferLicenses.find(bufferCopy.get());
-        if (i != mTempVertexBufferLicenses.end())
-        {
-            const VertexBufferLicense& vbl = i->second;
-
-            vbl.licensee->licenseExpired(vbl.buffer.get());
-
-            mFreeTempVertexBufferMap.insert(
-                FreeTemporaryVertexBufferMap::value_type(vbl.originalBufferPtr, vbl.buffer));
-            mTempVertexBufferLicenses.erase(i);
-        }
-    }
-    //-----------------------------------------------------------------------
-    void HardwareBufferManagerBase::touchVertexBufferCopy(
-            const HardwareVertexBufferPtr& bufferCopy)
-    {
-		OGRE_LOCK_MUTEX(mTempBuffersMutex)
-        TemporaryVertexBufferLicenseMap::iterator i =
-            mTempVertexBufferLicenses.find(bufferCopy.get());
-        if (i != mTempVertexBufferLicenses.end())
-        {
-            VertexBufferLicense& vbl = i->second;
-            assert(vbl.licenseType == BLT_AUTOMATIC_RELEASE);
-
-            vbl.expiredDelay = EXPIRED_DELAY_FRAME_THRESHOLD;
-        }
-    }
-    //-----------------------------------------------------------------------
-    void HardwareBufferManagerBase::_freeUnusedBufferCopies(void)
-    {
-		OGRE_LOCK_MUTEX(mTempBuffersMutex)
-        size_t numFreed = 0;
-
-        // Free unused temporary buffers
-        FreeTemporaryVertexBufferMap::iterator i;
-        i = mFreeTempVertexBufferMap.begin();
-        while (i != mFreeTempVertexBufferMap.end())
-        {
-            FreeTemporaryVertexBufferMap::iterator icur = i++;
-            // Free the temporary buffer that referenced by ourself only.
-            // TODO: Some temporary buffers are bound to vertex buffer bindings
-            // but not checked out, need to sort out method to unbind them.
-            if (icur->second.use_count() <= 1)
-            {
-                ++numFreed;
-                mFreeTempVertexBufferMap.erase(icur);
-            }
-        }
-
-		// TODO LOG PORT - Log ignored
-        //StringUtil::StrStreamType str;
-        //if (numFreed)
-        //{
-        //    str << "HardwareBufferManager: Freed " << numFreed << " unused temporary vertex buffers.";
-        //}
-        //else
-        //{
-        //    str << "HardwareBufferManager: No unused temporary vertex buffers found.";
-        //}
-        //LogManager::getSingleton().logMessage(str.str(), LML_TRIVIAL);
-    }
-    //-----------------------------------------------------------------------
-    void HardwareBufferManagerBase::_releaseBufferCopies(bool forceFreeUnused)
-    {
-		OGRE_LOCK_MUTEX(mTempBuffersMutex)
-        size_t numUnused = mFreeTempVertexBufferMap.size();
-        size_t numUsed = mTempVertexBufferLicenses.size();
-
-        // Erase the copies which are automatic licensed out
-        TemporaryVertexBufferLicenseMap::iterator i;
-        i = mTempVertexBufferLicenses.begin(); 
-        while (i != mTempVertexBufferLicenses.end()) 
-        {
-            TemporaryVertexBufferLicenseMap::iterator icur = i++;
-            VertexBufferLicense& vbl = icur->second;
-            if (vbl.licenseType == BLT_AUTOMATIC_RELEASE &&
-                (forceFreeUnused || --vbl.expiredDelay <= 0))
-            {
-				vbl.licensee->licenseExpired(vbl.buffer.get());
-
-                mFreeTempVertexBufferMap.insert(
-                    FreeTemporaryVertexBufferMap::value_type(vbl.originalBufferPtr, vbl.buffer));
-                mTempVertexBufferLicenses.erase(icur);
-            }
-        }
-
-        // Check whether or not free unused temporary vertex buffers.
-        if (forceFreeUnused)
-        {
-            _freeUnusedBufferCopies();
-            mUnderUsedFrameCount = 0;
-        }
-        else
-        {
-            if (numUsed < numUnused)
-            {
-                // Free temporary vertex buffers if too many unused for a long time.
-                // Do overall temporary vertex buffers instead of per source buffer
-                // to avoid overhead.
-                ++mUnderUsedFrameCount;
-                if (mUnderUsedFrameCount >= UNDER_USED_FRAME_THRESHOLD)
-                {
-                    _freeUnusedBufferCopies();
-                    mUnderUsedFrameCount = 0;
-                }
-            }
-            else
-            {
-                mUnderUsedFrameCount = 0;
-            }
-        }
-    }
-    //-----------------------------------------------------------------------
-    void HardwareBufferManagerBase::_forceReleaseBufferCopies(
-        const HardwareVertexBufferPtr& sourceBuffer)
-    {
-        _forceReleaseBufferCopies(sourceBuffer.get());
-    }
-    //-----------------------------------------------------------------------
-    void HardwareBufferManagerBase::_forceReleaseBufferCopies(
-        HardwareVertexBuffer* sourceBuffer)
-    {
-		OGRE_LOCK_MUTEX(mTempBuffersMutex)
-        // Erase the copies which are licensed out
-        TemporaryVertexBufferLicenseMap::iterator i;
-        i = mTempVertexBufferLicenses.begin();
-        while (i != mTempVertexBufferLicenses.end()) 
-        {
-            TemporaryVertexBufferLicenseMap::iterator icur = i++;
-            const VertexBufferLicense& vbl = icur->second;
-            if (vbl.originalBufferPtr == sourceBuffer)
-            {
-                // Just tell the owner that this is being released
-                vbl.licensee->licenseExpired(vbl.buffer.get());
-
-                mTempVertexBufferLicenses.erase(icur);
-            }
-        }
-
-        // Erase the free copies
-        //
-        // Why we need this unusual code? It's for resolve reenter problem.
-        //
-        // Using mFreeTempVertexBufferMap.erase(sourceBuffer) directly will
-        // cause reenter into here because vertex buffer destroyed notify.
-        // In most time there are no problem. But when sourceBuffer is the
-        // last item of the mFreeTempVertexBufferMap, some STL multimap
-        // implementation (VC and STLport) will call to clear(), which will
-        // causing intermediate state of mFreeTempVertexBufferMap, in that
-        // time destroyed notify back to here cause illegal accessing in
-        // the end.
-        //
-        // For safely reason, use following code to resolve reenter problem.
-        //
-        typedef FreeTemporaryVertexBufferMap::iterator _Iter;
-        std::pair<_Iter, _Iter> range = mFreeTempVertexBufferMap.equal_range(sourceBuffer);
-        if (range.first != range.second)
-        {
-            list<HardwareVertexBufferPtr>::type holdForDelayDestroy;
-            for (_Iter it = range.first; it != range.second; ++it)
-            {
-                if (it->second.use_count() <= 1)
-                {
-                    holdForDelayDestroy.push_back(it->second);
-                }
-            }
-
-            mFreeTempVertexBufferMap.erase(range.first, range.second);
-
-            // holdForDelayDestroy will destroy auto.
-        }
     }
 	//-----------------------------------------------------------------------
 	void HardwareBufferManagerBase::_notifyVertexBufferDestroyed(HardwareVertexBuffer* buf)
@@ -398,7 +186,6 @@ namespace Ogre {
 		{
             // release vertex buffer copies
 			mVertexBuffers.erase(i);
-            _forceReleaseBufferCopies(buf);
 		}
 	}
 	//-----------------------------------------------------------------------
@@ -423,125 +210,4 @@ namespace Ogre {
             source->getNumVertices(),
             usage, useShadowBuffer);
     }
-    //-----------------------------------------------------------------------------
-    //-----------------------------------------------------------------------------
-    //-----------------------------------------------------------------------------
-    TempBlendedBufferInfo::~TempBlendedBufferInfo(void)
-    {
-        // check that temp buffers have been released
-        if (destPositionBuffer != nullptr)
-            destPositionBuffer->getManager()->releaseVertexBufferCopy(destPositionBuffer);
-        if (destNormalBuffer != nullptr)
-            destNormalBuffer->getManager()->releaseVertexBufferCopy(destNormalBuffer);
-
-    }
-    //-----------------------------------------------------------------------------
-    void TempBlendedBufferInfo::extractFrom(const VertexData* sourceData)
-    {
-        // Release old buffer copies first
-        if (destPositionBuffer != nullptr)
-        {
-            destPositionBuffer->getManager()->releaseVertexBufferCopy(destPositionBuffer);
-            assert(destPositionBuffer == nullptr);
-        }
-        if (destNormalBuffer != nullptr)
-        {
-            destNormalBuffer->getManager()->releaseVertexBufferCopy(destNormalBuffer);
-            assert(destNormalBuffer == nullptr);
-        }
-
-        VertexDeclaration* decl = sourceData->vertexDeclaration;
-        VertexBufferBinding* bind = sourceData->vertexBufferBinding;
-        const VertexElement *posElem = decl->findElementBySemantic(VES_POSITION);
-        const VertexElement *normElem = decl->findElementBySemantic(VES_NORMAL);
-
-        assert(posElem && "Positions are required");
-
-        posBindIndex = posElem->getSource();
-        srcPositionBuffer = bind->getBuffer(posBindIndex);
-
-        if (!normElem)
-        {
-            posNormalShareBuffer = false;
-            srcNormalBuffer = nullptr;
-        }
-        else
-        {
-            normBindIndex = normElem->getSource();
-            if (normBindIndex == posBindIndex)
-            {
-                posNormalShareBuffer = true;
-                srcNormalBuffer = nullptr;
-            }
-            else
-            {
-                posNormalShareBuffer = false;
-                srcNormalBuffer = bind->getBuffer(normBindIndex);
-            }
-        }
-    }
-    //-----------------------------------------------------------------------------
-    void TempBlendedBufferInfo::checkoutTempCopies(bool positions, bool normals)
-    {
-        bindPositions = positions;
-        bindNormals = normals;
-
-        if (positions && destPositionBuffer == nullptr)
-        {
-            destPositionBuffer = srcPositionBuffer->getManager()->allocateVertexBufferCopy(srcPositionBuffer, 
-                HardwareBufferManagerBase::BLT_AUTOMATIC_RELEASE, this);
-        }
-        if (normals && !posNormalShareBuffer && (srcNormalBuffer != nullptr) && (destNormalBuffer == nullptr))
-        {
-            destNormalBuffer = srcNormalBuffer->getManager()->allocateVertexBufferCopy(srcNormalBuffer, 
-                HardwareBufferManagerBase::BLT_AUTOMATIC_RELEASE, this);
-        }
-    }
-	//-----------------------------------------------------------------------------
-	bool TempBlendedBufferInfo::buffersCheckedOut(bool positions, bool normals) const
-	{
-        if (positions || (normals && posNormalShareBuffer))
-        {
-            if (destPositionBuffer == nullptr)
-                return false;
-
-            destPositionBuffer->getManager()->touchVertexBufferCopy(destPositionBuffer);
-        }
-
-        if (normals && !posNormalShareBuffer)
-        {
-            if (destNormalBuffer == nullptr)
-                return false;
-
-            destNormalBuffer->getManager()->touchVertexBufferCopy(destNormalBuffer);
-        }
-
-		return true;
-	}
-    //-----------------------------------------------------------------------------
-    void TempBlendedBufferInfo::bindTempCopies(VertexData* targetData, bool suppressHardwareUpload)
-    {
-        this->destPositionBuffer->suppressHardwareUpdate(suppressHardwareUpload);
-        targetData->vertexBufferBinding->setBinding(
-            this->posBindIndex, this->destPositionBuffer);
-        if (bindNormals && !posNormalShareBuffer && (destNormalBuffer != nullptr))
-        {
-            this->destNormalBuffer->suppressHardwareUpdate(suppressHardwareUpload);
-            targetData->vertexBufferBinding->setBinding(
-                this->normBindIndex, this->destNormalBuffer);
-        }
-    }
-    //-----------------------------------------------------------------------------
-    void TempBlendedBufferInfo::licenseExpired(HardwareBuffer* buffer)
-    {
-        assert(buffer == destPositionBuffer.get()
-            || buffer == destNormalBuffer.get());
-
-        if (buffer == destPositionBuffer.get())
-            destPositionBuffer = nullptr;
-        if (buffer == destNormalBuffer.get())
-            destNormalBuffer = nullptr;
-
-    }
-
 }

+ 3 - 226
CamelotRenderer/OgreHardwareBufferManager.h

@@ -43,57 +43,6 @@ namespace Ogre {
 	*  @{
 	*/
 
-    /** Abstract interface representing a 'licensee' of a hardware buffer copy.
-    remarks
-        Often it's useful to have temporary buffers which are used for working
-        but are not necessarily needed permanently. However, creating and 
-        destroying buffers is expensive, so we need a way to share these 
-        working areas, especially those based on existing fixed buffers. 
-        This class represents a licensee of one of those temporary buffers, 
-        and must be implemented by any user of a temporary buffer if they 
-        wish to be notified when the license is expired. 
-    */
-    class _OgreExport HardwareBufferLicensee
-    {
-    public:
-        virtual ~HardwareBufferLicensee() { }
-        /** This method is called when the buffer license is expired and is about
-        to be returned to the shared pool. */
-        virtual void licenseExpired(HardwareBuffer* buffer) = 0;
-    };
-
-    /** Structure for recording the use of temporary blend buffers */
-    class _OgreExport TempBlendedBufferInfo : public HardwareBufferLicensee
-    {
-    private:
-        // Pre-blended 
-        HardwareVertexBufferPtr srcPositionBuffer;
-        HardwareVertexBufferPtr srcNormalBuffer;
-        // Post-blended 
-        HardwareVertexBufferPtr destPositionBuffer;
-        HardwareVertexBufferPtr destNormalBuffer;
-        /// Both positions and normals are contained in the same buffer
-        bool posNormalShareBuffer;
-        unsigned short posBindIndex;
-        unsigned short normBindIndex;
-        bool bindPositions;
-        bool bindNormals;
-
-    public:
-        ~TempBlendedBufferInfo(void);
-        /// Utility method, extract info from the given VertexData
-        void extractFrom(const VertexData* sourceData);
-        /// Utility method, checks out temporary copies of src into dest
-        void checkoutTempCopies(bool positions = true, bool normals = true);
-        /// Utility method, binds dest copies into a given VertexData struct
-        void bindTempCopies(VertexData* targetData, bool suppressHardwareUpload);
-        /** Overridden member from HardwareBufferLicensee. */
-        void licenseExpired(HardwareBuffer* buffer);
-		/** Detect currently have buffer copies checked out and touch it */
-		bool buffersCheckedOut(bool positions = true, bool normals = true) const;
-    };
-
-
 	/** Base definition of a hardware buffer manager.
 	@remarks
 		This class is deliberately not a Singleton, so that multiple types can 
@@ -145,58 +94,7 @@ namespace Ogre {
 		/// Internal method for destroys a VertexBufferBinding, may be overridden by certain rendering APIs
 		virtual void destroyVertexBufferBindingImpl(VertexBufferBinding* binding);
 
-    public:
-
-        enum BufferLicenseType
-        {
-            /// Licensee will only release buffer when it says so
-            BLT_MANUAL_RELEASE,
-            /// Licensee can have license revoked
-            BLT_AUTOMATIC_RELEASE
-        };
-
     protected:
-        /** Struct holding details of a license to use a temporary shared buffer. */
-        class _OgrePrivate VertexBufferLicense
-        {
-        public:
-            HardwareVertexBuffer* originalBufferPtr;
-            BufferLicenseType licenseType;
-            size_t expiredDelay;
-            HardwareVertexBufferPtr buffer;
-            HardwareBufferLicensee* licensee;
-            VertexBufferLicense(
-                HardwareVertexBuffer* orig,
-                BufferLicenseType ltype, 
-                size_t delay,
-                HardwareVertexBufferPtr buf, 
-                HardwareBufferLicensee* lic) 
-                : originalBufferPtr(orig)
-                , licenseType(ltype)
-                , expiredDelay(delay)
-                , buffer(buf)
-                , licensee(lic)
-            {}
-
-        };
-
-        /// Map from original buffer to temporary buffers
-        typedef multimap<HardwareVertexBuffer*, HardwareVertexBufferPtr>::type FreeTemporaryVertexBufferMap;
-        /// Map of current available temp buffers 
-        FreeTemporaryVertexBufferMap mFreeTempVertexBufferMap;
-        /// Map from temporary buffer to details of a license
-        typedef map<HardwareVertexBuffer*, VertexBufferLicense>::type TemporaryVertexBufferLicenseMap;
-        /// Map of currently licensed temporary buffers
-        TemporaryVertexBufferLicenseMap mTempVertexBufferLicenses;
-        /// Number of frames elapsed since temporary buffers utilization was above half the available
-        size_t mUnderUsedFrameCount;
-        /// Number of frames to wait before free unused temporary buffers
-        static const size_t UNDER_USED_FRAME_THRESHOLD;
-        /// Frame delay for BLT_AUTOMATIC_RELEASE temporary buffers
-        static const size_t EXPIRED_DELAY_FRAME_THRESHOLD;
-		// Mutexes
-		OGRE_MUTEX(mTempBuffersMutex)
-
 
         /// Creates  a new buffer as a copy of the source, does not copy data
         virtual HardwareVertexBufferPtr makeBufferCopy(
@@ -267,15 +165,6 @@ namespace Ogre {
 		/** Destroys a VertexBufferBinding. */
 		virtual void destroyVertexBufferBinding(VertexBufferBinding* binding);
 
-		/** Registers a vertex buffer as a copy of another.
-		@remarks
-			This is useful for registering an existing buffer as a temporary buffer
-			which can be allocated just like a copy.
-		*/
-		virtual void registerVertexBufferSourceAndCopy(
-			const HardwareVertexBufferPtr& sourceBuffer,
-			const HardwareVertexBufferPtr& copy);
-
         /** Allocates a copy of a given vertex buffer.
         @remarks
             This method allocates a temporary copy of an existing vertex buffer.
@@ -293,77 +182,9 @@ namespace Ogre {
             structure of the buffer
         */
         virtual HardwareVertexBufferPtr allocateVertexBufferCopy(
-            const HardwareVertexBufferPtr& sourceBuffer, 
-            BufferLicenseType licenseType,
-            HardwareBufferLicensee* licensee,
+            const HardwareVertexBufferPtr& sourceBuffer,
             bool copyData = false);
 
-        /** Manually release a vertex buffer copy for others to subsequently use.
-        @remarks
-            Only required if the original call to allocateVertexBufferCopy
-            included a licenseType of BLT_MANUAL_RELEASE. 
-        @param bufferCopy The buffer copy. The caller is expected to delete
-            or at least no longer use this reference, since another user may
-            well begin to modify the contents of the buffer.
-        */
-        virtual void releaseVertexBufferCopy(
-            const HardwareVertexBufferPtr& bufferCopy); 
-
-        /** Tell engine that the vertex buffer copy intent to reuse.
-        @remarks
-            Ogre internal keep an expired delay counter of BLT_AUTOMATIC_RELEASE
-            buffers, when the counter count down to zero, it'll release for other
-            purposes later. But you can use this function to reset the counter to
-            the internal configured value, keep the buffer not get released for
-            some frames.
-        @param bufferCopy The buffer copy. The caller is expected to keep this
-            buffer copy for use.
-        */
-        virtual void touchVertexBufferCopy(
-            const HardwareVertexBufferPtr& bufferCopy);
-
-        /** Free all unused vertex buffer copies.
-        @remarks
-            This method free all temporary vertex buffers that not in used.
-            In normally, temporary vertex buffers are subsequently stored and can
-            be made available for other purposes later without incurring the cost
-            of construction / destruction. But in some cases you want to free them
-            to save hardware memory (e.g. application was runs in a long time, you
-            might free temporary buffers periodically to avoid memory overload).
-        */
-        virtual void _freeUnusedBufferCopies(void);
-
-        /** Internal method for releasing all temporary buffers which have been 
-           allocated using BLT_AUTOMATIC_RELEASE; is called by OGRE.
-        @param forceFreeUnused If true, free all unused temporary buffers.
-            If false, auto detect and free all unused temporary buffers based on
-            temporary buffers utilization.
-        */
-        virtual void _releaseBufferCopies(bool forceFreeUnused = false);
-
-        /** Internal method that forces the release of copies of a given buffer.
-        @remarks
-            This usually means that the buffer which the copies are based on has
-            been changed in some fundamental way, and the owner of the original 
-            wishes to make that known so that new copies will reflect the
-            changes.
-        @param sourceBuffer the source buffer as a shared pointer.  Any buffer copies created from the source buffer
-            are deleted.
-        */
-        virtual void _forceReleaseBufferCopies(
-            const HardwareVertexBufferPtr& sourceBuffer);
-
-        /** Internal method that forces the release of copies of a given buffer.
-        @remarks
-            This usually means that the buffer which the copies are based on has
-            been changed in some fundamental way, and the owner of the original 
-            wishes to make that known so that new copies will reflect the
-            changes.
-        @param sourceBuffer the source buffer as a pointer.  Any buffer copies created from the source buffer
-            are deleted.
-        */
-        virtual void _forceReleaseBufferCopies(HardwareVertexBuffer* sourceBuffer);
-
 		/// Notification that a hardware vertex buffer has been destroyed
 		void _notifyVertexBufferDestroyed(HardwareVertexBuffer* buf);
 		/// Notification that a hardware index buffer has been destroyed
@@ -416,56 +237,12 @@ namespace Ogre {
 		{
 			mImpl->destroyVertexBufferBinding(binding);
 		}
-		/** @copydoc HardwareBufferManagerInterface::registerVertexBufferSourceAndCopy */
-		virtual void registerVertexBufferSourceAndCopy(
-			const HardwareVertexBufferPtr& sourceBuffer,
-			const HardwareVertexBufferPtr& copy)
-		{
-			mImpl->registerVertexBufferSourceAndCopy(sourceBuffer, copy);
-		}
 		/** @copydoc HardwareBufferManagerInterface::allocateVertexBufferCopy */
         virtual HardwareVertexBufferPtr allocateVertexBufferCopy(
-            const HardwareVertexBufferPtr& sourceBuffer, 
-            BufferLicenseType licenseType,
-            HardwareBufferLicensee* licensee,
+            const HardwareVertexBufferPtr& sourceBuffer,
             bool copyData = false)
 		{
-			return mImpl->allocateVertexBufferCopy(sourceBuffer, licenseType, licensee, copyData);
-		}
-		/** @copydoc HardwareBufferManagerInterface::releaseVertexBufferCopy */
-        virtual void releaseVertexBufferCopy(
-            const HardwareVertexBufferPtr& bufferCopy)
-		{
-			mImpl->releaseVertexBufferCopy(bufferCopy);
-		}
-
-		/** @copydoc HardwareBufferManagerInterface::touchVertexBufferCopy */
-        virtual void touchVertexBufferCopy(
-            const HardwareVertexBufferPtr& bufferCopy)
-		{
-			mImpl->touchVertexBufferCopy(bufferCopy);
-		}
-
-		/** @copydoc HardwareBufferManagerInterface::_freeUnusedBufferCopies */
-        virtual void _freeUnusedBufferCopies(void)
-		{
-			mImpl->_freeUnusedBufferCopies();
-		}
-		/** @copydoc HardwareBufferManagerInterface::_releaseBufferCopies */
-        virtual void _releaseBufferCopies(bool forceFreeUnused = false)
-		{
-			mImpl->_releaseBufferCopies(forceFreeUnused);
-		}
-		/** @copydoc HardwareBufferManagerInterface::_forceReleaseBufferCopies */
-        virtual void _forceReleaseBufferCopies(
-            const HardwareVertexBufferPtr& sourceBuffer)
-		{
-			mImpl->_forceReleaseBufferCopies(sourceBuffer);
-		}
-		/** @copydoc HardwareBufferManagerInterface::_forceReleaseBufferCopies */
-        virtual void _forceReleaseBufferCopies(HardwareVertexBuffer* sourceBuffer)
-		{
-			mImpl->_forceReleaseBufferCopies(sourceBuffer);
+			return mImpl->allocateVertexBufferCopy(sourceBuffer, copyData);
 		}
 		/** @copydoc HardwareBufferManagerInterface::_notifyVertexBufferDestroyed */
 		void _notifyVertexBufferDestroyed(HardwareVertexBuffer* buf)

+ 0 - 4
CamelotRenderer/OgreVertexIndexData.cpp

@@ -239,10 +239,6 @@ namespace Ogre {
             if (wasSharedBuffer)
                 newRemainderBuffer->unlock();
 
-            // At this stage, he original vertex buffer is going to be destroyed
-            // So we should force the deallocation of any temporary copies
-            vbuf->getManager()->_forceReleaseBufferCopies(vbuf);
-
             if (useVertexPrograms)
             {
                 // Now it's time to set up the w buffer

+ 2 - 3
CamelotRenderer/TODO.txt

@@ -10,6 +10,8 @@ RenderTexture - Everything OK
 RenderWindow - Everything OK
 HardwareIndexBuffer - Everything OK
 RenderSystemCapabilities - I think I need all of that
+HardwareBuffer - Base class for all buffers
+ - Everything seems fine although I /might/ want to explore how the shadow buffer works and if I want to implement it differently?
 
 TODO FILES:
 
@@ -33,9 +35,6 @@ Frustum
 GpuProgramParams - Holds all parameters used in a shader program and allows us to set them by index or name
  - Explore if we can remove GpuSharedParameters. I'm not exactly sure what they're used for
 
-HardwareBuffer - Base class for all buffers
- - Everything seems fine although I /might/ want to explore how the shadow buffer works and if I want to implement it differently?
-
 HardwareBufferManager - Abstracts whether I'm creating D3D9 or OpenGL buffers
  - License stuff needs to be removed. I'm not sure what it's used for