Re: struct and vector
Posted by Michael Bien on Aug 06, 2010; 5:48pm
URL: https://forum.jogamp.org/struct-and-vector-tp1013748p1031243.html
On 08/02/2010 06:32 PM, Siassei [via jogamp] wrote:
> Thanks for your answer.
>
> About gluegen.
> 1) It's generate files for 32 and 64. It's a little problem with
> OpenCL. OpenCL has fixed definied type size. For example, a integer is
> 32bit large.
int should be always 32bits wide. But all CPU dependent types like
pointers use this feature.
> 2) Does gluegen support the __attributes__?
no.
>
> About StructAccessor.
> Does it support the endian order?
> e.g host "little" and device "big"
this would require to bind the StructAccessor to a specific device.
Otherwise jocl impl would have to change the endianess at runtime which
could be inefficient. Answer is: not yet but is probably not that hard
to generate another factory method.
workaround:
RenderingConfig config = RenderingConfig.create()
if(device.isLittleEndian()) {
config.getBuffer().order(ByteOrder.LITTLE_ENDIAN);
}else{
config.getBuffer().order(ByteOrder.BIG_ENDIAN);
}
...
todo, something like:
RenderingConfig config = RenderingConfig.createFor(device)
>
> > gluegen does not yet support non standard C types
> Shit. The order of the components (xyzw) is depend on the endian of
> the device. See, Apendix B of OpenCL Spec 1.1
gluegen does by default not know what a vector type like float3 is.
Would be interesting to include cl_platform.h and see how the generated
getter/setters look like (it will probably generate array accessors).
thanks for your feedback,
regards,
michael