Merge pull request #54427 from briansemrau/fix-material-preview-update

This commit is contained in:
Yuri Roubinsky 2021-10-30 22:07:51 +03:00 committed by GitHub
commit 727c51f35d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1034,7 +1034,7 @@ Ref<Image> RendererStorageRD::texture_2d_get(RID p_texture) const {
ERR_FAIL_COND_V(!tex, Ref<Image>());
#ifdef TOOLS_ENABLED
if (tex->image_cache_2d.is_valid()) {
if (tex->image_cache_2d.is_valid() && !tex->is_render_target) {
return tex->image_cache_2d;
}
#endif
@ -1049,7 +1049,7 @@ Ref<Image> RendererStorageRD::texture_2d_get(RID p_texture) const {
}
#ifdef TOOLS_ENABLED
if (Engine::get_singleton()->is_editor_hint()) {
if (Engine::get_singleton()->is_editor_hint() && !tex->is_render_target) {
tex->image_cache_2d = image;
}
#endif