 			var passes			: Array				= _passes.concat();
 			var clearedTargets	: Dictionary		= new Dictionary(true);
 			
-			for (i = 0; i < numPasses; ++i)
-			{
-				var pass			: ShaderInstance	= passes[i];
+			for (passId = 0; passId < numPasses; ++passId)
+			{
+				var pass			: ShaderInstance	= passes[passId];
 				var calls 			: Array				= _passInstanceToDrawCalls[pass];
 				var settings		: ShaderSettings	= pass.settings;
 				var renderTarget 	: RenderTarget 		= settings.renderTarget || backBuffer;

			var numTriangles	: uint 				= 0;
			
			var sortValues 		: Vector.<Number> 	= TMP_NUMBERS;
			var i				: uint				= 0;
			
			context.enableErrorChecking = (Minko.debugLevel & DebugLevel.CONTEXT) != 0;
			
			// sort passes
			if (!_passesAreSorted && numPasses > 1)
			{
				for (i = 0; i < numPasses; ++i)
					sortValues[i] = -(_passes[i] as ShaderInstance).settings.priority;
				
				Sort.flashSort(sortValues, _passes, numPasses);
				_passesAreSorted = true;

				clearedTargets[renderTarget] = true;
				
				if (!pass.settings.enabled || !pass.shader.enabled || !calls)
                {
                    previous = pass;
					continue;
                }
				
				++_numEnabledPasses;
				
