Got LOTS more working with the shading language. Got autoincrement working, fixed lots of issues w.r.t. Vector constructors and their access/assignment. Having used templates to minimize the code written has turned out to be a huge savings. Resolved a huge bug with operator resolution that was preventing me from doing things like (r+1-1+1-1 …).
Going to give register minimization a shot…. I’ll be using the Boost Graph Library to create a bidirectional graph between all the temporary values, then doing a graph coloring. We’re using the sequential_vertex_coloring algorithm. Actually, this page seems to describe the OrderPA parameter.
I’ve hit a snag…. Might have to come back to this. Part of the problem is the fact that I’m stuck on 1_31 and I need to update to the latest Boost library version. Can’t do that without updating to a newer compiler, etc etc. So I’m stuck for the moment.
But this is a good time to start on in inplace operators such as +=/-=/*=//=. Actually, what I need to do is properly address the entire assignment operator, and all its variants. Assignment (=) shares the same grammatical precedence as +=,-=,*=. They also need to be able to be chained, and return a value as well. (a=b=c+=d) should be allowed. This would lead to rewriting a significant portion of the existing compiler code. But it would allow for things to behave “correctly”.
The plan is to introduce assignment type operators into the expression grammar. That would allow for nested assignments within expressions like m += (n=2). This will change the expression parsing in the shader grammar, but it will also simplify it. The only hack will be for expressions to assign their lhs components, since the getValue() is const. Shouldn’t be a problem.
Got the vanilla ‘=’ operator working. Now I have to move onto the other assignment operators and their variants. += and -= have to work with Int, Double, Vector{2,3,4} and Vector{2,3,4}{i,f} and String.