From 46e19e149f3b129a22c440caba853188df67deab Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 10 Oct 2017 15:54:49 +0200 Subject: opengl: move shader init from console-gl.c to shader.c With the upcoming dmabuf support in qemu there will be more users of the shaders than just console-gl.c. So rename ConsoleGLState to QemuGLShader, rename some functions too, move code from console-gl.c to shaders.c. No functional change. Signed-off-by: Gerd Hoffmann Message-id: 20171010135453.6704-3-kraxel@redhat.com --- include/ui/shader.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'include/ui/shader.h') diff --git a/include/ui/shader.h b/include/ui/shader.h index f7d8618..369e498 100644 --- a/include/ui/shader.h +++ b/include/ui/shader.h @@ -3,13 +3,11 @@ #include -GLuint qemu_gl_init_texture_blit(GLint texture_blit_prog); -void qemu_gl_run_texture_blit(GLint texture_blit_prog, - GLint texture_blit_vao); - -GLuint qemu_gl_create_compile_shader(GLenum type, const GLchar *src); -GLuint qemu_gl_create_link_program(GLuint vert, GLuint frag); -GLuint qemu_gl_create_compile_link_program(const GLchar *vert_src, - const GLchar *frag_src); +typedef struct QemuGLShader QemuGLShader; + +void qemu_gl_run_texture_blit(QemuGLShader *gls); + +QemuGLShader *qemu_gl_init_shader(void); +void qemu_gl_fini_shader(QemuGLShader *gls); #endif /* QEMU_SHADER_H */ -- cgit v1.1 From 2e1d70b9e03ca3f1c6185b54010bc9e47e0a0d0c Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 10 Oct 2017 15:54:50 +0200 Subject: opengl: add flipping vertex shader Add vertex shader which flips the texture upside down while blitting it. Add argument to qemu_gl_run_texture_blit() to enable flipping. Signed-off-by: Gerd Hoffmann Message-id: 20171010135453.6704-4-kraxel@redhat.com --- include/ui/shader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/ui/shader.h') diff --git a/include/ui/shader.h b/include/ui/shader.h index 369e498..4c5acb2 100644 --- a/include/ui/shader.h +++ b/include/ui/shader.h @@ -5,7 +5,7 @@ typedef struct QemuGLShader QemuGLShader; -void qemu_gl_run_texture_blit(QemuGLShader *gls); +void qemu_gl_run_texture_blit(QemuGLShader *gls, bool flip); QemuGLShader *qemu_gl_init_shader(void); void qemu_gl_fini_shader(QemuGLShader *gls); -- cgit v1.1