Skip to content

Commit

Permalink
Merge pull request #79883 from clayjohn/GLES3-shader-cache-dir
Browse files Browse the repository at this point in the history
Check if shader cache directory is available before using cache
  • Loading branch information
YuriSizov committed Jul 26, 2023
2 parents d50c526 + 52fb5bf commit d894a2f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/gles3/shader_gles3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) {
Expand Down

0 comments on commit d894a2f

Please sign in to comment.