
/**
 * quad  this.engine.quad.draw( shader );
**/

class renderPipeline  {
	
	constructor( viewport ) {
		
		this.viewport = viewport;
		
		this.renderPasses = [];
		
	}
	
	/**
	 * set viewport
	 * @param {(viewport)} viewport
	**/
	setViewport( viewport ){
		
		this.viewport = viewport;
		
	}
	
	
	/**
	 * Add renderpass
	 * @param {(renderpass)} renderpass
	**/
	addRenderpass( renderPass, name ){
		
		renderPass.setViewport( this.viewport );
		
		if(name) {
			renderPass.name = name;
		}

		
		renderPass.prepare();
		
		
		if(renderPass.isDefault) {
			renderPass.prepareDefault();
		}
		
		
		this.renderPasses.push( renderPass );
	}
	
	
	
	getRenderpass( name ){
		
		for(var c = 0; c < this.renderPasses.length; c++) {
			
			var renderpass = this.renderPasses[c];
			
			if(renderpass.name == name) {
				return renderpass;
			}
			
		}
	}
	getRenderPasses(){
		
		return this.renderPasses;
		
	}

}

export {renderPipeline as default};