summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-01-15 13:29:03 +0100
committerRémi Verschelde <rverschelde@gmail.com>2024-01-15 13:29:03 +0100
commitbf7e19887e252754206a26ac95a6a8c6b5f5bfae (patch)
treec7a0f855434ef11269124d692525e4ae5e7b8737 /drivers
parenta3976bce7f5745fbe5fca9d0ee33c57d7c2c0301 (diff)
parenta365c070b34068a00463f4c9414010309f9c7920 (diff)
downloadredot-engine-bf7e19887e252754206a26ac95a6a8c6b5f5bfae.tar.gz
Merge pull request #87096 from jsjtxietian/save-to-cache
Add `shader_cache_dir_valid` check to `_save_to_cache`
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gles3/shader_gles3.cpp1
-rw-r--r--drivers/gles3/shader_gles3.h4
2 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gles3/shader_gles3.cpp b/drivers/gles3/shader_gles3.cpp
index 8b5aaa6b8d..27402da7c8 100644
--- a/drivers/gles3/shader_gles3.cpp
+++ b/drivers/gles3/shader_gles3.cpp
@@ -611,6 +611,7 @@ void ShaderGLES3::_save_to_cache(Version *p_version) {
#ifdef WEB_ENABLED // not supported in webgl
return;
#else
+ ERR_FAIL_COND(!shader_cache_dir_valid);
#if !defined(ANDROID_ENABLED) && !defined(IOS_ENABLED)
if (RasterizerGLES3::is_gles_over_gl() && (glGetProgramBinary == NULL)) { // ARB_get_program_binary extension not available.
return;
diff --git a/drivers/gles3/shader_gles3.h b/drivers/gles3/shader_gles3.h
index 0cb53da316..8968e76c12 100644
--- a/drivers/gles3/shader_gles3.h
+++ b/drivers/gles3/shader_gles3.h
@@ -209,7 +209,9 @@ protected:
_compile_specialization(s, p_variant, version, p_specialization);
version->variants[p_variant].insert(p_specialization, s);
spec = version->variants[p_variant].lookup_ptr(p_specialization);
- _save_to_cache(version);
+ if (shader_cache_dir_valid) {
+ _save_to_cache(version);
+ }
}
} else if (spec->build_queued) {
// Still queued, wait