OSDN Git Service

glsl: make use of on disk shader cache
authorTimothy Arceri <timothy.arceri@collabora.com>
Mon, 23 Jan 2017 21:39:13 +0000 (08:39 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Fri, 17 Feb 2017 00:18:42 +0000 (11:18 +1100)
commit877194068208a9fb87f7b5513bca85d09be8a20f
treebddab5b55b75f3552e710ac6a8604e18ad5709d3
parent34ca0fce228224121d1a3b111c38325e731bace3
glsl: make use of on disk shader cache

The hash key for glsl metadata is a hash of the hashes of each GLSL
source string.

This commit uses the put_key/get_key support in the cache put the SHA-1
hash of the source string for each successfully compiled shader into the
cache. This allows for early, optimistic returns from glCompileShader
(if the identical source string had been successfully compiled in the past),
in the hope that the final, linked shader will be found in the cache.

This is based on the intial patch by Carl.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/compiler/glsl/glsl_parser_extras.cpp
src/compiler/glsl/linker.cpp
src/mesa/program/ir_to_mesa.cpp