The simple question.
Is glsl/es float div operation MUCH slower than mul? I know it slower on x86, but is it slower on GPU?
When I look at GLSL disassembler I just see one more "rcp" command and all. How much costs that "rcp"?

有帮助吗?

解决方案

It varies from GPU to GPU, but in most cases, an rcp (reciprocal) instruction is roughly as expensive as a mul instruction. A divide ends up being roughly as expensive as a mul + an rcp. Both are fairly cheap compared to a texture lookup or branch of any kind.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top