diff options
author | Jeroen Bakker <jeroen@blender.org> | 2021-02-08 17:42:59 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2021-02-09 10:12:29 +0300 |
commit | 549d9f87276a20036372317b1f988c4d0ef8c40c (patch) | |
tree | 92c587721c68cec7a1ae3ca5bfb6b87d8ac8e51a /source/blender/gpu | |
parent | eab9165c2512581b918d8bfca40ec98ded08a84a (diff) |
Fix T81206: Do not limit gl texture size in image editor
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
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/GPU_capabilities.h | 2 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_capabilities.cc | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/gpu/GPU_capabilities.h b/source/blender/gpu/GPU_capabilities.h index e02fbaa6d04..b95053a3715 100644 --- a/source/blender/gpu/GPU_capabilities.h +++ b/source/blender/gpu/GPU_capabilities.h @@ -38,7 +38,7 @@ int GPU_max_textures_vert(void); int GPU_max_textures_geom(void); int GPU_max_textures_frag(void); -int GPU_texture_size_with_limit(int res); +int GPU_texture_size_with_limit(int res, bool limit_gl_texture_size); bool GPU_mip_render_workaround(void); bool GPU_depth_blitting_workaround(void); diff --git a/source/blender/gpu/intern/gpu_capabilities.cc b/source/blender/gpu/intern/gpu_capabilities.cc index 1d2b0e5c7a8..6d9182dcf17 100644 --- a/source/blender/gpu/intern/gpu_capabilities.cc +++ b/source/blender/gpu/intern/gpu_capabilities.cc @@ -49,10 +49,11 @@ int GPU_max_texture_size(void) return GCaps.max_texture_size; } -int GPU_texture_size_with_limit(int res) +int GPU_texture_size_with_limit(int res, bool limit_gl_texture_size) { int size = GPU_max_texture_size(); - int reslimit = (U.glreslimit != 0) ? min_ii(U.glreslimit, size) : size; + int reslimit = (limit_gl_texture_size && (U.glreslimit != 0)) ? min_ii(U.glreslimit, size) : + size; return min_ii(reslimit, res); } |