Function recursion makes sdrc segfault

2007-04-21
2013-04-25
  • AKHmetgaleev ILdar

    I am trying different things in sl. And when I tried to compile shader with function recursion sdrc goes segfault.
    Does sl support function recursion?

    The function was:

    void color_recursion(
            point pp;
            vector vv;
            float prevval;
            float n,samples;
            point sphere_center;
            output color outcol;
            output float outval;
        )
    {
        float val = 0;
        color col = 0;
        float curval = get_density(pp,sphere_center)/samples;
        if (((outval + prevval) < 1) && (n<samples))
            color_recursion(pp+vv,vv,curval+prevval,n+1,samples,sphere_center,col,val);

        outval = curval + val;
        outcol = 1;

    }

     
    • Okan Arikan

      Okan Arikan - 2007-04-21

         Unfortunately, the shading language doesn't support recursion. All functions are in fact inline expanded. I think PrMan shares the same limitation.

         Okan

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks