[Bf-blender-cvs] [99db1b8] blender2.8: fix shaders for picky GLSL compilers

Mike Erwin noreply at git.blender.org
Sun Oct 9 16:53:18 CEST 2016


Commit: 99db1b8d9566399f1587ca16df60787ce140e52f
Author: Mike Erwin
Date:   Sun Oct 9 10:53:03 2016 -0400
Branches: blender2.8
https://developer.blender.org/rB99db1b8d9566399f1587ca16df60787ce140e52f

fix shaders for picky GLSL compilers

@zeauro reported this issue:
texture2DRect needs the ARB_texture_rectangle extension.
But isn't that an OpenGL 2.1 feature and should be part of GLSL 1.2+?

This should fix it, and future shaders should do something similar.

===================================================================

M	source/blender/gpu/shaders/gpu_shader_2D_texture_2D_frag.glsl
M	source/blender/gpu/shaders/gpu_shader_2D_texture_rect_frag.glsl

===================================================================

diff --git a/source/blender/gpu/shaders/gpu_shader_2D_texture_2D_frag.glsl b/source/blender/gpu/shaders/gpu_shader_2D_texture_2D_frag.glsl
index d0915eb..e052d8c 100644
--- a/source/blender/gpu/shaders/gpu_shader_2D_texture_2D_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_2D_texture_2D_frag.glsl
@@ -4,6 +4,7 @@
 #else
   in vec2 texture_coord;
   out vec4 fragColor;
+  #define texture2D texture
 #endif
 
 uniform float alpha;
diff --git a/source/blender/gpu/shaders/gpu_shader_2D_texture_rect_frag.glsl b/source/blender/gpu/shaders/gpu_shader_2D_texture_rect_frag.glsl
index bc80501..9dad41d 100644
--- a/source/blender/gpu/shaders/gpu_shader_2D_texture_rect_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_2D_texture_rect_frag.glsl
@@ -4,6 +4,7 @@
 #else
   in vec2 texture_coord;
   out vec4 fragColor;
+  #define texture2DRect texture
 #endif
 
 uniform float alpha;




More information about the Bf-blender-cvs mailing list