Forráskód Böngészése

Stripping down unneeded render system methods #2

Marko Pintera 13 éve
szülő
commit
a10ef7f7b9

+ 2 - 2
CamelotClient/CamelotClient.cpp

@@ -27,8 +27,8 @@ using namespace CamelotEngine;
 
 int _tmain(int argc, _TCHAR* argv[])
 {
-	gApplication().startUp("CamelotGLRenderSystem", "CamelotForwardRenderer");
-	//gApplication().startUp("CamelotD3D9RenderSystem", "CamelotForwardRenderer");
+	//gApplication().startUp("CamelotGLRenderSystem", "CamelotForwardRenderer");
+	gApplication().startUp("CamelotD3D9RenderSystem", "CamelotForwardRenderer");
 
 	RenderSystem* renderSystem = RenderSystemManager::getActive();
 	RenderWindow* renderWindow = gApplication().getPrimaryRenderWindow();

+ 1 - 4
CamelotD3D9Renderer/Include/CmD3D9RenderSystem.h

@@ -274,7 +274,6 @@ namespace CamelotEngine
          */
 		void bindGpuProgramParameters(GpuProgramType gptype, 
 			GpuProgramParametersSharedPtr params, UINT16 variabilityMask);
-        void bindGpuProgramPassIterationParameters(GpuProgramType gptype);
 
         void setScissorTest(bool enabled, size_t left = 0, size_t top = 0, size_t right = 800, size_t bottom = 600);
         void clearFrameBuffer(unsigned int buffers, 
@@ -288,9 +287,7 @@ namespace CamelotEngine
         float getMinimumDepthInputValue();
         float getMaximumDepthInputValue();
 		void registerThread();
-		void unregisterThread();
-		void preExtraThreadsStarted();
-		void postExtraThreadsStarted();		
+		void unregisterThread();	
 		
 		static D3D9ResourceManager* getResourceManager();
 		static D3D9DeviceManager* getDeviceManager();

+ 18 - 124
CamelotD3D9Renderer/Source/CmD3D9RenderSystem.cpp

@@ -99,11 +99,7 @@ namespace CamelotEngine
 
 		mLastVertexSourceCount = 0;
 
-		mCurrentLights.clear();
-
-		// Enumerate events
-		mEventNames.push_back("DeviceLost");
-		mEventNames.push_back("DeviceRestored");			
+		mCurrentLights.clear();			
 	}
 	//---------------------------------------------------------------------
 	D3D9RenderSystem::~D3D9RenderSystem()
@@ -595,17 +591,6 @@ namespace CamelotEngine
 
 			autoWindow = createRenderWindow( windowTitle, width, height, 
 				fullScreen, &miscParams );
-
-			// If we have 16bit depth buffer enable w-buffering.
-			assert( autoWindow );
-			if ( autoWindow->getColourDepth() == 16 ) 
-			{ 
-				mWBuffer = true;
-			} 
-			else 
-			{
-				mWBuffer = false;
-			}
 		}	
 
 		// call superclass method
@@ -1975,13 +1960,7 @@ namespace CamelotEngine
 		HRESULT hr;
 
 		if( enabled )
-		{
-			// Use w-buffer if available and enabled
-			if( mWBuffer && mDeviceManager->getActiveDevice()->getD3D9DeviceCaps().RasterCaps & D3DPRASTERCAPS_WBUFFER )
-				hr = __SetRenderState( D3DRS_ZENABLE, D3DZB_USEW );
-			else
-				hr = __SetRenderState( D3DRS_ZENABLE, D3DZB_TRUE );
-		}
+			hr = __SetRenderState( D3DRS_ZENABLE, D3DZB_TRUE );
 		else
 			hr = __SetRenderState( D3DRS_ZENABLE, D3DZB_FALSE );
 
@@ -2546,47 +2525,24 @@ namespace CamelotEngine
 				CM_EXCEPT(RenderingAPIException, "Failed to set index buffer");
 			}
 
