From df0bce3f7d0a91310ca88814a80e339f3da6c2c9 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Mon, 8 Feb 2021 15:42:59 +0100 Subject: Fix T81206: Do not limit gl texture size in image editor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch will show textures in the image editor with the maximum available resolution determined by the GPU Hardware/Driver. Currently the size is limited by the user preference texture size limit. An image user can set the `IMA_SHOW_MAX_RESOLUTION` flag to request gpu textures in the max supported resolution. When this flag isn't set the gpu texture is limited by the user preference setting. When the gl resolution limit is disabled the GPU texture is always created for the max supported resolution. Reviewed By: Clément Foucault Maniphest Tasks: T81206 Differential Revision: https://developer.blender.org/D9160 --- source/blender/blenloader/intern/versioning_290.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c index bb477745849..2911bb6a7fc 100644 --- a/source/blender/blenloader/intern/versioning_290.c +++ b/source/blender/blenloader/intern/versioning_290.c @@ -1601,5 +1601,19 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain) */ { /* Keep this block, even when empty. */ + + /* UV/Image Max resolution images in image editor. */ + if (!DNA_struct_find(fd->filesdna, "SpaceImageOverlay")) { + LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) { + LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { + LISTBASE_FOREACH (SpaceLink *, space, &area->spacedata) { + if (space->spacetype == SPACE_IMAGE) { + SpaceImage *sima = (SpaceImage *)space; + sima->iuser.flag |= IMA_SHOW_MAX_RESOLUTION; + } + } + } + } + } } } -- cgit v1.2.3 From 10f44a413573089e132a411aa003ea3d9d634059 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Tue, 9 Feb 2021 08:11:56 +0100 Subject: Fix versioning code of previous commit --- source/blender/blenloader/intern/versioning_290.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c index 2911bb6a7fc..60256359ea0 100644 --- a/source/blender/blenloader/intern/versioning_290.c +++ b/source/blender/blenloader/intern/versioning_290.c @@ -1603,14 +1603,12 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain) /* Keep this block, even when empty. */ /* UV/Image Max resolution images in image editor. */ - if (!DNA_struct_find(fd->filesdna, "SpaceImageOverlay")) { - LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) { - LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { - LISTBASE_FOREACH (SpaceLink *, space, &area->spacedata) { - if (space->spacetype == SPACE_IMAGE) { - SpaceImage *sima = (SpaceImage *)space; - sima->iuser.flag |= IMA_SHOW_MAX_RESOLUTION; - } + LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) { + LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { + LISTBASE_FOREACH (SpaceLink *, space, &area->spacedata) { + if (space->spacetype == SPACE_IMAGE) { + SpaceImage *sima = (SpaceImage *)space; + sima->iuser.flag |= IMA_SHOW_MAX_RESOLUTION; } } } -- cgit v1.2.3