[Bf-blender-cvs] [ac58663deca] master: Fix T80776: Cannot switch between Slots of Render Result

Jeroen Bakker noreply at git.blender.org
Tue Sep 15 09:30:52 CEST 2020


Commit: ac58663decabb25600862e7345377efe2da1ee92
Author: Jeroen Bakker
Date:   Tue Sep 15 09:28:35 2020 +0200
Branches: master
https://developer.blender.org/rBac58663decabb25600862e7345377efe2da1ee92

Fix T80776: Cannot switch between Slots of Render Result

Introduced by D8234. Added active render slot to determine if the GPUTexture is still up to date.

===================================================================

M	source/blender/blenkernel/intern/image_gpu.c
M	source/blender/makesdna/DNA_image_types.h

===================================================================

diff --git a/source/blender/blenkernel/intern/image_gpu.c b/source/blender/blenkernel/intern/image_gpu.c
index 8e2e3fd621c..57e7e9446d2 100644
--- a/source/blender/blenkernel/intern/image_gpu.c
+++ b/source/blender/blenkernel/intern/image_gpu.c
@@ -277,9 +277,12 @@ static GPUTexture *image_get_gpu_texture(Image *ima,
    * the current `pass` and `layer` should be 0. */
   short requested_pass = iuser ? iuser->pass : 0;
   short requested_layer = iuser ? iuser->layer : 0;
-  if (ima->gpu_pass != requested_pass || ima->gpu_layer != requested_layer) {
+  short requested_slot = ima->render_slot;
+  if (ima->gpu_pass != requested_pass || ima->gpu_layer != requested_layer ||
+      ima->gpu_slot != requested_slot) {
     ima->gpu_pass = requested_pass;
     ima->gpu_layer = requested_layer;
+    ima->gpu_slot = requested_slot;
     ima->gpuflag |= IMA_GPU_REFRESH;
   }
 
diff --git a/source/blender/makesdna/DNA_image_types.h b/source/blender/makesdna/DNA_image_types.h
index 4a05d7ba319..6e0e3d6d6b7 100644
--- a/source/blender/makesdna/DNA_image_types.h
+++ b/source/blender/makesdna/DNA_image_types.h
@@ -151,7 +151,8 @@ typedef struct Image {
   short gpuflag;
   short gpu_pass;
   short gpu_layer;
-  char _pad2[6];
+  short gpu_slot;
+  char _pad2[4];
 
   /** Deprecated. */
   struct PackedFile *packedfile DNA_DEPRECATED;



More information about the Bf-blender-cvs mailing list