Maybe it's just me and I'm missing the off switch, but is anyone else finding Pixel Bender 3D just too aggressive right now at optimizing the vars? I'm finding myself having to sum up all vertex attributes and multiply by some extremely small constant and then add to the final color just so that the compiler doesn't blow away the registers.
If I'm missing the off switch, please let me know. Because for development, it's becoming a real source of error.
Well, thats indeed a problem. If a shader does not use a parameter, it is simply not counted in and optimized away. This is a huge problem when you not use the ProgramConstantsHelper, because every time the registers and offsets are changing.
It would somehow be nice if you could set in which register you want to have a parameter or turn this optimization off.
I already use the registers and wrote my own simple code to get the needed values from the register maps, telling me in which register and which offset I have to put the numbers in.
The only problem is, that PixelBender3D does not put parameters in the registers if they are not used in the shader. But everything else is just fine.
Thanks
North America
Europe, Middle East and Africa
Asia Pacific