I have some RenderScript code that includes an inline function form
a .rsh file.  When I remove the use of the function llvm-rs-cc.exe
throws an un-handled exception and crashes.

The rs file looks like this:

rs_allocation gIn;
rs_allocation gOut;
rs_script gScript;
float Contrast = 1.0;
rs_script ClampRgbValue;

void root(const uchar4 *v_in, uchar4 *v_out, const void *usrData,
uint32_t x, uint32_t y) {
   float4 f4 = rsUnpackColor8888(*v_in);
   f4.x = clampRgbaValue(f4.x);                // COMMENT OUT THIS
LINE AND llvm-rs-cc.exe CRASHES!!!!
   *v_out = rsPackColorTo8888(f4);
}

void filter() {
    rsForEach(gScript, gIn, gOut, 0);
}
Where clamp_rgb_value.rsh looks like:

inline float clampRgbaValue(float value)
{
        if(value > 1.0f)
        {
                return 1.0f;
        }
        if(value < 0.0f)
        {
                return 0.0f;
        }
        return value;
}

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to