Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <jeroen@blender.org>2020-12-18 11:15:55 +0300
committerJeroen Bakker <jeroen@blender.org>2020-12-18 11:18:44 +0300
commit4f9e21bdc9772603acc0ba6727da9dd67287ac0f (patch)
tree4fbfce2561953060be0bca60aed073f71ad1eed2 /source/blender/makesdna/DNA_image_types.h
parent095b69361403bacd322172d6293b0faeee40b44e (diff)
Fix T82591: Performance regression when rendering at very high resolution
This patch introduces a partial update of GPUTexture. When rendering a large image the GPUTexture could have been scaled. The old implementation would rescale the image on CPU and create a new GPUTexture. This resulted in flooding the PCI bus. The new solution would only scale and upload the parts of the GPUTexture that has been changed. It does this by keeping track of areas of 256x256 pixels. When something changes the tiles that cover that changes will be rescaled and uploaded the next time the GPUTexture is requested. Test situation: Default Cube, 4 samples, 19200x10800 tile size 512. Blender 2.83.9: 4m27s. Blender 2.91: 20+m (regression) This patch: 1m01s. There is still room for more optimizations: * Reduce the time that an image is locked. ** Use task scheduling to update the tiles of an image. ** Generic optimization of the ImBuf scale method. Maniphest Tasks: T82591 Differential Revision: https://developer.blender.org/D9591
Diffstat (limited to 'source/blender/makesdna/DNA_image_types.h')
-rw-r--r--source/blender/makesdna/DNA_image_types.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/makesdna/DNA_image_types.h b/source/blender/makesdna/DNA_image_types.h
index 4edf06f90f7..eb03e047c90 100644
--- a/source/blender/makesdna/DNA_image_types.h
+++ b/source/blender/makesdna/DNA_image_types.h
@@ -151,12 +151,13 @@ typedef struct Image {
int lastframe;
/* GPU texture flag. */
+ /* Contains `ImagePartialRefresh`. */
+ ListBase gpu_refresh_areas;
int gpuframenr;
short gpuflag;
short gpu_pass;
short gpu_layer;
- short gpu_slot;
- char _pad2[4];
+ char _pad2[6];
/** Deprecated. */
struct PackedFile *packedfile DNA_DEPRECATED;
@@ -223,8 +224,10 @@ enum {
enum {
/** GPU texture needs to be refreshed. */
IMA_GPU_REFRESH = (1 << 0),
+ /** GPU texture needs to be partially refreshed. */
+ IMA_GPU_PARTIAL_REFRESH = (1 << 1),
/** All mipmap levels in OpenGL texture set? */
- IMA_GPU_MIPMAP_COMPLETE = (1 << 1),
+ IMA_GPU_MIPMAP_COMPLETE = (1 << 2),
};
/* Image.source, where the image comes from */