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@gmail.com>2019-05-22 00:59:57 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-05-22 09:32:39 +0300
commitc06bd2d18461b192cb4780a298301eebca76d20c (patch)
tree2d95d844d5e16ea975cd3317a7cf1375e8eb1d04 /source/blender/draw/modes/shaders/common_view_lib.glsl
parentff3a20d1bc28a9fd8bc77960f1f312485b6fb1f2 (diff)
Fix T64499: edit mode display glitch on Intel HD 4x00 and Windows 7/8
There may well be more vertex shaders that need this, but I couldn't find them in my testing. Differential Revision: https://developer.blender.org/D4921
Diffstat (limited to 'source/blender/draw/modes/shaders/common_view_lib.glsl')
-rw-r--r--source/blender/draw/modes/shaders/common_view_lib.glsl8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/draw/modes/shaders/common_view_lib.glsl b/source/blender/draw/modes/shaders/common_view_lib.glsl
index 79ac351912d..9802b9111fc 100644
--- a/source/blender/draw/modes/shaders/common_view_lib.glsl
+++ b/source/blender/draw/modes/shaders/common_view_lib.glsl
@@ -48,3 +48,11 @@ uniform mat4 ModelMatrixInverse;
#define point_world_to_ndc(p) (ViewProjectionMatrix * vec4(p, 1.0))
#define point_world_to_object(p) ((ModelMatrixInverse * vec4(p, 1.0)).xyz)
#define point_world_to_view(p) ((ViewMatrix * vec4(p, 1.0)).xyz)
+
+/* Due to some shader compiler bug, we somewhat need to access gl_VertexID
+ * to make vertex shaders work. even if it's actually dead code. */
+#ifdef GPU_INTEL
+# define GPU_INTEL_VERTEX_SHADER_WORKAROUND gl_Position.x = float(gl_VertexID);
+#else
+# define GPU_INTEL_VERTEX_SHADER_WORKAROUND
+#endif