shaders: initialize vertexes once

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 <kraxel@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
Gerd Hoffmann 2015-07-10 14:40:01 +02:00
parent 5fdb4671b0
commit c046d82844
3 changed files with 35 additions and 7 deletions

View file

@ -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,