[Bf-blender-cvs] [9ad156374f5] master: Fix T60171: Hair Particles Not Displaying in Viewport
Clément Foucault
noreply at git.blender.org
Sun Mar 10 03:57:28 CET 2019
Commit: 9ad156374f599aa585b3cc49b54a8d48f10c60d6
Author: Clément Foucault
Date: Sun Mar 10 03:36:27 2019 +0100
Branches: master
https://developer.blender.org/rB9ad156374f599aa585b3cc49b54a8d48f10c60d6
Fix T60171: Hair Particles Not Displaying in Viewport
This patch fixes T60171 by adding a dummy read from the `dummy` vertex attribute to `hair_get_pos_tan_binor_time` in `common_hair_lib.glsl`. Confirmed to work on my machine (macOS 10.14.4 Beta, Radeon R9 M295X).
According to my experiments regarding this issue, the problem is triggered when all of the following conditions are met: (a) the shader has no vertex reads; (b) the index buffer is ≥ 256KiB. I can't really give an explanation of this misbehavior because of the video driver's closed-source nature.
Reviewers: fclem
Reviewed By: fclem
Subscribers: zeddb
Maniphest Tasks: T60171
Differential Revision: https://developer.blender.org/D4490
===================================================================
M release/datafiles/locale
M release/scripts/addons
M release/scripts/addons_contrib
M source/blender/draw/modes/shaders/common_hair_lib.glsl
===================================================================
diff --git a/release/datafiles/locale b/release/datafiles/locale
index 29c22181021..f81ed052157 160000
--- a/release/datafiles/locale
+++ b/release/datafiles/locale
@@ -1 +1 @@
-Subproject commit 29c2218102135522d6e2cd4bba7ab47d7241ab8a
+Subproject commit f81ed052157aff3979763cf25840032d11d261b6
diff --git a/release/scripts/addons b/release/scripts/addons
index c94604993b3..5f7fba0565a 160000
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@ -1 +1 @@
-Subproject commit c94604993b3e0bfbc733861e890aff18513e02b4
+Subproject commit 5f7fba0565a7c9ae93eae31a08fc9bbbd16d333a
diff --git a/release/scripts/addons_contrib b/release/scripts/addons_contrib
index 3a80a18ea08..fecc0db5600 160000
--- a/release/scripts/addons_contrib
+++ b/release/scripts/addons_contrib
@@ -1 +1 @@
-Subproject commit 3a80a18ea081ff93f4b3672120b446b7adc93e81
+Subproject commit fecc0db5600405a0c14c70120ae279222861ef80
diff --git a/source/blender/draw/modes/shaders/common_hair_lib.glsl b/source/blender/draw/modes/shaders/common_hair_lib.glsl
index 359e4d87b7a..4c540d2b478 100644
--- a/source/blender/draw/modes/shaders/common_hair_lib.glsl
+++ b/source/blender/draw/modes/shaders/common_hair_lib.glsl
@@ -136,6 +136,10 @@ float hair_shaperadius(float shape, float root, float tip, float time)
return (radius * (root - tip)) + tip;
}
+#ifdef OS_MAC
+in float dummy;
+#endif
+
void hair_get_pos_tan_binor_time(
bool is_persp, mat4 invmodel_mat, vec3 camera_pos, vec3 camera_z,
out vec3 wpos, out vec3 wtan, out vec3 wbinor, out float time, out float thickness, out float thick_time)
@@ -144,6 +148,13 @@ void hair_get_pos_tan_binor_time(
vec4 data = texelFetch(hairPointBuffer, id);
wpos = data.point_position;
time = data.point_time;
+
+#ifdef OS_MAC
+ /* Generate a dummy read to avoid the driver bug with shaders having no
+ * vertex reads on macOS (T60171) */
+ wpos.y += dummy * 0.0;
+#endif
+
if (time == 0.0) {
/* Hair root */
wtan = texelFetch(hairPointBuffer, id + 1).point_position - wpos;
More information about the Bf-blender-cvs
mailing list