Why are if statements in shaders heavily discouraged?

Описание к видео Why are if statements in shaders heavily discouraged?

This video was sponsored by Brilliant
To try everything Brilliant has to offer—free—for a full 30 days, visit https://brilliant.org/VoxelRifts . The first 200 of you will get 20% off Brilliant’s annual premium subscription.

If you've done shader programming before, you might've heard people say that you shouldn't use if statements or any other conditional branching statements in shaders. However, it might not be obvious why exactly this is the case, especially because people don't say the same for regular CPU side programming. In this video, we go through why this is the case, along with covering why GPUs are so much faster than CPUs at certain tasks.

Discord:   / discord  

#gpu #branching #lowlevel

Комментарии

Информация по комментариям в разработке