Speed of cos() and sin() function in GLSL shaders?

前端 未结 6 1881
别那么骄傲
别那么骄傲 2021-01-17 10:51

I\'m interested in information about the speed of sin() and cos() in Open GL Shader Language.

The GLSL Specification Document indi

6条回答
  •  抹茶落季
    2021-01-17 11:33

    Not sure if this answers your question, but it's very difficult to tell you how many clocks/slots an instruction takes as it depends very much on the GPU. Usually it's a single cycle. But even if not, the compiler may rearrange the order of instruction execution to hide the true cost. It's certainly slower to use texture lookups for sin/cos as it is to execute the instructions.

提交回复
热议问题