Arguments to shading language functions are writable - this should not be the case. As stated in the RISpec:
"Function parameters are passed by reference; in other words, parameters are not copied into private data areas of the function. Neverheless, function parameters are not writable unless specified with the output keyword."
So, I suppose doing something like
void test(float f)
{
f = 1;
}
Should result in a compile-time error (or at least, the creation of a temporary variable for f). aqsl fails to pick this up however.
The attached rib and shaders demonstrate the problem. The left pane should be white, while the right pane should be grey (if aqsl will create temporaries), or alternatively, pass_by_ref.sl should fail to compile.
modifies an argument illegally
Logged In: YES
user_id=1086736
Originator: YES
File Added: pass_by_ref.sl
Logged In: YES
user_id=1086736
Originator: YES
File Added: pass_by_ref_output.sl
modifies an argument legally using the output keyword
This bug has just bitten an unsuspecting user - unsurprisingly the same issue exists with instanced shaders as well. For example, the following shader should fail to compile:
surface illegal_parameter_modification(float f = 1)
{
f = 42;
}