I am using Renderscript for Android. I just updated to Revision 21 of the tools. My project (that has been working for over a year) stopped compiling with this update. The project is based on the 'Carousel' demo.
Eclipse is giving me a bunch of errors similar to the following:
error: structs containing vectors of dimension 3 cannot be exported at this API level: carouselPlane'
The code generating the above error is:
static Plane carouselPlane = {
{ 0.0f, 0.0f, 0.0f }, // point
{ 0.0f, 1.0f, 0.0f }, // normal
0.0f // plane constant (= -dot(P, N))
};
I don't understand what it means by cannot export. The chunk of code is specifically marked as static to prevent exporting.
Have others run into this issue as well on r21?
I know that Android 4.2 (released at the same time as r21) has some special features about running Renderscript computations on the GPU. Is this related to this problem?
Is there any known workaround?
EDIT
As requested here is a minimalist example of the above
#pragma version(1)
#pragma rs java_package_name(com.example);
typedef struct Plane_s {
float3 point;
} Plane;
static Plane carouselPlane = {
{ 0.0f, 0.0f, 0.0f }
};
Although that particular instantiation of Plane is marked static, it is likely that you have another non-static instance of this type. That is the only way that the error message you are seeing above will trigger.