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 <jbakker>2021-09-08 10:52:06 +0300
committerJeroen Bakker <jeroen@blender.org>2021-09-08 10:56:13 +0300
commit2b2d427bbac6716092336f0d0f698706a390f4ad (patch)
treecd89cda1501ad4a499383569f33ba8c609e21d2e /source/blender/makesrna/intern/rna_image.c
parent54f5c174a8cf480d934f3be8ecc85c76537ad148 (diff)
Fix T90825: Performance texture painting with limited scale.
Improve texture painting/uv editing performance when limited scale is active. Cause of the slow down is that the image editor draws the image in maximum resolution, but the 3d viewport uses the limited scale. The variation reuses the same GPU texture and needed to be uploaded/scaled twice to the GPU. This patch will adds texture slots that can hold the scaled down and the maximum resolution image. This would allow better cache hits and reuse of existing caches. Maximum resolution textures are reused for limited scale when they fit to reduce memory and CPU footprint. Reviewed By: fclem Differential Revision: https://developer.blender.org/D12388
Diffstat (limited to 'source/blender/makesrna/intern/rna_image.c')
-rw-r--r--source/blender/makesrna/intern/rna_image.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c
index e44ddb07d53..4a013dc9bd7 100644
--- a/source/blender/makesrna/intern/rna_image.c
+++ b/source/blender/makesrna/intern/rna_image.c
@@ -404,7 +404,7 @@ static void rna_Image_resolution_set(PointerRNA *ptr, const float *values)
static int rna_Image_bindcode_get(PointerRNA *ptr)
{
Image *ima = (Image *)ptr->data;
- GPUTexture *tex = ima->gputexture[TEXTARGET_2D][0];
+ GPUTexture *tex = ima->gputexture[TEXTARGET_2D][0][IMA_TEXTURE_RESOLUTION_FULL];
return (tex) ? GPU_texture_opengl_bindcode(tex) : 0;
}