From 50d7f5a30f6d3697db4a15af2637b69fbecf6407 Mon Sep 17 00:00:00 2001 From: Omar Emara Date: Mon, 12 Feb 2024 16:58:23 +0200 Subject: [PATCH] Fix #118096: Compositor Displace node produce NaN pixels The GPU compositor Displace node produces NaN pixels if connected to the Image node. That's because the Displace node access the MIP levels of the texture produces by the Image node, but those levels were never initialized, so fix this by completing the levels. --- .../realtime_compositor/cached_resources/intern/cached_image.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/source/blender/compositor/realtime_compositor/cached_resources/intern/cached_image.cc b/source/blender/compositor/realtime_compositor/cached_resources/intern/cached_image.cc index 711bd2faa65..567c280a710 100644 --- a/source/blender/compositor/realtime_compositor/cached_resources/intern/cached_image.cc +++ b/source/blender/compositor/realtime_compositor/cached_resources/intern/cached_image.cc @@ -229,6 +229,7 @@ CachedImage::CachedImage(Context &context, ImBuf *image_buffer = BKE_image_acquire_ibuf(image, &image_user_for_pass, nullptr); const bool is_premultiplied = BKE_image_has_gpu_texture_premultiplied_alpha(image, image_buffer); texture_ = IMB_create_gpu_texture("Image Texture", image_buffer, true, is_premultiplied); + GPU_texture_update_mipmap_chain(texture_); const eGPUTextureFormat original_format = GPU_texture_format(texture_); const eGPUTextureFormat target_format = get_compatible_texture_format(original_format);