May 25, 2018 updates: Privacy Policy
  • R/O
  • HTTP
  • SSH
  • HTTPS

common_source_project-fm7: Commit

Common Source Code Project for Qt (a.k.a for FM-7).


Commit MetaInfo

Revision98c7921b4f454778199d69405a1378a25c497f29 (tree)
Time2018-05-14 04:14:51
AuthorK.Ohta <whatisthis.sowhat@gmai...>
CommiterK.Ohta

Log Message

[Qt][OpenGL][GLES] GLSL: Update precision of float value.

Change Summary

Incremental Difference

--- a/source/src/qt/gui/gles2/chromakey_fragment_shader.glsl
+++ b/source/src/qt/gui/gles2/chromakey_fragment_shader.glsl
@@ -1,4 +1,16 @@
1+#ifdef HAS_FLOAT_TEXTURE
2+#ifdef HAS_HALF_FLOAT_TEXTURE
3+#extension GL_OES_texture_half_float : enable
4+#else
5+#extension GL_OES_texture_float : enable
6+#endif
7+#endif
8+#ifdef HAS_FRAGMENT_HIGH_PRECISION
9+#extension GL_OES_fragment_precision_high : enable
10+precision highp float;
11+#else
112 precision mediump float;
13+#endif
214
315 varying mediump vec2 v_texcoord;
416 uniform vec4 color;
--- a/source/src/qt/gui/gles2/chromakey_fragment_shader2.glsl
+++ b/source/src/qt/gui/gles2/chromakey_fragment_shader2.glsl
@@ -1,4 +1,16 @@
1+#ifdef HAS_FLOAT_TEXTURE
2+#ifdef HAS_HALF_FLOAT_TEXTURE
3+#extension GL_OES_texture_half_float : enable
4+#else
5+#extension GL_OES_texture_float : enable
6+#endif
7+#endif
8+#ifdef HAS_FRAGMENT_HIGH_PRECISION
9+#extension GL_OES_fragment_precision_high : enable
10+precision highp float;
11+#else
112 precision mediump float;
13+#endif
214
315 varying vec2 v_texcoord;
416 uniform vec4 color;
--- a/source/src/qt/gui/gles2/fragment_shader.glsl
+++ b/source/src/qt/gui/gles2/fragment_shader.glsl
@@ -1,10 +1,24 @@
1+#ifdef HAS_FLOAT_TEXTURE
2+#ifdef HAS_HALF_FLOAT_TEXTURE
3+#extension GL_OES_texture_half_float : enable
4+#else
5+#extension GL_OES_texture_float : enable
6+#endif
7+#endif
8+#ifdef HAS_FRAGMENT_HIGH_PRECISION
9+#extension GL_OES_fragment_precision_high : enable
10+precision highp float;
11+#else
12+precision mediump float;
13+#endif
14+
115 varying mediump vec2 v_texcoord;
216 uniform sampler2D a_texture;
317 uniform bool swap_byteorder;
418 void main ()
519 {
620 if(swap_byteorder) {
7- mediump vec4 pixel = texture2D(a_texture, v_texcoord);
21+ vec4 pixel = texture2D(a_texture, v_texcoord);
822 pixel.rgb = pixel.bgr;
923 gl_FragColor = pixel;
1024 } else {
--- a/source/src/qt/gui/gles2/grids_fragment_shader.glsl
+++ b/source/src/qt/gui/gles2/grids_fragment_shader.glsl
@@ -1,4 +1,18 @@
1-uniform mediump vec4 color;
1+#ifdef HAS_FLOAT_TEXTURE
2+#ifdef HAS_HALF_FLOAT_TEXTURE
3+#extension GL_OES_texture_half_float : enable
4+#else
5+#extension GL_OES_texture_float : enable
6+#endif
7+#endif
8+#ifdef HAS_FRAGMENT_HIGH_PRECISION
9+#extension GL_OES_fragment_precision_high : enable
10+precision highp float;
11+#else
12+precision mediump float;
13+#endif
14+
15+uniform vec4 color;
216 void main ()
317 {
418 gl_FragColor = color;
--- a/source/src/qt/gui/gles2/icon_fragment_shader.glsl
+++ b/source/src/qt/gui/gles2/icon_fragment_shader.glsl
@@ -1,13 +1,27 @@
1-varying mediump vec2 v_texcoord;
2-uniform mediump vec4 color;
3-uniform mediump vec3 chromakey;
1+#ifdef HAS_FLOAT_TEXTURE
2+#ifdef HAS_HALF_FLOAT_TEXTURE
3+#extension GL_OES_texture_half_float : enable
4+#else
5+#extension GL_OES_texture_float : enable
6+#endif
7+#endif
8+#ifdef HAS_FRAGMENT_HIGH_PRECISION
9+#extension GL_OES_fragment_precision_high : enable
10+precision highp float;
11+#else
12+precision mediump float;
13+#endif
14+
15+varying vec2 v_texcoord;
16+uniform vec4 color;
17+uniform vec3 chromakey;
418 uniform bool do_chromakey;
519 uniform sampler2D a_texture;
620 void main ()
721 {
8- mediump vec4 pixel_r_1;
9- mediump vec4 pixel;
10- mediump float alpha;
22+ vec4 pixel_r_1;
23+ vec4 pixel;
24+ float alpha;
1125 pixel_r_1 = texture2D(a_texture, v_texcoord);
1226 //alpha = pixel_r_1.a * color.a;
1327
--- a/source/src/qt/gui/gles2/led_fragment_shader.glsl
+++ b/source/src/qt/gui/gles2/led_fragment_shader.glsl
@@ -1,4 +1,18 @@
1-uniform mediump vec4 color;
1+#ifdef HAS_FLOAT_TEXTURE
2+#ifdef HAS_HALF_FLOAT_TEXTURE
3+#extension GL_OES_texture_half_float : enable
4+#else
5+#extension GL_OES_texture_float : enable
6+#endif
7+#endif
8+#ifdef HAS_FRAGMENT_HIGH_PRECISION
9+#extension GL_OES_fragment_precision_high : enable
10+precision highp float;
11+#else
12+precision mediump float;
13+#endif
14+
15+uniform vec4 color;
216 void main ()
317 {
418 gl_FragColor = color;
--- a/source/src/qt/gui/gles2/ntsc_pass1.glsl
+++ b/source/src/qt/gui/gles2/ntsc_pass1.glsl
@@ -1,7 +1,15 @@
11 // NTSC Shader - written by Hans-Kristian Arntzen
22 // License: GPLv3
33 // pulled from git://github.com/libretro/common-shaders.git on 01/30/2014
4+#ifdef HAS_FLOAT_TEXTURE
5+#ifdef HAS_HALF_FLOAT_TEXTURE
6+#extension GL_OES_texture_half_float : enable
7+#else
8+#extension GL_OES_texture_float : enable
9+#endif
10+#endif
411 #ifdef HAS_FRAGMENT_HIGH_PRECISION
12+#extension GL_OES_fragment_precision_high : enable
513 precision highp float;
614 #else
715 precision mediump float;
--- a/source/src/qt/gui/gles2/ntsc_pass2.glsl
+++ b/source/src/qt/gui/gles2/ntsc_pass2.glsl
@@ -1,12 +1,20 @@
11 // NTSC Shader - written by Hans-Kristian Arntzen
22 // License: GPLv3
33 // pulled from git://github.com/libretro/common-shaders.git on 01/30/2014
4-
4+#ifdef HAS_FLOAT_TEXTURE
5+#ifdef HAS_HALF_FLOAT_TEXTURE
6+#extension GL_OES_texture_half_float : enable
7+#else
8+#extension GL_OES_texture_float : enable
9+#endif
10+#endif
511 #ifdef HAS_FRAGMENT_HIGH_PRECISION
12+#extension GL_OES_fragment_precision_high : enable
613 precision highp float;
714 #else
815 precision mediump float;
916 #endif
17+
1018 varying mediump vec2 v_texcoord;
1119
1220 uniform bool swap_byteorder;
Show on old repository browser