diff options
author | clayjohn <claynjohn@gmail.com> | 2023-07-25 14:33:37 +0200 |
---|---|---|
committer | clayjohn <claynjohn@gmail.com> | 2023-07-25 14:33:37 +0200 |
commit | 52fb5bf98654ab1b96823cca4eae4f08e47c4d8e (patch) | |
tree | 0eb97811ec252c0bd252881d29b505197910e641 /drivers/gles3/shader_gles3.cpp | |
parent | 0c2144da908a8223e188d27ed1d31d8248056c78 (diff) | |
download | redot-engine-52fb5bf98654ab1b96823cca4eae4f08e47c4d8e.tar.gz |
Check if shader cache directory is available before using cache
Diffstat (limited to 'drivers/gles3/shader_gles3.cpp')
-rw-r--r-- | drivers/gles3/shader_gles3.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gles3/shader_gles3.cpp b/drivers/gles3/shader_gles3.cpp index 29e9ada72b..fdc787b4a1 100644 --- a/drivers/gles3/shader_gles3.cpp +++ b/drivers/gles3/shader_gles3.cpp @@ -667,7 +667,7 @@ void ShaderGLES3::_clear_version(Version *p_version) { void ShaderGLES3::_initialize_version(Version *p_version) { ERR_FAIL_COND(p_version->variants.size() > 0); - if (_load_from_cache(p_version)) { + if (shader_cache_dir_valid && _load_from_cache(p_version)) { return; } p_version->variants.reserve(variant_count); @@ -678,7 +678,9 @@ void ShaderGLES3::_initialize_version(Version *p_version) { _compile_specialization(spec, i, p_version, specialization_default_mask); p_version->variants[i].insert(specialization_default_mask, spec); } - _save_to_cache(p_version); + if (shader_cache_dir_valid) { + _save_to_cache(p_version); + } } void ShaderGLES3::version_set_code(RID p_version, const HashMap<String, String> &p_code, const String &p_uniforms, const String &p_vertex_globals, const String &p_fragment_globals, const Vector<String> &p_custom_defines, const LocalVector<ShaderGLES3::TextureUniformData> &p_texture_uniforms, bool p_initialize) { |