Parcourir la source

Fix `SubViewport` with `UPDATE_WHEN_VISIBLE` not working properly in exported project

The issue is primarily due to `RSG::texture_storage->render_target_was_used()`
returning inconsistent results in the editor and exported projects.

(cherry picked from commit 59d0fdbacc03da223666e16014285f6818894d0b)
风青山 il y a 1 an
Parent
commit
7c3ac4d170

+ 1 - 1
servers/rendering/renderer_rd/storage_rd/material_storage.cpp

@@ -931,11 +931,11 @@ void MaterialStorage::MaterialData::update_textures(const HashMap<StringName, Va
 						roughness_detect_texture = tex;
 						roughness_channel = RS::TextureDetectRoughnessChannel(p_texture_uniforms[i].hint - ShaderLanguage::ShaderNode::Uniform::HINT_ROUGHNESS_R);
 					}
+#endif // TOOLS_ENABLED
 					if (tex->render_target) {
 						tex->render_target->was_used = true;
 						render_target_cache.push_back(tex->render_target);
 					}
-#endif
 				}
 				if (rd_texture.is_null()) {
 					rd_texture = texture_storage->texture_rd_get_default(TextureStorage::DEFAULT_RD_TEXTURE_WHITE);