diff options
author | Jeroen Bakker <jbakker> | 2022-01-28 10:37:12 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2022-01-28 10:37:45 +0300 |
commit | bdd74e1e9338b18e4f80458f284d0c6a4d100f30 (patch) | |
tree | 86daecf79b6a9d0896482d7fe8d85da9a6becc81 /source/blender/blenkernel/intern/image_gpu.cc | |
parent | 0a32ac02e976a4723802ed09bed64c0625e889a2 (diff) |
DrawManager: Image engine support huge images.
Adding better support for drawing huge images in the image/uv editor. Also solved tearing artifacts.
The approach is that for each image/uv editor a screen space gpu texture is created that only contains
the visible pixels. When zooming or panning the gpu texture is rebuild.
Although the solution isn't memory intensive other parts of blender memory usage scales together with
the image size.
* Due to complexity we didn't implement partial updates when drawing images tiled (wrap repeat).
This could be added, but is complicated as a change in the source could mean many different
changes on the GPU texture. The work around for now is to tag all gpu textures to be dirty when
changes are detected.
Original plan was to have 4 screen space images to support panning without gpu texture creation.
For now we don't see the need to implement it as the solution is already fast. Especially when
GPU memory is shared with CPU ram.
Reviewed By: fclem
Maniphest Tasks: T92525, T92903
Differential Revision: https://developer.blender.org/D13424
Diffstat (limited to 'source/blender/blenkernel/intern/image_gpu.cc')
-rw-r--r-- | source/blender/blenkernel/intern/image_gpu.cc | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/image_gpu.cc b/source/blender/blenkernel/intern/image_gpu.cc index 91937e709da..eaee1fd2c30 100644 --- a/source/blender/blenkernel/intern/image_gpu.cc +++ b/source/blender/blenkernel/intern/image_gpu.cc @@ -58,14 +58,6 @@ static void image_free_gpu_limited_scale(Image *ima); static void image_update_gputexture_ex( Image *ima, ImageTile *tile, ImBuf *ibuf, int x, int y, int w, int h); -/* Internal structs. */ -#define IMA_PARTIAL_REFRESH_TILE_SIZE 256 -struct ImagePartialRefresh { - struct ImagePartialRefresh *next, *prev; - int tile_x; - int tile_y; -}; - bool BKE_image_has_gpu_texture_premultiplied_alpha(Image *image, ImBuf *ibuf) { if (image) { |