It looks like there's already a significant quantity of code dedicated to this - as well as boolean GLSLType#isConvertibleTo(GLSLType), there's also a mass of code in GLSLOperator dedicated to generating lists of all possible compatible types for each operator. Which I think is the wrong way to go about it - it answers the question "what types can this operator handle?", rather than "given that this operator has these operands, is that valid and if so what's the resultant type?"
I'm currently adding uint/double/uvec/dvec/dmat support to the language and extending the existing GLSLOperator code to support these will be very laborious. I'm going to leave it for now but I think that the majority of the code in GLSLOperator will need replacing.
It looks like there's already a significant quantity of code dedicated to this - as well as
boolean GLSLType#isConvertibleTo(GLSLType)
, there's also a mass of code inGLSLOperator
dedicated to generating lists of all possible compatible types for each operator. Which I think is the wrong way to go about it - it answers the question "what types can this operator handle?", rather than "given that this operator has these operands, is that valid and if so what's the resultant type?"I'm currently adding uint/double/uvec/dvec/dmat support to the language and extending the existing
GLSLOperator
code to support these will be very laborious. I'm going to leave it for now but I think that the majority of the code inGLSLOperator
will need replacing.