From e40ad5faa571de6da4bbc0b65d5a4765e76ebeef Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sun, 7 Jul 2024 10:55:57 +0200 Subject: [PATCH] gpu: Cache textures when doing copies The texture and texture-scale node code is creating image copies for mipmaps and to adapt to the compositing colorstate. Those texture should be cached. --- gsk/gpu/gskgpunodeprocessor.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gsk/gpu/gskgpunodeprocessor.c b/gsk/gpu/gskgpunodeprocessor.c index 642d0564f2..48f4ab0382 100644 --- a/gsk/gpu/gskgpunodeprocessor.c +++ b/gsk/gpu/gskgpunodeprocessor.c @@ -1758,6 +1758,11 @@ gsk_gpu_node_processor_add_texture_node (GskGpuNodeProcessor *self, { image = gsk_gpu_copy_image (self->frame, self->ccs, image, image_cs, TRUE); image_cs = self->ccs; + gsk_gpu_cache_cache_texture_image (gsk_gpu_device_get_cache (gsk_gpu_frame_get_device (self->frame)), + texture, + gsk_gpu_frame_get_timestamp (self->frame), + image, + image_cs); } if (!(gsk_gpu_image_get_flags (image) & GSK_GPU_IMAGE_MIPMAP)) @@ -1889,6 +1894,11 @@ gsk_gpu_node_processor_add_texture_scale_node (GskGpuNodeProcessor *self, { image = gsk_gpu_copy_image (self->frame, self->ccs, image, image_cs, need_mipmap); image_cs = self->ccs; + gsk_gpu_cache_cache_texture_image (gsk_gpu_device_get_cache (gsk_gpu_frame_get_device (self->frame)), + texture, + gsk_gpu_frame_get_timestamp (self->frame), + image, + image_cs); } if (need_mipmap && !(gsk_gpu_image_get_flags (image) & GSK_GPU_IMAGE_MIPMAP))