-			do
-			{
-				// Update derived depth bias
-				if (mDerivedDepthBias && mCurrentPassIterationNum > 0)
-				{
-					_setDepthBias(mDerivedDepthBiasBase + 
-						mDerivedDepthBiasMultiplier * mCurrentPassIterationNum, 
-						mDerivedDepthBiasSlopeScale);
-				}
-				// do indexed draw operation
-				hr = getActiveD3D9Device()->DrawIndexedPrimitive(
-					primType, 
-					static_cast<INT>(op.vertexData->vertexStart), 
-					0, // Min vertex index - assume we can go right down to 0 
-					static_cast<UINT>(op.vertexData->vertexCount), 
-					static_cast<UINT>(op.indexData->indexStart), 
-					static_cast<UINT>(primCount)
-					);
-
-			} while (updatePassIterationRenderState());
+			// do indexed draw operation
+			hr = getActiveD3D9Device()->DrawIndexedPrimitive(
+				primType, 
+				static_cast<INT>(op.vertexData->vertexStart), 
+				0, // Min vertex index - assume we can go right down to 0 
+				static_cast<UINT>(op.vertexData->vertexCount), 
+				static_cast<UINT>(op.indexData->indexStart), 
+				static_cast<UINT>(primCount)
+				);
 		}
 		else
 		{
-			// nfz: gpu_iterate
-			do
-			{
-				// Update derived depth bias
-				if (mDerivedDepthBias && mCurrentPassIterationNum > 0)
-				{
-					_setDepthBias(mDerivedDepthBiasBase + 
-						mDerivedDepthBiasMultiplier * mCurrentPassIterationNum, 
-						mDerivedDepthBiasSlopeScale);
-				}
-				// Unindexed, a little simpler!
-				hr = getActiveD3D9Device()->DrawPrimitive(
-					primType, 
-					static_cast<UINT>(op.vertexData->vertexStart), 
-					static_cast<UINT>(primCount)
-					); 
-
-			} while (updatePassIterationRenderState());
+			// Unindexed, a little simpler!
+			hr = getActiveD3D9Device()->DrawPrimitive(
+				primType, 
+				static_cast<UINT>(op.vertexData->vertexStart), 
+				static_cast<UINT>(primCount)
+				); 
 		} 
 
 		if( FAILED( hr ) )
@@ -2665,13 +2621,6 @@ namespace CamelotEngine
 	void D3D9RenderSystem::bindGpuProgramParameters(GpuProgramType gptype, 
 		GpuProgramParametersSharedPtr params, UINT16 variability)
 	{
-		// special case pass iteration
-		if (variability == (UINT16)GPV_PASS_ITERATION_NUMBER)
-		{
-			bindGpuProgramPassIterationParameters(gptype);
-			return;
-		}
-		
 		HRESULT hr;
 		GpuLogicalBufferStructPtr floatLogical = params->getFloatLogicalBufferStruct();
 		GpuLogicalBufferStructPtr intLogical = params->getIntLogicalBufferStruct();
@@ -2805,48 +2754,6 @@ namespace CamelotEngine
 		};
 	}
 	//---------------------------------------------------------------------
-	void D3D9RenderSystem::bindGpuProgramPassIterationParameters(GpuProgramType gptype)
-	{
-
-		HRESULT hr;
-		size_t physicalIndex = 0;
-		size_t logicalIndex = 0;
-		const float* pFloat;
-
-		switch(gptype)
-		{
-		case GPT_VERTEX_PROGRAM:
-			if (mActiveVertexGpuProgramParameters->hasPassIterationNumber())
-			{
-				physicalIndex = mActiveVertexGpuProgramParameters->getPassIterationNumberIndex();
-				logicalIndex = mActiveVertexGpuProgramParameters->getFloatLogicalIndexForPhysicalIndex(physicalIndex);
-				pFloat = mActiveVertexGpuProgramParameters->getFloatPointer(physicalIndex);
-
-				if (FAILED(hr = getActiveD3D9Device()->SetVertexShaderConstantF(
-					static_cast<UINT>(logicalIndex), pFloat, 1)))
-				{
-					CM_EXCEPT(RenderingAPIException, "Unable to upload vertex shader multi pass parameters");
-				}
-			}
-			break;
-
-		case GPT_FRAGMENT_PROGRAM:
-			if (mActiveFragmentGpuProgramParameters->hasPassIterationNumber())
-			{
-				physicalIndex = mActiveFragmentGpuProgramParameters->getPassIterationNumberIndex();
-				logicalIndex = mActiveFragmentGpuProgramParameters->getFloatLogicalIndexForPhysicalIndex(physicalIndex);
-				pFloat = mActiveFragmentGpuProgramParameters->getFloatPointer(physicalIndex);
-				if (FAILED(hr = getActiveD3D9Device()->SetPixelShaderConstantF(
-					static_cast<UINT>(logicalIndex), pFloat, 1)))
-				{
-					CM_EXCEPT(RenderingAPIException, "Unable to upload pixel shader multi pass parameters");
-				}
-			}
-			break;
-
-		}
-	}
-	//---------------------------------------------------------------------
 	void D3D9RenderSystem::setClipPlanesImpl(const PlaneList& clipPlanes)
 	{
 		size_t i;
@@ -3317,16 +3224,6 @@ namespace CamelotEngine
 		// nothing to do - D3D9 shares rendering context already
 	}
 	//---------------------------------------------------------------------
