zoukankan      html  css  js  c++  java
  • OpenGL ES Shader语言中的函数不支持递归

    An example function definition is given here for a simple function that computes basic diffuse lighting:

    vec4 diffuse(vec3 normal, vec3 light, vec4 baseColor)

    {

        return baseColor * dot(normal, light);

    }

    One note about functions in the OpenGL ES Shading Language: functions cannot be recursive. The reason for this limitation is that some implementations will implement function calls by actually placing the function code inline in the final generated program for the GPU. The shading language was purposely structured to allow this sort of inline implementation to support GPUs that do not have a stack.

  • 相关阅读:
    OC
    OC
    OC
    OC
    OC
    Oracle wm_concat()函数
    字符串拼接
    easyui扩展数据表格点击加号拓展
    子tab里面新增tab(top.jQuery)
    combox datagrid重复请求问题
  • 原文地址:https://www.cnblogs.com/time-is-life/p/7597099.html
Copyright © 2011-2022 走看看