From cb9c866e9f37dfd1e67cd4f8599391676d3d5150 Mon Sep 17 00:00:00 2001 From: Takamichi Horikawa Date: Sat, 9 Sep 2017 11:41:36 +0900 Subject: pacc: gl: use newer GLSL for GL3.2/GLES3.0 --- pacc/pacc-gl.c | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) (limited to 'pacc/pacc-gl.c') diff --git a/pacc/pacc-gl.c b/pacc/pacc-gl.c index e6ed0a1..71435de 100644 --- a/pacc/pacc-gl.c +++ b/pacc/pacc-gl.c @@ -13,21 +13,30 @@ /* OpenGL versions: - OpenGL 2.0 - OpenGL 3.2 core (#define PACC_GL_3) - OpenGL ES 2.0 (#define PACC_GL_ES) - OpenGL ES 3.0 (#define PACC_GL_ES, #define PACC_GL_3) - - Shader languages: - GLSL 1.10 / GLSL ES 1.00 + OpenGL 2.0 / GLSL 1.10 + OpenGL 3.2 core / GLSL 1.50 core (#define PACC_GL_3) + OpenGL ES 2.0 / GLSL ES 1.00 (#define PACC_GL_ES) + OpenGL ES 3.0 / GLSL ES 3.00 (#define PACC_GL_ES, #define PACC_GL_3) */ #ifdef PACC_GL_ES + +#ifdef PACC_GL_3 +#include "glsl/es3header.inc" +#else #include "glsl/esheader.inc" +#endif + +#else + +#ifdef PACC_GL_3 +#include "glsl/ds3header.inc" #else #include "glsl/dsheader.inc" #endif +#endif + #include "glsl/blit.vert.inc" #include "glsl/copy.frag.inc" #include "glsl/color.frag.inc" @@ -89,9 +98,17 @@ static GLuint compile_shader(const uint8_t *ss, GLenum type) { if (!s) goto err; const char *sourcelist[2] = { #ifdef PACC_GL_ES +#ifdef PACC_GL_3 + (const char *)es3header, +#else (const char *)esheader, +#endif +#else +#ifdef PACC_GL_3 + (const char *)ds3header, #else (const char *)dsheader, +#endif #endif (const char *)ss }; -- cgit v1.2.3