Hi!
Can’t find in the GLSL specs anything about unary operators (–, ++) in relation to vector types. Are those applicable to vectors or only to the scalar integer types? Example:
ivec2 v = 0;
v++; //Does v go from {0,0} to {1,1} ?
Should one simply understand it like all operators valid for the scalar of type T will work component-wise for vector of type T? Is it so?
Never ever do this. Compilers, particularly GLSL compilers, can have bugs. You should never assume that some GLSL code is correct just because it happens to work in a compiler.
I found a confusing moment there in specs about the matrix constructors:
What about the non-square matrices? If the same method will be used there, this will result in construction of degenerate matrix, which is somewhat senseless. So… Should I be sure that the term “diagonal” refers to the elements defined as (i==j) or for non-square matrices there is some sort of exception not mentioned in specs (or hidden in other places / specs’ versions)?