One thing I notice lacking in the Toolkit is actual operators(+,-,*,etc…) on the builtin vector types. That is, int4, char4, etc.
I started as a GLSL programmer and I’m working on image processing, so its very odd not natively being able to add 2 float4’s (signifying RGBA) together. I can write functions to do just that, but I always worry about them not being as efficient as a professional would write. No copy constructor is also annoying when using reduction tactics, since you cant ‘volatile uint4 = uint4’.
In short, I’m asking if I’m missing anything, or if the only and best way to do all this is by writing my own structs, classes and functions.
One thing I notice lacking in the Toolkit is actual operators(+,-,*,etc…) on the builtin vector types. That is, int4, char4, etc.
I started as a GLSL programmer and I’m working on image processing, so its very odd not natively being able to add 2 float4’s (signifying RGBA) together. I can write functions to do just that, but I always worry about them not being as efficient as a professional would write. No copy constructor is also annoying when using reduction tactics, since you cant ‘volatile uint4 = uint4’.
In short, I’m asking if I’m missing anything, or if the only and best way to do all this is by writing my own structs, classes and functions.
look at cutil_math.h (not in the toolkit, in the sdk) it has most of what you’re looking for. Being in the sdk, it isn’t really meant for production code…but this one header file is very useful.
look at cutil_math.h (not in the toolkit, in the sdk) it has most of what you’re looking for. Being in the sdk, it isn’t really meant for production code…but this one header file is very useful.