[Maya2019 ; Arnold6.0.1.0 ; MtoA4.0.1.0]
Hello
I'm writing a C++ shader that precomputes values into an array to speed up shader_evaluate calls. I need to update this array whenever a parameter is changed.
What I planned to do is : store former values of parameters, compare them with the current ones in shader_update and generate the array if they are different.
Is there a better way of doing this ? I feel like this is very heavy and and I don't want for this verifications to be done multiple times per rendering in case of IPR. I know it is possible to create callbacks in the Python template but I'm not sure this is usefull for my c++ program.
If there's not, is shader_update threaded ? i.e. should I lock a mutex or something before checking and updating my array in shader_update ?