-	void D3D9RenderSystem::preExtraThreadsStarted()
-	{
-		// nothing to do - D3D9 shares rendering context already
-	}
-	//---------------------------------------------------------------------
-	void D3D9RenderSystem::postExtraThreadsStarted()
-	{
-		// nothing to do - D3D9 shares rendering context already
-	}
-	//---------------------------------------------------------------------
 	D3D9ResourceManager* D3D9RenderSystem::getResourceManager()
 	{
 		return msD3D9RenderSystem->mResourceManager;
@@ -3353,8 +3250,7 @@ namespace CamelotEngine
 	//---------------------------------------------------------------------
 	void D3D9RenderSystem::notifyOnDeviceLost(D3D9Device* device)
 	{	
-		// you need to stop the physics or game engines after this event
-		fireEvent("DeviceLost");
+
 	}
 
 	//---------------------------------------------------------------------
@@ -3373,8 +3269,6 @@ namespace CamelotEngine
 		// Reset the texture stages, they will need to be rebound
 		for (size_t i = 0; i < CM_MAX_TEXTURE_LAYERS; ++i)
 			_setTexture(i, false, TexturePtr());
-
-		fireEvent("DeviceRestored");
 	}
 	
 	//---------------------------------------------------------------------

+ 0 - 5
CamelotGLRenderer/Include/CmGLGpuProgram.h

