开发者

Branch vs Texture Read

开发者 https://www.devze.com 2023-01-28 11:12 出处:网络
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 anisotr

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

精彩评论

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