]> git.tdb.fi Git - libs/gl.git/commitdiff
Begin implementing a new shader program generator system
authorMikko Rasa <tdb@tdb.fi>
Mon, 7 Nov 2016 21:10:51 +0000 (23:10 +0200)
committerMikko Rasa <tdb@tdb.fi>
Tue, 8 Nov 2016 20:26:36 +0000 (22:26 +0200)
ProgramBuilder is good enough when working within its standard features,
but it's difficult to expand.  Custom variables are overly sensitive to
declration order.  Adding loops or conditionals (other than the operator
flavor) requires using an additional shader.  It's not possible to modify
a variable's expression without replicating it in its entirety.

All of the internal processing with coordinate spaces, interfaces and
indices can also be difficult to understand.  Not to mention the reverse
processing order which starts from the goal variables and works backwards
to figure out how they can be computed.

The new ProgramCompiler system, as its name implies, works more like a
compiler.  It's designed to take GLSL as input, apply transformations to
it and produce different GLSL as output.  Storing the progrem as an
abstract syntax tree allows much more comprehensive processing than the
old system which barely understood what an identifier is.

At the moment it doesn't do much yet.  The only transformation is to
split a single source file into vertex, geometry and fragment parts and
add a common section at the beginning of each of them.  More will be
added soon.


No differences found