pointer to float3 can't reference members

Discussion created by david_aiken on Oct 29, 2009
Latest reply on Oct 30, 2009 by nou


The following kernel code:


    __global float3 *pos = (__global float3*)(bufPnts + ndx * simData->stride);

    int gz = (pos->z - simData->min.z) * simData->delta.z ;

produces an error:
error: expression must have pointer-to-struct-or-union type
      int gz = (pos->z - simData->min.z) * simData->delta.z ;
It seems like this should be allowed.
It doesn't mind:
    __global float3 *pos2 = (__global float3*)(bufPnts);
    int q = (*pos2).x;