Major improvement: uniforms can now be set to default values. The syntax is the same as for setting any other values, f.ex. 'uniform Scalar a = 1; uniform Scalar b = 0.5 * a;'. Undefined uniforms are still allowed, but in this case the user should load a proper value into it during runtime. Default uniform values can be overwritten by calling any of the uniform loader funcions (like acDeviceLoadScalarUniform). Improved also error checking. Now there are explicit warnings if the user tries to load an invalid value into a device constant.

This commit is contained in:
jpekkila
2020-01-28 18:17:31 +02:00
parent 6dfe3ed4d6
commit 0ccd4e3dbc
9 changed files with 197 additions and 115 deletions

View File

@@ -3,12 +3,12 @@
#define STENCIL_ORDER (6)
#endif
uniform Scalar AC_dsx;
uniform Scalar AC_dsy;
uniform Scalar AC_dsz;
uniform Scalar AC_inv_dsx;
uniform Scalar AC_inv_dsy;
uniform Scalar AC_inv_dsz;
uniform Scalar AC_dsx = 0.04908738521;
uniform Scalar AC_dsy = 0.04908738521;
uniform Scalar AC_dsz = 0.04908738521;
uniform Scalar AC_inv_dsx = 1.0 / AC_dsx;
uniform Scalar AC_inv_dsy = 1.0 / AC_dsy;
uniform Scalar AC_inv_dsz = 1.0 / AC_dsz;
Scalar
first_derivative(Scalar pencil[], Scalar inv_ds)