Phase out IMA_GPU_REFRESH.

IMA_GPU_REFRESH is replaced by
BKE_image_partial_update_mark_full_update and should not be used
anymore.
This commit is contained in:
Jeroen Bakker 2022-02-14 10:33:56 +01:00
parent f0e32ef4ff
commit ab71d833c7
Notes: blender-bot 2023-02-14 02:27:51 +01:00
Referenced by issue #95723, EEVEE: Viewport Render shows transparent image
6 changed files with 9 additions and 20 deletions

View File

@ -4377,7 +4377,7 @@ RenderResult *BKE_image_acquire_renderresult(Scene *scene, Image *ima)
}
else {
rr = BKE_image_get_renderslot(ima, ima->render_slot)->render;
ima->gpuflag |= IMA_GPU_REFRESH;
BKE_image_partial_update_mark_full_update(ima);
}
/* set proper views */
@ -5745,7 +5745,7 @@ void BKE_image_user_frame_calc(Image *ima, ImageUser *iuser, int cfra)
/* NOTE: a single texture and refresh doesn't really work when
* multiple image users may use different frames, this is to
* be improved with perhaps a GPU texture cache. */
ima->gpuflag |= IMA_GPU_REFRESH;
BKE_image_partial_update_mark_full_update(ima);
ima->gpuframenr = iuser->framenr;
}

View File

@ -405,18 +405,9 @@ static GPUTexture *image_get_gpu_texture(Image *ima,
ima->gpu_pass = requested_pass;
ima->gpu_layer = requested_layer;
ima->gpu_view = requested_view;
ima->gpuflag |= IMA_GPU_REFRESH;
}
#undef GPU_FLAGS_TO_CHECK
/* TODO(jbakker): We should replace the IMA_GPU_REFRESH flag with a call to
* BKE_image-partial_update_mark_full_update. Although the flag is quicker it leads to double
* administration. */
if ((ima->gpuflag & IMA_GPU_REFRESH) != 0) {
BKE_image_partial_update_mark_full_update(ima);
ima->gpuflag &= ~IMA_GPU_REFRESH;
}
if (ima->runtime.partial_update_user == nullptr) {
ima->runtime.partial_update_user = BKE_image_partial_update_create(ima);
}

View File

@ -525,7 +525,7 @@ static void screen_opengl_render_apply(const bContext *C, OGLRender *oglrender)
ibuf->userflags |= IB_DISPLAY_BUFFER_INVALID;
}
BKE_image_release_ibuf(oglrender->ima, ibuf, lock);
oglrender->ima->gpuflag |= IMA_GPU_REFRESH;
BKE_image_partial_update_mark_full_update(oglrender->ima);
if (oglrender->write_still) {
screen_opengl_render_write(oglrender);

View File

@ -404,7 +404,7 @@ bool ED_image_slot_cycle(struct Image *image, int direction)
}
if ((cur != image->render_slot)) {
image->gpuflag |= IMA_GPU_REFRESH;
BKE_image_partial_update_mark_full_update(image);
}
return (cur != image->render_slot);
}

View File

@ -253,15 +253,13 @@ enum {
/* Image.gpuflag */
enum {
/** GPU texture needs to be refreshed. */
IMA_GPU_REFRESH = (1 << 0),
/** All mipmap levels in OpenGL texture set? */
IMA_GPU_MIPMAP_COMPLETE = (1 << 1),
IMA_GPU_MIPMAP_COMPLETE = (1 << 0),
/* Reuse the max resolution textures as they fit in the limited scale. */
IMA_GPU_REUSE_MAX_RESOLUTION = (1 << 2),
IMA_GPU_REUSE_MAX_RESOLUTION = (1 << 1),
/* Has any limited scale textures been allocated.
* Adds additional checks to reuse max resolution images when they fit inside limited scale. */
IMA_GPU_HAS_LIMITED_SCALE_TEXTURES = (1 << 3),
IMA_GPU_HAS_LIMITED_SCALE_TEXTURES = (1 << 2),
};
/* Image.source, where the image comes from */

View File

@ -608,7 +608,7 @@ static void rna_render_slots_active_set(PointerRNA *ptr,
int index = BLI_findindex(&image->renderslots, slot);
if (index != -1) {
image->render_slot = index;
image->gpuflag |= IMA_GPU_REFRESH;
BKE_image_partial_update_mark_full_update(image);
}
}
}
@ -624,7 +624,7 @@ static void rna_render_slots_active_index_set(PointerRNA *ptr, int value)
Image *image = (Image *)ptr->owner_id;
int num_slots = BLI_listbase_count(&image->renderslots);
image->render_slot = value;
image->gpuflag |= IMA_GPU_REFRESH;
BKE_image_partial_update_mark_full_update(image);
CLAMP(image->render_slot, 0, num_slots - 1);
}