OSDN Git Service

[Qt][GLES3] Win32: More fix shader-compilation errors with Angle Project.
authorK.Ohta <whatisthis.sowhat@gmail.com>
Sun, 5 Jan 2020 16:48:56 +0000 (01:48 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Sun, 5 Jan 2020 16:48:56 +0000 (01:48 +0900)
source/src/qt/gui/gles2/chromakey_fragment_shader.glsl
source/src/qt/gui/gles2/chromakey_fragment_shader2.glsl
source/src/qt/gui/gles2/icon_fragment_shader.glsl
source/src/qt/gui/gles2/normal_fragment_shader.glsl

index 4f45cf1..e593890 100644 (file)
@@ -29,8 +29,11 @@ void main ()
        vec4 pixel_r_1;
        vec4 pixel;
 
+#if __VERSION__ >= 300
+       pixel_r_1 = texture(a_texture, v_texcoord);
+#else
        pixel_r_1 = texture2D(a_texture, v_texcoord);
-       
+#endif 
        if(do_chromakey) {
                if(pixel_r_1.rgb != chromakey.rgb) {
                        pixel_r_1 = pixel_r_1 * color;
index 001c8d5..168a7ae 100644 (file)
@@ -28,7 +28,11 @@ void main ()
        vec4 pixel_r_1;
        vec4 pixel;
        
+#if __VERSION__ >= 300
+       pixel_r_1 = texture(a_texture, v_texcoord);
+#else
        pixel_r_1 = texture2D(a_texture, v_texcoord);
+#endif
 //#ifdef HOST_ENDIAN_IS_LITTLE
 //     pixel_r_1.rgb = pixel_r_1.bgr;
 //#endif
index 4ef3804..35444ff 100644 (file)
@@ -27,7 +27,11 @@ void main ()
        vec4 pixel_r_1;
        vec4 pixel;
        float alpha;
+#if __VERSION__ >= 300
+       pixel_r_1 = texture(a_texture, v_texcoord);
+#else
        pixel_r_1 = texture2D(a_texture, v_texcoord);
+#endif
        //alpha = pixel_r_1.a * color.a;
 
        pixel_r_1 = pixel_r_1 * color;
index 26854ea..262ed1e 100644 (file)
@@ -11,7 +11,7 @@ uniform mediump vec4 color;
 void main ()
 {
 #if __VERSION__ >= 300
-       opixel = (texture2D (a_texture, v_texcoord) * color);
+       opixel = (texture(a_texture, v_texcoord) * color);
 #else
        gl_FragColor = (texture2D (a_texture, v_texcoord) * color);
 #endif