Domanda

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"?

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top