开发者

Branch vs Texture Read

In shaders, which one is usually cheaper, branching (if, etc) or a te开发者_StackOverflow社区xture read?


Texture read, usually. Branches are typically prohibitively expensive. Of course, so are anisotropic texture reads from extremely large textures that don't have mip-maps, so you need to profile it accordingly.

Btw, you can also use the [predicated] directive in some instances.

EDIT: I should mention the obvious - in your output, look at the numbers to see if you're sequencer-bound or texture-bound.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