Skip to content

Commit

Permalink
Don't use Texture image caches if they are rendered to
Browse files Browse the repository at this point in the history
  • Loading branch information
briansemrau committed Oct 30, 2021
1 parent 6b0b1a4 commit 8f75ad4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions servers/rendering/renderer_rd/renderer_storage_rd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 8f75ad4

Please sign in to comment.