Browse Source

Merge pull request #94835 from MileyHollenberg/bugfix-powervr-gpu-crash

Fix crash on powerVR GPUs when a cached shader wasn't loaded in properly
Rémi Verschelde 1 year ago
parent
commit
074d8b0938

+ 3 - 2
drivers/gles3/shader_gles3.cpp

@@ -698,7 +698,8 @@ void ShaderGLES3::_clear_version(Version *p_version) {
 
 void ShaderGLES3::_initialize_version(Version *p_version) {
 	ERR_FAIL_COND(p_version->variants.size() > 0);
-	if (shader_cache_dir_valid && _load_from_cache(p_version)) {
+	bool use_cache = shader_cache_dir_valid && !(feedback_count > 0 && GLES3::Config::get_singleton()->disable_transform_feedback_shader_cache);
+	if (use_cache && _load_from_cache(p_version)) {
 		return;
 	}
 	p_version->variants.reserve(variant_count);
@@ -709,7 +710,7 @@ 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);
 	}
-	if (shader_cache_dir_valid) {
+	if (use_cache) {
 		_save_to_cache(p_version);
 	}
 }

+ 2 - 0
drivers/gles3/storage/config.cpp

@@ -218,6 +218,8 @@ Config::Config() {
 			//https://github.com/godotengine/godot/issues/92662#issuecomment-2161199477
 			//disable_particles_workaround = false;
 		}
+	} else if (rendering_device_name == "PowerVR Rogue GE8320") {
+		disable_transform_feedback_shader_cache = true;
 	}
 }
 

+ 3 - 0
drivers/gles3/storage/config.h

@@ -96,6 +96,9 @@ public:
 	bool disable_particles_workaround = false; // set to 'true' to disable 'GPUParticles'
 	bool flip_xy_workaround = false;
 
+	// PowerVR GE 8320 workaround
+	bool disable_transform_feedback_shader_cache = false;
+
 #ifdef ANDROID_ENABLED
 	PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC eglFramebufferTextureMultiviewOVR = nullptr;
 	PFNGLTEXSTORAGE3DMULTISAMPLEPROC eglTexStorage3DMultisample = nullptr;