Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-03-13 22:00:13 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-03-13 22:00:13 +0400
commit5ff0daf1acdc5d88afcec016a379b33cb2cd1288 (patch)
treed0c56acef2add2ad16bbd9cbbbebccaaadd53104 /source/blender/gpu/shaders
parent1d73ee50a48012712bc2846602fb475bb76f7c21 (diff)
Fix #34492: clipping border not working with GLSL/matcap and Nouveau drivers.
Diffstat (limited to 'source/blender/gpu/shaders')
-rw-r--r--source/blender/gpu/shaders/gpu_shader_simple_vert.glsl8
-rw-r--r--source/blender/gpu/shaders/gpu_shader_vertex.glsl8
2 files changed, 6 insertions, 10 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_simple_vert.glsl b/source/blender/gpu/shaders/gpu_shader_simple_vert.glsl
index 612f9cff6aa..9491eaa672d 100644
--- a/source/blender/gpu/shaders/gpu_shader_simple_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_simple_vert.glsl
@@ -29,11 +29,9 @@ void main()
gl_Position = gl_ProjectionMatrix * co;
-#ifdef __GLSL_CG_DATA_TYPES
- // Setting gl_ClipVertex is necessary to get glClipPlane working on NVIDIA graphic cards.
- // gl_ClipVertex works only on NVIDIA graphic cards so we have to check with
- // __GLSL_CG_DATA_TYPES if a NVIDIA graphic card is used (Cg support).
- // gl_ClipVerte is supported up to GLSL 1.20.
+#ifdef GPU_NVIDIA
+ // Setting gl_ClipVertex is necessary to get glClipPlane working on NVIDIA
+ // graphic cards, while on ATI it can cause a software fallback.
gl_ClipVertex = gl_ModelViewMatrix * gl_Vertex;
#endif
diff --git a/source/blender/gpu/shaders/gpu_shader_vertex.glsl b/source/blender/gpu/shaders/gpu_shader_vertex.glsl
index 9e0db44ed31..8741a13ea9b 100644
--- a/source/blender/gpu/shaders/gpu_shader_vertex.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_vertex.glsl
@@ -10,11 +10,9 @@ void main()
varnormal = normalize(gl_NormalMatrix * gl_Normal);
gl_Position = gl_ProjectionMatrix * co;
- // Setting gl_ClipVertex is necessary to get glClipPlane working on NVIDIA graphic cards.
- // gl_ClipVertex works only on NVIDIA graphic cards so we have to check with
- // __GLSL_CG_DATA_TYPES if a NVIDIA graphic card is used (Cg support).
- // gl_ClipVerte is supported up to GLSL 1.20.
-#ifdef __GLSL_CG_DATA_TYPES
+#ifdef GPU_NVIDIA
+ // Setting gl_ClipVertex is necessary to get glClipPlane working on NVIDIA
+ // graphic cards, while on ATI it can cause a software fallback.
gl_ClipVertex = gl_ModelViewMatrix * gl_Vertex;
#endif