aboutsummaryrefslogtreecommitdiff
path: root/pacc/pacc-gl.c
diff options
context:
space:
mode:
authorTakamichi Horikawa <takamichiho@gmail.com>2017-09-09 11:41:36 +0900
committerTakamichi Horikawa <takamichiho@gmail.com>2017-09-09 11:41:36 +0900
commitcb9c866e9f37dfd1e67cd4f8599391676d3d5150 (patch)
tree0c53d834e53b82c646c3f5671aa5e3b75b3ec995 /pacc/pacc-gl.c
parent7809829bb0ce8b30ebdfb018034cab0e5f4b7632 (diff)
pacc: gl: use newer GLSL for GL3.2/GLES3.0
Diffstat (limited to 'pacc/pacc-gl.c')
-rw-r--r--pacc/pacc-gl.c31
1 files changed, 24 insertions, 7 deletions
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,10 +98,18 @@ 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
};
glShaderSource(s, 2, sourcelist, 0);