Here's an idea I came up with to program some sort of software shaders, this is just a simple example to see if it would work but with the use of the mmx and sse regs you could pass more to them.
If there's a static variable in a sub will it be allocated if the sub is never called?