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.
Can you post an example of the actual erors that you're seeing. We are very aggresive about optimizing variables because of the lack of registers available, but the optimizations should not be changing the behaviour of the kernsl.
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.
Have you looked at the CylinderSphereNoHelper example? That uses the vertex and fragmber register maps that you can get from the compile programs to tell you how to set the values that are passed in.
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.
Europe, Middle East and Africa