@@ -49,9 +49,6 @@ namespace CamelotEngine {
 
         /// Execute the param binding functions for this program
 		virtual void bindProgramParameters(GpuProgramParametersSharedPtr params, UINT16 mask) {}
-		/// Bind just the pass iteration parameters
-		virtual void bindProgramPassIterationParameters(GpuProgramParametersSharedPtr params) {}
-
 
         /// Get the assigned GL program id
         const GLuint getProgramID(void) const
@@ -97,8 +94,6 @@ namespace CamelotEngine {
         void unbindProgram(void);
         /// Execute the param binding functions for this program
 		void bindProgramParameters(GpuProgramParametersSharedPtr params, UINT16 mask);
-		/// Bind just the pass iteration parameters
-		void bindProgramPassIterationParameters(GpuProgramParametersSharedPtr params);
 
         /// Get the GL type for the program
         const GLuint getProgramType(void) const

+ 0 - 6
CamelotGLRenderer/Include/CmGLRenderSystem.h

@@ -400,10 +400,6 @@ namespace CamelotEngine {
          */
 		void bindGpuProgramParameters(GpuProgramType gptype, 
 			GpuProgramParametersSharedPtr params, UINT16 variabilityMask);
-		/** See
-		  RenderSystem
-		 */
-		void bindGpuProgramPassIterationParameters(GpuProgramType gptype);
         /** See
           RenderSystem
          */
@@ -419,8 +415,6 @@ namespace CamelotEngine {
 		CM_MUTEX(mThreadInitMutex)
 		void registerThread();
 		void unregisterThread();
-		void preExtraThreadsStarted();
-		void postExtraThreadsStarted();
 
         // ----------------------------------
         // GLRenderSystem specific members

+ 0 - 14
CamelotGLRenderer/Source/CmGLGpuProgram.cpp

@@ -192,20 +192,6 @@ void GLArbGpuProgram::bindProgramParameters(GpuProgramParametersSharedPtr params
 	}
 }
 
-void GLArbGpuProgram::bindProgramPassIterationParameters(GpuProgramParametersSharedPtr params)
-{
-    if (params->hasPassIterationNumber())
-    {
-		GLenum type = getGLShaderType(mType);
-
-		size_t physicalIndex = params->getPassIterationNumberIndex();
-		size_t logicalIndex = params->getFloatLogicalIndexForPhysicalIndex(physicalIndex);
-		const float* pFloat = params->getFloatPointer(physicalIndex);
-        glProgramLocalParameter4fvARB(type, (GLuint)logicalIndex, pFloat);
-    }
-
-}
-
 void GLArbGpuProgram::unloadImpl(void)
 {
     glDeleteProgramsARB(1, &mProgramID);

+ 3 - 54
CamelotGLRenderer/Source/CmGLRenderSystem.cpp

@@ -13,7 +13,7 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the Software is
 furnished to do so, subject to the following conditions:
 
-The above copyright notice and this permission notice shall be included in
+The above copyright notice and this permission notice shall be included in*
 all copies or substantial portions of the Software.
 
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
@@ -2330,32 +2330,11 @@ namespace CamelotEngine {
 
 			GLenum indexType = (op.indexData->indexBuffer->getType() == HardwareIndexBuffer::IT_16BIT) ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT;
 
-			do
-			{
-				// Update derived depth bias
-				if (mDerivedDepthBias && mCurrentPassIterationNum > 0)
-				{
-					_setDepthBias(mDerivedDepthBiasBase + 
-						mDerivedDepthBiasMultiplier * mCurrentPassIterationNum, 
-						mDerivedDepthBiasSlopeScale);
-				}
-				glDrawElements(primType, op.indexData->indexCount, indexType, pBufferData);
-			} while (updatePassIterationRenderState());
-
+			glDrawElements(primType, op.indexData->indexCount, indexType, pBufferData);
 		}
 		else
 		{
-			do
-			{
-				// Update derived depth bias
-				if (mDerivedDepthBias && mCurrentPassIterationNum > 0)
-				{
-					_setDepthBias(mDerivedDepthBiasBase + 
-						mDerivedDepthBiasMultiplier * mCurrentPassIterationNum, 
-						mDerivedDepthBiasSlopeScale);
-				}
-				glDrawArrays(primType, 0, op.vertexData->vertexCount);
-			} while (updatePassIterationRenderState());
+			glDrawArrays(primType, 0, op.vertexData->vertexCount);
 		}
 
         glDisableClientState( GL_VERTEX_ARRAY );
@@ -2524,22 +2503,6 @@ namespace CamelotEngine {
 		}
 	}
 	//---------------------------------------------------------------------
-	void GLRenderSystem::bindGpuProgramPassIterationParameters(GpuProgramType gptype)
-	{
-		switch (gptype)
-		{
-		case GPT_VERTEX_PROGRAM:
-			mCurrentVertexProgram->bindProgramPassIterationParameters(mActiveVertexGpuProgramParameters);
-			break;
-		case GPT_GEOMETRY_PROGRAM:
-			mCurrentGeometryProgram->bindProgramPassIterationParameters(mActiveGeometryGpuProgramParameters);
-			break;
-		case GPT_FRAGMENT_PROGRAM:
-			mCurrentFragmentProgram->bindProgramPassIterationParameters(mActiveFragmentGpuProgramParameters);
-			break;
-		}
-	}
-	//---------------------------------------------------------------------
 	void GLRenderSystem::setClipPlanesImpl(const PlaneList& clipPlanes)
 	{
 		// A note on GL user clipping:
@@ -2965,20 +2928,6 @@ namespace CamelotEngine {
 
 	}
 	//---------------------------------------------------------------------
-	void GLRenderSystem::preExtraThreadsStarted()
-	{
-		CM_LOCK_MUTEX(mThreadInitMutex)
-		// free context, we'll need this to share lists
-		mCurrentContext->endCurrent();
-	}
-	//---------------------------------------------------------------------
-	void GLRenderSystem::postExtraThreadsStarted()
-	{
-		CM_LOCK_MUTEX(mThreadInitMutex)
-		// reacquire context
-		mCurrentContext->setCurrent();
-	}
-	//---------------------------------------------------------------------
 	bool GLRenderSystem::activateGLTextureUnit(size_t unit)
 	{
 		if (mActiveTextureUnit != unit)

+ 0 - 2
CamelotGLRenderer/Source/GLSL/include/CmGLSLGpuProgram.h

@@ -69,8 +69,6 @@ namespace CamelotEngine {
 		void unbindProgram(void);
 		/// Execute the param binding functions for this program
 		void bindProgramParameters(GpuProgramParametersSharedPtr params, UINT16 mask);
-		/// Execute the pass iteration param binding functions for this program
-		void bindProgramPassIterationParameters(GpuProgramParametersSharedPtr params);
 
 		/// Get the assigned GL program id
 		const GLuint getProgramID(void) const

+ 0 - 26
CamelotGLRenderer/Source/GLSL/include/CmGLSLLinkProgram.h

@@ -70,8 +70,6 @@ namespace CamelotEngine {
 		GLhandleARB mGLHandle;
 		/// flag indicating that the program object has been successfully linked
 		GLint		mLinked;
-		/// flag indicating skeletal animation is being performed
-		bool mSkeletalAnimation;
 
 		/// build uniform references from active named uniforms
 		void buildGLUniformReferences(void);
@@ -93,9 +91,6 @@ namespace CamelotEngine {
 
 		static CustomAttribute msCustomAttributes[];
 
-
-		
-
 	public:
 		/// constructor should only be used by GLSLLinkProgramManager
 		GLSLLinkProgram(GLSLGpuProgram* vertexProgram, GLSLGpuProgram* geometryProgram, GLSLGpuProgram* fragmentProgram);
@@ -109,34 +104,13 @@ namespace CamelotEngine {
 		normally called by GLSLGpuProgram::bindParameters() just before rendering occurs.
 		*/
 		void updateUniforms(GpuProgramParametersSharedPtr params, UINT16 mask, GpuProgramType fromProgType);
-		/** updates program object uniforms using data from pass iteration GpuProgramParamters.
-		normally called by GLSLGpuProgram::bindMultiPassParameters() just before multi pass rendering occurs.
-		*/
-		void updatePassIterationUniforms(GpuProgramParametersSharedPtr params);
 		/// get the GL Handle for the program object
 		GLhandleARB getGLHandle(void) const { return mGLHandle; }
-        /** Sets whether the linked program includes the required instructions
-        to perform skeletal animation. 
-        @remarks
-        If this is set to true, OGRE will not blend the geometry according to 
-        skeletal animation, it will expect the vertex program to do it.
-        */
-        void setSkeletalAnimationIncluded(bool included) 
-        { mSkeletalAnimation = included; }
-
-        /** Returns whether the linked program includes the required instructions
-            to perform skeletal animation. 
-        @remarks
-            If this returns true, OGRE will not blend the geometry according to 
-            skeletal animation, it will expect the vertex program to do it.
-        */
-        bool isSkeletalAnimationIncluded(void) const { return mSkeletalAnimation; }
 
 		/// Get the index of a non-standard attribute bound in the linked code
 		GLuint getAttributeIndex(VertexElementSemantic semantic, UINT32 index);
 		/// Is a non-standard attribute bound in the linked code?
 		bool isAttributeValid(VertexElementSemantic semantic, UINT32 index);
-
 	};
 
 }

+ 0 - 9
CamelotGLRenderer/Source/GLSL/src/CmGLSLGpuProgram.cpp

@@ -129,15 +129,6 @@ namespace CamelotEngine {
 		linkProgram->updateUniforms(params, mask, mType);
 	}
 
-	//-----------------------------------------------------------------------------
-	void GLSLGpuProgram::bindProgramPassIterationParameters(GpuProgramParametersSharedPtr params)
-	{
-		// activate the link program object
-		GLSLLinkProgram* linkProgram = GLSLLinkProgramManager::instance().getActiveLinkProgram();
-		// pass on parameters from params to program object uniforms
-		linkProgram->updatePassIterationUniforms( params );
-		
-	}
 	//-----------------------------------------------------------------------------
 	GLuint GLSLGpuProgram::getAttributeIndex(VertexElementSemantic semantic, UINT32 index)
 	{

+ 0 - 26
CamelotGLRenderer/Source/GLSL/src/CmGLSLLinkProgram.cpp

@@ -430,30 +430,4 @@ namespace CamelotEngine {
   
   		} // end for
 	}
-
-
-	//-----------------------------------------------------------------------
-	void GLSLLinkProgram::updatePassIterationUniforms(GpuProgramParametersSharedPtr params)
-	{
-		if (params->hasPassIterationNumber())
-		{
-			size_t index = params->getPassIterationNumberIndex();
-
-			GLUniformReferenceIterator currentUniform = mGLUniformReferences.begin();
-			GLUniformReferenceIterator endUniform = mGLUniformReferences.end();
-
-			// need to find the uniform that matches the multi pass entry
-			for (;currentUniform != endUniform; ++currentUniform)
-			{
-				// get the index in the parameter real list
-				if (index == currentUniform->mConstantDef->physicalIndex)
-				{
-					glUniform1fvARB( currentUniform->mLocation, 1, params->getFloatPointer(index));
-					// there will only be one multipass entry
-					return;
-				}
-			}
-		}
-
-    }
 } // namespace CamelotEngine

+ 0 - 4
CamelotGLRenderer/Source/atifs/include/ATI_FS_GLGpuProgram.h

@@ -48,10 +48,6 @@ namespace CamelotEngine {
 		void unbindProgram(void);
 		/// Execute the param binding functions for this program
 		void bindProgramParameters(GpuProgramParametersSharedPtr params, UINT16 mask);
-		/** Execute the pass iteration param binding functions for this program.
-            Only binds those parameters used for multipass rendering
-        */
-        void bindProgramPassIterationParameters(GpuProgramParametersSharedPtr params);
 
 		/// Get the assigned GL program id
 		const GLuint getProgramID(void) const

+ 0 - 13
CamelotGLRenderer/Source/atifs/src/ATI_FS_GLGpuProgram.cpp

@@ -85,19 +85,6 @@ void ATI_FS_GLGpuProgram::bindProgramParameters(GpuProgramParametersSharedPtr pa
 
 }
 
-
-void ATI_FS_GLGpuProgram::bindProgramPassIterationParameters(GpuProgramParametersSharedPtr params)
-{
-	if (params->hasPassIterationNumber())
-	{
-		size_t physicalIndex = params->getPassIterationNumberIndex();
-		size_t logicalIndex = params->getFloatLogicalIndexForPhysicalIndex(physicalIndex);
-		const float* pFloat = params->getFloatPointer(physicalIndex);
-		glSetFragmentShaderConstantATI( GL_CON_0_ATI + (GLuint)logicalIndex, pFloat);
-	}
-}
-
-
 void ATI_FS_GLGpuProgram::unloadImpl(void)
 {
 	glDeleteFragmentShaderATI(mProgramID);

+ 0 - 15
CamelotRenderer/Include/CmGpuProgramParams.h

@@ -85,9 +85,6 @@ namespace CamelotEngine {
 		GPV_PER_OBJECT = 2, 
 		/// Varies with light setup
 		GPV_LIGHTS = 4, 
-		/// Varies with pass iteration number
-		GPV_PASS_ITERATION_NUMBER = 8,
-
 
 		/// Full mask (16-bit)
 		GPV_ALL = 0xFFFF
@@ -440,8 +437,6 @@ namespace CamelotEngine {
 		bool mTransposeMatrices;
 		/// flag to indicate if names not found will be ignored
 		bool mIgnoreMissingParams;
-		/// physical index for active pass iteration parameter real constant entry;
-		size_t mActivePassIterationIndex;
 
 		/** Gets the low-level structure for a logical index. 
 		*/
@@ -977,16 +972,6 @@ namespace CamelotEngine {
 		To merge parameters that match from different programs, use copyMatchingNamedConstantsFrom.
 		*/
 		void copyConstantsFrom(const GpuProgramParameters& source);
-
-		/** increments the multipass number entry by 1 if it exists
-		*/
-		void incPassIterationNumber(void);
-		/** Does this parameters object have a pass iteration number constant? */
-		bool hasPassIterationNumber() const 
-		{ return mActivePassIterationIndex != (std::numeric_limits<size_t>::max)(); }
-		/** Get the physical buffer index of the pass iteration number constant */
-		size_t getPassIterationNumberIndex() const 
-		{ return mActivePassIterationIndex; }
 	};
 
 	/// Shared pointer used to hold references to GpuProgramParameters instances

+ 0 - 137
CamelotRenderer/Include/CmRenderSystem.h

@@ -205,18 +205,6 @@ namespace CamelotEngine
 		*/
 		virtual void shutdown(void);
 
-		/** Sets whether or not W-buffers are enabled if they are available for this renderer.
-		@param
-		enabled If true and the renderer supports them W-buffers will be used.  If false 
-		W-buffers will not be used even if available.  W-buffers are enabled by default 
-		for 16bit depth buffers and disabled for all other depths.
-		*/
-		void setWBufferEnabled(bool enabled);
-
-		/** Returns true if the renderer will try to use W-buffers when avalible.
-		*/
-		bool getWBufferEnabled(void) const;
-
 		/** Creates a new rendering window.
 		@remarks
 		This method creates a new rendering window as specified
@@ -1010,9 +998,6 @@ namespace CamelotEngine
 		virtual void bindGpuProgramParameters(GpuProgramType gptype, 
 			GpuProgramParametersSharedPtr params, UINT16 variabilityMask) = 0;
 
-		/** Only binds Gpu program parameters used for passes that have more than one iteration rendering
-		*/
-		virtual void bindGpuProgramPassIterationParameters(GpuProgramType gptype) = 0;
 		/** Unbinds GpuPrograms of a given GpuProgramType.
 		@remarks
 		This returns the pipeline to fixed-function processing for this type.
@@ -1121,102 +1106,12 @@ namespace CamelotEngine
 		@see Renderable::getUseIdentityView, Renderable::getUseIdentityProjection
 		*/
 		virtual float getMaximumDepthInputValue(void) = 0;
-		/** set the current multi pass count value.  This must be set prior to 
-		calling _render() if multiple renderings of the same pass state are 
-		required.
-		@param count Number of times to render the current state.
-		*/
-		virtual void setCurrentPassIterationCount(const size_t count) { mCurrentPassIterationCount = count; }
-
-		/** Tell the render system whether to derive a depth bias on its own based on 
-		the values passed to it in setCurrentPassIterationCount.
-		The depth bias set will be baseValue + iteration * multiplier
-		@param derive True to tell the RS to derive this automatically
-		@param baseValue The base value to which the multiplier should be
-		added
-		@param multiplier The amount of depth bias to apply per iteration
-		@param slopeScale The constant slope scale bias for completeness
-		*/
-		virtual void setDeriveDepthBias(bool derive, float baseValue = 0.0f,
-			float multiplier = 0.0f, float slopeScale = 0.0f)
-		{
-			mDerivedDepthBias = derive;
-			mDerivedDepthBiasBase = baseValue;
-			mDerivedDepthBiasMultiplier = multiplier;
-			mDerivedDepthBiasSlopeScale = slopeScale;
-		}
 
 		/**
          * Set current render target to target, enabling its device context if needed
          */
         virtual void _setRenderTarget(RenderTarget *target) = 0;
 
-		/** Defines a listener on the custom events that this render system 
-		can raise.
-		@see RenderSystem::addListener
-		*/
-		class CM_EXPORT Listener
-		{
-		public:
-			Listener() {}
-			virtual ~Listener() {}
-
-			/** A rendersystem-specific event occurred.
-			@param eventName The name of the event which has occurred
-			@param parameters A list of parameters that may belong to this event,
-			may be null if there are no parameters
-			*/
-			virtual void eventOccurred(const String& eventName, 
-				const NameValuePairList* parameters = 0) = 0;
-		};
-		/** Adds a listener to the custom events that this render system can raise.
-		@remarks
-		Some render systems have quite specific, internally generated events 
-		that the application may wish to be notified of. Many applications
-		don't have to worry about these events, and can just trust OGRE to 
-		handle them, but if you want to know, you can add a listener here.
-		@par
-		Events are raised very generically by string name. Perhaps the most 
-		common example of a render system specific event is the loss and 
-		restoration of a device in DirectX; which OGRE deals with, but you 
-		may wish to know when it happens. 
-		@see RenderSystem::getRenderSystemEvents
-		*/
-		virtual void addListener(Listener* l);
-		/** Remove a listener to the custom events that this render system can raise.
-		*/
-		virtual void removeListener(Listener* l);
-
-		/** Gets a list of the rendersystem specific events that this rendersystem
-		can raise.
-		@see RenderSystem::addListener
-		*/
-		virtual const std::vector<CamelotEngine::String>& getRenderSystemEvents(void) const { return mEventNames; }
-
-		/** Tell the rendersystem to perform any prep tasks it needs to directly
-		before other threads which might access the rendering API are registered.
-		@remarks
-		Call this from your main thread before starting your other threads
-		(which themselves should call registerThread()). Note that if you
-		start your own threads, there is a specific startup sequence which 
-		must be respected and requires synchronisation between the threads:
-		<ol>
-		<li>[Main thread]Call preExtraThreadsStarted</li>
-		<li>[Main thread]Start other thread, wait</li>
-		<li>[Other thread]Call registerThread, notify main thread & continue</li>
-		<li>[Main thread]Wake up & call postExtraThreadsStarted</li>
-		</ol>
-		Once this init sequence is completed the threads are independent but
-		this startup sequence must be respected.
-		*/
-		virtual void preExtraThreadsStarted() = 0;
-
-		/* Tell the rendersystem to perform any tasks it needs to directly
-		after other threads which might access the rendering API are registered.
-		@see RenderSystem::preExtraThreadsStarted
-		*/
-		virtual void postExtraThreadsStarted() = 0;
-
 		/** Register the an additional thread which may make calls to rendersystem-related 
 		objects.
 		@remarks
@@ -1260,7 +1155,6 @@ namespace CamelotEngine
 
 		bool mVSync;
 		unsigned int mVSyncInterval;
-		bool mWBuffer;
 
 		size_t mBatchCount;
 		size_t mFaceCount;
@@ -1274,30 +1168,6 @@ namespace CamelotEngine
 		/// Texture units from this upwards are disabled
 		size_t mDisabledTexUnitsFrom;
 
-		/// number of times to render the current state
-		size_t mCurrentPassIterationCount;
-		size_t mCurrentPassIterationNum;
-		/// Whether to update the depth bias per render call
-		bool mDerivedDepthBias;
-		float mDerivedDepthBiasBase;
-		float mDerivedDepthBiasMultiplier;
-		float mDerivedDepthBiasSlopeScale;
-
-		/** updates pass iteration rendering state including bound gpu program parameter
-		pass iteration auto constant entry
-		@returns True if more iterations are required
-		*/
-		bool updatePassIterationRenderState(void);
-
-		/// List of names of events this rendersystem may raise
-		std::vector<CamelotEngine::String> mEventNames;
-
-		/// Internal method for firing a rendersystem event
-		virtual void fireEvent(const String& name, const NameValuePairList* params = 0);
-
-		typedef list<Listener*>::type ListenerList;
-		ListenerList mEventListeners;
-
 		typedef list<HardwareOcclusionQuery*>::type HardwareOcclusionQueryList;
 		HardwareOcclusionQueryList mHwOcclusionQueries;
 
@@ -1321,14 +1191,7 @@ namespace CamelotEngine
 		/** Initialize the render system from the capabilities*/
 		virtual void initialiseFromRenderSystemCapabilities(RenderSystemCapabilities* caps, RenderTarget* primary) = 0;
 
-
 		DriverVersion mDriverVersion;
-
-		bool mTexProjRelative;
-		Vector3 mTexProjRelativeOrigin;
-
-
-
 	};
 	/** @} */
 	/** @} */

+ 0 - 11
CamelotRenderer/Source/CmGpuProgramParams.cpp

@@ -89,7 +89,6 @@ namespace CamelotEngine
 		mCombinedVariability(GPV_GLOBAL)
 		, mTransposeMatrices(false)
 		, mIgnoreMissingParams(false)
-		, mActivePassIterationIndex(std::numeric_limits<size_t>::max())	
 	{
 	}
 	//-----------------------------------------------------------------------------
@@ -114,7 +113,6 @@ namespace CamelotEngine
 		mCombinedVariability = oth.mCombinedVariability;
 		mTransposeMatrices = oth.mTransposeMatrices;
 		mIgnoreMissingParams  = oth.mIgnoreMissingParams;
-		mActivePassIterationIndex = oth.mActivePassIterationIndex;
 
 		return *this;
 	}
@@ -881,14 +879,5 @@ namespace CamelotEngine
 		mIntConstants = source.getIntConstantList();
 		mCombinedVariability = source.mCombinedVariability;
 	}
-	//-----------------------------------------------------------------------
-	void GpuProgramParameters::incPassIterationNumber(void)
-	{
-		if (mActivePassIterationIndex != std::numeric_limits<size_t>::max())
-		{
-			// This is a physical index
-			++mFloatConstants[mActivePassIterationIndex];
-		}
-	}
 }
 

+ 1 - 66
CamelotRenderer/Source/CmRenderSystem.cpp

@@ -53,11 +53,8 @@ namespace CamelotEngine {
         , mCullingMode(CULL_CLOCKWISE)
         , mVSync(true)
 		, mVSyncInterval(1)
-		, mWBuffer(false)
         , mInvertVertexWinding(false)
         , mDisabledTexUnitsFrom(0)
-        , mCurrentPassIterationCount(0)
-		, mDerivedDepthBias(false)
         , mVertexProgramBound(false)
 		, mGeometryProgramBound(false)
         , mFragmentProgramBound(false)
@@ -65,8 +62,6 @@ namespace CamelotEngine {
 		, mRealCapabilities(0)
 		, mCurrentCapabilities(0)
 		, mUseCustomCapabilities(false)
-		, mTexProjRelative(false)
-		, mTexProjRelativeOrigin(Vector3::ZERO)
     {
     }
 
@@ -373,15 +368,6 @@ namespace CamelotEngine {
     {
         mVSync = enabled;
     }
-    bool RenderSystem::getWBufferEnabled(void) const
-    {
-        return mWBuffer;
-    }
-    //-----------------------------------------------------------------------
-    void RenderSystem::setWBufferEnabled(bool enabled)
-    {
-        mWBuffer = enabled;
-    }
     //-----------------------------------------------------------------------
     void RenderSystem::shutdown(void)
     {
@@ -455,11 +441,6 @@ namespace CamelotEngine {
         else
             val = op.vertexData->vertexCount;
 
-        // account for a pass having multiple iterations
-        if (mCurrentPassIterationCount > 1)
-            val *= mCurrentPassIterationCount;
-		mCurrentPassIterationNum = 0;
-
         switch(op.operationType)
         {
 		case RenderOperation::OT_TRIANGLE_LIST:
@@ -476,7 +457,7 @@ namespace CamelotEngine {
 	    }
 
         mVertexCount += op.vertexData->vertexCount;
-        mBatchCount += mCurrentPassIterationCount;
+        mBatchCount += 1;
 
 		// sort out clip planes
 		// have to do it here in case of matrix issues
@@ -530,52 +511,6 @@ namespace CamelotEngine {
     {
 		// TODO PORT - Not used in the port. Should probably be removed
     }
-
-	//---------------------------------------------------------------------
-    bool RenderSystem::updatePassIterationRenderState(void)
-    {
-        if (mCurrentPassIterationCount <= 1)
-            return false;
-
-        --mCurrentPassIterationCount;
-		++mCurrentPassIterationNum;
-        if (mActiveVertexGpuProgramParameters != nullptr)
-        {
-            mActiveVertexGpuProgramParameters->incPassIterationNumber();
-            bindGpuProgramPassIterationParameters(GPT_VERTEX_PROGRAM);
-        }
-        if (mActiveGeometryGpuProgramParameters != nullptr)
-        {
-            mActiveGeometryGpuProgramParameters->incPassIterationNumber();
-            bindGpuProgramPassIterationParameters(GPT_GEOMETRY_PROGRAM);
-        }
-        if (mActiveFragmentGpuProgramParameters != nullptr)
-        {
-            mActiveFragmentGpuProgramParameters->incPassIterationNumber();
-            bindGpuProgramPassIterationParameters(GPT_FRAGMENT_PROGRAM);
-        }
-        return true;
-    }
-
-	//-----------------------------------------------------------------------
-	void RenderSystem::addListener(Listener* l)
-	{
-		mEventListeners.push_back(l);
-	}
-	//-----------------------------------------------------------------------
-	void RenderSystem::removeListener(Listener* l)
-	{
-		mEventListeners.remove(l);
-	}
-	//-----------------------------------------------------------------------
-	void RenderSystem::fireEvent(const String& name, const NameValuePairList* params)
-	{
-		for(ListenerList::iterator i = mEventListeners.begin(); 
-			i != mEventListeners.end(); ++i)
-		{
-			(*i)->eventOccurred(name, params);
-		}
-	}
 	//-----------------------------------------------------------------------
 	void RenderSystem::destroyHardwareOcclusionQuery( HardwareOcclusionQuery *hq)
 	{