From c046d8284474a0f7763dea849433bde37a69023d Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Fri, 10 Jul 2015 14:40:01 +0200 Subject: shaders: initialize vertexes once MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Create a buffer for the vertex data and place vertexes there at initialization time. Then just use the buffer for each texture blit. Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-André Lureau Reviewed-by: Max Reitz --- ui/console-gl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'ui/console-gl.c') diff --git a/ui/console-gl.c b/ui/console-gl.c index cb45cf8..baf397b 100644 --- a/ui/console-gl.c +++ b/ui/console-gl.c @@ -33,6 +33,7 @@ struct ConsoleGLState { GLint texture_blit_prog; + GLint texture_blit_vao; }; /* ---------------------------------------------------------------------- */ @@ -47,6 +48,9 @@ ConsoleGLState *console_gl_init_context(void) exit(1); } + gls->texture_blit_vao = + qemu_gl_init_texture_blit(gls->texture_blit_prog); + return gls; } @@ -131,7 +135,8 @@ void surface_gl_render_texture(ConsoleGLState *gls, glClearColor(0.1f, 0.1f, 0.1f, 0.0f); glClear(GL_COLOR_BUFFER_BIT); - qemu_gl_run_texture_blit(gls->texture_blit_prog); + qemu_gl_run_texture_blit(gls->texture_blit_prog, + gls->texture_blit_vao); } void surface_gl_destroy_texture(ConsoleGLState *gls, -- cgit v1.1