Unroll a loop, make shader 10x faster
Loop unrolling is complexicated. Usual knowledge is that the compiler has way more knowledge than you might have about source code and the target machine, and so you should just write a loop, and let the compiler decide what to actually do with it. This is a good rule of thumb, most of the time.
The other day I made one GPU compute shader in Blender 10 times (ten times!) faster by unrolling a loop though.
评论
?
参与讨论