type check for RSL printf args sometimes incorrect
Brought to you by:
ltatkinson,
pgregory
It appears that the new typecheck code has problems with printf (and possibly with all varargs functions). Sometimes the arguments of such functions can have inconsistent types.
The following shader shows the problem:
surface type_bug()
{
printf("%f", noise(6*P));
}
The output compiled shader contains the following code section:
segment Code
pushv P
pushif 6
mulpp
noise3
pushis "%f"
pushif 1
printf
Clearly the mulpp instruction is errornous - it should in fact be mulfp. Running such a shader results in an assert or segfault.
Anonymous
Logged In: YES
user_id=208244
Originator: NO
a work-around will be to clarify the syntax on the printf like:
surface type_bug()
{
float f = noise(6*P);
printf("%f\n", f);
}