half and quad

Anders F Björklund afb at algonet.se
Thu Oct 11 23:18:31 PDT 2007


Bill Baxter wrote:

>> But I do have a port of "half" (from OpenEXR) kicking around here
>> somewhere, it's basically using ushort and converts over to float.
>>
>> See http://www.digitalmars.com/d/archives/digitalmars/D/31899.html
> 
> I wonder if 'half' is really worth it though.  It seems like more of a 
> temporary stop-gap measure to deal with memory and throughput problems 
> on a GPU.  In 5 years maybe people will look at 'half' and laugh about 
> how primitive the architectures were back in the 00's.  Also since D 
> isn't going to run on a GPU any time soon, and CPUs aren't going to 
> implement 'half' any time soon (AFAIK), maybe this doesn't make too much 
> sense.

D doesn't have to be run *on* the GPU in order to need the same type...
(it's useful for manipulating data that is later going to be sent over)

But you are right that half is just a lower resolution version of float,
just like 16-bit color and 16-bit integers. And while you could just
use 32-bit always (or 64-bit, just for the overkill), sometimes you do
have to worry about performance or memory or bandwidth constraints ?

--anders



More information about the Digitalmars-d mailing list