SHARE
TWEET

Untitled

a guest May 21st, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/source/blender/draw/modes/shaders/common_view_lib.glsl b/source/blender/draw/modes/shaders/common_view_lib.glsl
  2. index 79ac351912d..f21432c9992 100644
  3. --- a/source/blender/draw/modes/shaders/common_view_lib.glsl
  4. +++ b/source/blender/draw/modes/shaders/common_view_lib.glsl
  5. @@ -48,3 +48,12 @@ uniform mat4 ModelMatrixInverse;
  6.  #define point_world_to_ndc(p) (ViewProjectionMatrix * vec4(p, 1.0))
  7.  #define point_world_to_object(p) ((ModelMatrixInverse * vec4(p, 1.0)).xyz)
  8.  #define point_world_to_view(p) ((ViewMatrix * vec4(p, 1.0)).xyz)
  9. +
  10. +/* Due to some shader compiler bug, we somewhat
  11. +  * need to access gl_VertexID to make it work. even
  12. +  * if it's actually dead code. */
  13. +#ifdef GPU_INTEL
  14. +#define GPU_INTEL_VERTEX_SHADER_WORKAROUND gl_Position.x = float(gl_VertexID);
  15. +#else
  16. +#define GPU_INTEL_VERTEX_SHADER_WORKAROUND
  17. +#endif
  18. \ No newline at end of file
  19. diff --git a/source/blender/draw/modes/shaders/edit_curve_overlay_handle_vert.glsl b/source/blender/draw/modes/shaders/edit_curve_overlay_handle_vert.glsl
  20. index 2f3d37a6e73..590c2905be6 100644
  21. --- a/source/blender/draw/modes/shaders/edit_curve_overlay_handle_vert.glsl
  22. +++ b/source/blender/draw/modes/shaders/edit_curve_overlay_handle_vert.glsl
  23. @@ -7,6 +7,8 @@ flat out int vertFlag;
  24.  
  25.  void main()
  26.  {
  27. +  GPU_INTEL_VERTEX_SHADER_WORKAROUND
  28. +
  29.    vec3 world_pos = point_object_to_world(pos);
  30.    gl_Position = point_world_to_ndc(world_pos);
  31.    vertFlag = data;
  32. diff --git a/source/blender/draw/modes/shaders/edit_curve_overlay_loosevert_vert.glsl b/source/blender/draw/modes/shaders/edit_curve_overlay_loosevert_vert.glsl
  33. index b1b707b59f4..07c19e2b1ff 100644
  34. --- a/source/blender/draw/modes/shaders/edit_curve_overlay_loosevert_vert.glsl
  35. +++ b/source/blender/draw/modes/shaders/edit_curve_overlay_loosevert_vert.glsl
  36. @@ -9,6 +9,8 @@ out vec4 finalColor;
  37.  
  38.  void main()
  39.  {
  40. +  GPU_INTEL_VERTEX_SHADER_WORKAROUND
  41. +  
  42.    if ((data & VERT_SELECTED) != 0) {
  43.      if ((data & VERT_ACTIVE) != 0) {
  44.        finalColor = colorEditMeshActive;
  45. diff --git a/source/blender/draw/modes/shaders/edit_curve_overlay_normals_vert.glsl b/source/blender/draw/modes/shaders/edit_curve_overlay_normals_vert.glsl
  46. index ef60ddbc395..e5b851f4eb0 100644
  47. --- a/source/blender/draw/modes/shaders/edit_curve_overlay_normals_vert.glsl
  48. +++ b/source/blender/draw/modes/shaders/edit_curve_overlay_normals_vert.glsl
  49. @@ -9,6 +9,8 @@ in float rad;
  50.  
  51.  void main()
  52.  {
  53. +  GPU_INTEL_VERTEX_SHADER_WORKAROUND
  54. +  
  55.    vec3 final_pos = pos;
  56.  
  57.    float flip = (gl_InstanceID != 0) ? -1.0 : 1.0;
  58. diff --git a/source/blender/draw/modes/shaders/edit_lattice_overlay_loosevert_vert.glsl b/source/blender/draw/modes/shaders/edit_lattice_overlay_loosevert_vert.glsl
  59. index f7df6bb4b68..895f085fcce 100644
  60. --- a/source/blender/draw/modes/shaders/edit_lattice_overlay_loosevert_vert.glsl
  61. +++ b/source/blender/draw/modes/shaders/edit_lattice_overlay_loosevert_vert.glsl
  62. @@ -22,6 +22,8 @@ vec2 proj(vec4 pos)
  63.  
  64.  void main()
  65.  {
  66. +  GPU_INTEL_VERTEX_SHADER_WORKAROUND
  67. +  
  68.    clipCase = 0;
  69.  
  70.    vec3 world_pos = point_object_to_world(pos);
  71. diff --git a/source/blender/draw/modes/shaders/edit_mesh_overlay_facefill_vert.glsl b/source/blender/draw/modes/shaders/edit_mesh_overlay_facefill_vert.glsl
  72. index a20c1124fe1..84383d07cf4 100644
  73. --- a/source/blender/draw/modes/shaders/edit_mesh_overlay_facefill_vert.glsl
  74. +++ b/source/blender/draw/modes/shaders/edit_mesh_overlay_facefill_vert.glsl
  75. @@ -8,6 +8,8 @@ flat out vec4 faceColor;
  76.  
  77.  void main()
  78.  {
  79. +  GPU_INTEL_VERTEX_SHADER_WORKAROUND
  80. +  
  81.    vec3 world_pos = point_object_to_world(pos);
  82.    gl_Position = point_world_to_ndc(world_pos);
  83.  
  84. diff --git a/source/blender/draw/modes/shaders/edit_mesh_overlay_mesh_analysis_vert.glsl b/source/blender/draw/modes/shaders/edit_mesh_overlay_mesh_analysis_vert.glsl
  85. index 968a63c7780..1e8c729f67d 100644
  86. --- a/source/blender/draw/modes/shaders/edit_mesh_overlay_mesh_analysis_vert.glsl
  87. +++ b/source/blender/draw/modes/shaders/edit_mesh_overlay_mesh_analysis_vert.glsl
  88. @@ -12,6 +12,8 @@ out vec4 weightColor;
  89.  
  90.  void main()
  91.  {
  92. +  GPU_INTEL_VERTEX_SHADER_WORKAROUND
  93. +  
  94.    vec3 world_pos = point_object_to_world(pos);
  95.    gl_Position = point_world_to_ndc(world_pos);
  96.    weightColor = vec4(weight_color.rgb, 1.0);
  97. diff --git a/source/blender/draw/modes/shaders/edit_mesh_overlay_vert.glsl b/source/blender/draw/modes/shaders/edit_mesh_overlay_vert.glsl
  98. index 073e04117af..fabc317cf4f 100644
  99. --- a/source/blender/draw/modes/shaders/edit_mesh_overlay_vert.glsl
  100. +++ b/source/blender/draw/modes/shaders/edit_mesh_overlay_vert.glsl
  101. @@ -20,12 +20,7 @@ out int selectOveride;
  102.  
  103.  void main()
  104.  {
  105. -#ifdef GPU_INTEL
  106. -  /* Due to some shader compiler bug, we somewhat
  107. -   * need to access gl_VertexID to make it work. even
  108. -   * if it's actually dead code. */
  109. -  gl_Position.x = float(gl_VertexID);
  110. -#endif
  111. +  GPU_INTEL_VERTEX_SHADER_WORKAROUND
  112.  
  113.    vec3 world_pos = point_object_to_world(pos);
  114.  
  115. diff --git a/source/blender/draw/modes/shaders/edit_normals_vert.glsl b/source/blender/draw/modes/shaders/edit_normals_vert.glsl
  116. index 9bf0fb7315c..384d13923f6 100644
  117. --- a/source/blender/draw/modes/shaders/edit_normals_vert.glsl
  118. +++ b/source/blender/draw/modes/shaders/edit_normals_vert.glsl
  119. @@ -21,6 +21,8 @@ flat out vec4 v2;
  120.  
  121.  void main()
  122.  {
  123. +  GPU_INTEL_VERTEX_SHADER_WORKAROUND
  124. +
  125.    vec3 n = normalize(normal_object_to_world(nor));
  126.  
  127.    vec3 world_pos = point_object_to_world(pos);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top