Optimizing a raytracer

ponce contact at gam3sfrommars.fr
Wed Oct 16 11:48:47 PDT 2013


On Wednesday, 16 October 2013 at 12:02:15 UTC, Róbert László Páli 
wrote:
> I thought, using classes may require too much memory, because 
> they are not destructed on scope end, and maybe speed reduction 
> when GC kicks in.
>
> Is my assumptions that in this case struct are more wise?

Yes, by all means use struct.


> What would generate the fastest code for a cross-product for 
> example?

If you are on x86, SSE 4.1 introduced an instruction called DPPS 
which performs a dot product. Maybe you can force it into doing a 
cross-product with clever swizzles and masks.


More information about the Digitalmars-d mailing list