summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Roubinsky <chaosus89@gmail.com>2021-10-30 22:07:51 +0300
committerGitHub <noreply@github.com>2021-10-30 22:07:51 +0300
commit727c51f35d29e36d199aedafb7b2c683a55bf44d (patch)
tree169d5e9fa636b9f9236af2d256a32fbeaf33f14f
parent6b0b1a4c042175190381737e3000027ef912e6cb (diff)
parent8f75ad4df2a5ba035b0b3f3f534529ca21795557 (diff)
Merge pull request #54427 from briansemrau/fix-material-preview-update
-rw-r--r--servers/rendering/renderer_rd/renderer_storage_rd.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/servers/rendering/renderer_rd/renderer_storage_rd.cpp b/servers/rendering/renderer_rd/renderer_storage_rd.cpp
index d2c8d0e47c..99d1b88947 100644
--- a/servers/rendering/renderer_rd/renderer_storage_rd.cpp
+++ b/servers/rendering/renderer_rd/renderer_storage_rd.cpp
@@ -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