cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

spectral
Adept II

Does "typedef struct" in OpenCL is allowed ?

 

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
 

 

0 Likes
1 Reply
himanshu_gautam
Grandmaster

hi viewon01,

I do not think that is possible.

By the way BxDFData is of what data type according to you?

typedef union struct
{
  BxDFDataRefraction refraction;
} BxDFData;
0 Likes