Hi guys,
If I understand correctly, we are discussing 2 different things here. Feel free to point out and correct me if I understand either incorrectly.
Issue 1 - Reason for warning getting added
This was mainly to avoid confusion for the user since varying is an ISPC feature and generally forbidden from exporting to cpp side outside of exceptions like this.
We decided to add it, looking at the function signatures created for c-side header files by ispc for varying types and possibility of users finding it confusing.
Note : To create header to check - ispc <input_file.ispc> -h <header_file.h>
For eg.
Ispc function: export void test2( varying float *uniform src, varying float *uniform dst ) { .. }
exported function signature in Header created : extern void test2(float( * src)[8], float( * dst)[8]);
// the [8] here is because is 8 wide(varying) since i compiled for avx2-i32x8 .
Varying though represented as vectors internally in ispc IR is represented as arrays in headers.
Similarly array
Ispc Function : export void test3(float src[20], float dst[20])
exported function signature in Header created : extern void test3(float( * src)[8], float( * dst)[8]); // the [8] here is because is 8 wide(varying) since i compiled for avx2-i32x8.
Reference to compare IR for ISPC and corresponding function signature in header
Issue 2 - variability of pointer type
'** Like other types in ispc, pointers are varying by default, if an explicit uniform qualifier isn't provided. However, the default variability of the pointed-to type is uniform. ** This rule will be illustrated and explained in examples below.'
So ,
int * uniform var = uniform int *uniform var
int * var = uniform int * varying var
Considering the above, you are right that default Variability is 'varying' but pointed-to type for pointers is an exception.
So, the current behaviour seems correct to me.
Regards,
Deepak