Quad: Don't discard VBO on each update
This never yielded any traceable performance gains. I also apparently forgot to unbind the buffer after updating.
This commit is contained in:
		
							parent
							
								
									8dd7c1b48c
								
							
						
					
					
						commit
						e74f889bc5
					
				
					 1 changed files with 4 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -112,6 +112,8 @@ struct Quad
 | 
			
		|||
		VBO::bind(vbo);
 | 
			
		||||
		shState->bindQuadIBO();
 | 
			
		||||
 | 
			
		||||
		VBO::allocEmpty(sizeof(Vertex[4]), GL_DYNAMIC_DRAW);
 | 
			
		||||
 | 
			
		||||
		glEnableVertexAttribArray(Shader::Color);
 | 
			
		||||
		glEnableVertexAttribArray(Shader::Position);
 | 
			
		||||
		glEnableVertexAttribArray(Shader::TexCoord);
 | 
			
		||||
| 
						 | 
				
			
			@ -136,8 +138,8 @@ struct Quad
 | 
			
		|||
	void updateBuffer()
 | 
			
		||||
	{
 | 
			
		||||
		VBO::bind(vbo);
 | 
			
		||||
		VBO::allocEmpty(sizeof(Vertex) * 4, GL_DYNAMIC_DRAW);
 | 
			
		||||
		VBO::uploadData(sizeof(Vertex) * 4, vert, GL_DYNAMIC_DRAW);
 | 
			
		||||
		VBO::uploadSubData(0, sizeof(Vertex[4]), vert);
 | 
			
		||||
		VBO::unbind();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	void setPosRect(const FloatRect &r)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue