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.
This commit is contained in:
Omar Emara 2024-02-12 16:58:23 +02:00
parent a159654ab2
commit 50d7f5a30f
1 changed files with 1 additions and 0 deletions

View File

@ -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);