mesa: change 'SHADER_SUBST' facility to work with env variables
authorTapani Pälli <tapani.palli@intel.com>
Mon, 31 Aug 2015 06:54:23 +0000 (09:54 +0300)
committerTapani Pälli <tapani.palli@intel.com>
Fri, 4 Sep 2015 05:22:37 +0000 (08:22 +0300)
commit04e201d0c02cd30ace5c6fe80e9f021ebb733682
treeffaa13fa4de05dc7fa01c09bdae21e816dff1ea1
parent0db323a62481a57269a46287a64fa743756e80f3
mesa: change 'SHADER_SUBST' facility to work with env variables

Patch modifies existing shader source and replace functionality to work
with environment variables rather than enable dumping on compile time.
Also instead of _mesa_str_checksum, _mesa_sha1_compute is used to avoid
collisions.

Functionality is controlled via two environment variables:

MESA_SHADER_DUMP_PATH - path where shader sources are dumped
MESA_SHADER_READ_PATH - path where replacement shaders are read

v2: cleanups, add strerror if fopen fails, put all functionality
    inside HAVE_SHA1 since sha1 is required

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Suggested-by: Eero Tamminen <eero.t.tamminen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
docs/shading.html
src/mesa/main/shaderapi.c