spectral

Does "typedef struct" in OpenCL is allowed ?

Discussion created by spectral on Oct 1, 2010
Latest reply on Oct 2, 2010 by himanshu.gautam

 

Hi, I currently write my union like this :
typedef struct
{
 union
 {
  BxDFDataRefraction refraction;
 } data;
} BxDFData;
But can I write it like this :
typedef union struct
{
  BxDFDataRefraction refraction;
} BxDFData;
Like this I can access my data like this :
BxDFData bxdfd;
bxdfd.refraction.value = 10;
And not like this :
BxDFData bxdfd;
bxdfd.data.refraction.value = 10;
Thanks
 

 

Outcomes