[rust-dev] Fwd: OpenCL-style accessors, casts.

Jens Nockert jens at nockert.se
Tue Jul 16 19:50:11 PDT 2013


Begin forwarded message:

> From: Jens Nockert <jens at nockert.se>
> Subject: Re: [rust-dev] OpenCL-style accessors, casts.
> Date: 16 July 2013 14:36:34 CEST
> To: Brendan Zabarauskas <bjzaba at yahoo.com.au>
> 
> 
> On 16 Jul 2013, at 14:07, Brendan Zabarauskas <bjzaba at yahoo.com.au> wrote:
> 
>> I'm not saying that the shuffles would have to be generated using the field names - that would be near impossible.
>> 
>> For example:
>> 
>> ~~~
>> #[simd] struct RGB <T> { r: T, g: T, b: T, a: T }
>> ~~~
>> 
>> Shuffling would still use the CL syntax:
>> 
>> ~~~
>> let v2 = v.s3201
>> ~~~
> 
> 
> But then they would not behave like structs at all anymore, and you would see someone do something silly like define Vertex { w:f32, x:f32, y:f32, z:f32 } and try to access .w and get the value for z.
> 
> And it only solves a small part of the problem, what is the type of a componentwise (v1 == v2), where v1, v2 are RGB<f32> ?

Ps. Sorry bjz that you get duplicate messages, it was early and I replied only to you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20130717/be0a4f3e/attachment.html>


More information about the Rust-dev mailing list