Page MenuHome

Fix T60171: Hair Particles Not Displaying in Viewport
ClosedPublic

Authored by Tomoaki Kawada (yvt) on Mar 9 2019, 1:19 PM.

Details

Summary

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 R​9 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.

Diff Detail

Repository
rB Blender

Event Timeline

I'm not 100% sure (@Clément Foucault (fclem) can correct me), but I think that for workarounds like these, we want to have it only be active if we are on OSX (as it is a fix for those buggy drivers).

But I think you should wait with any changes until @Clément Foucault (fclem) has chimed in on this.

Clément Foucault (fclem) requested changes to this revision.Mar 9 2019, 4:28 PM

Thanks for finding that! you can #ifdef the fix for apple only by using OS_MAC.

source/blender/draw/modes/shaders/common_hair_lib.glsl
150

comment style: use /* */ instead of //

This revision now requires changes to proceed.Mar 9 2019, 4:28 PM

Thanks for finding that! you can #ifdef the fix for apple only by using OS_MAC.

It seems that OS_MAC isn’t defined anywhere. Would it be okay if I modify gpu_shader_standard_defines to emit #define OS_MAC in addition to GPU-specific #defines that it already emits?

It seems that OS_MAC isn’t defined anywhere. Would it be okay if I modify gpu_shader_standard_defines to emit #define OS_MAC in addition to GPU-specific #defines that it already emits?

I've already done that for you in rB9c4352001022

Added #ifdefs to enable the work-around only in macOS.

The comment style was updated in accordance with the standard coding style.

Tomoaki Kawada (yvt) marked an inline comment as done.Mar 10 2019, 2:53 AM
This revision is now accepted and ready to land.Mar 10 2019, 3:31 AM
This revision was automatically updated to reflect the committed changes.