> My guess is that what you really want, is pack-and-unpack routines for 
> whole arrays.  half[0..n*2] <--> float[0..n]

What I would like is the ability to take a custom type and make a small vector 
out of it.

alias vec3<half> vec3h;

but as D doesn't have conversion function like C++, here is how to create such 
small vectors :

vec3h a = vec3h(cast(half)1.f, cast(half)2.f, cast(half)3.f);

Granted, hardly a problem and dropping conversion functions is a gain.

> It's a fascinating problem. I bet it can be done very efficiently.

I heard stories of half-float => float conversions being the bottleneck while 
filling mapped GPU buffers. 
The other one being using anything else than memcpy.

Reply via email to