Blender V5.3
IMB_partial_update.hh File Reference
#include "BLI_bit_vector.hh"
#include "BLI_vector.hh"
#include "DNA_vec_types.h"
#include "IMB_imbuf_types.hh"

Go to the source code of this file.

Classes

struct  blender::imbuf::partial_update::Changes

Namespaces

namespace  blender
 BMesh Iterators.
namespace  blender::imbuf
namespace  blender::imbuf::partial_update

Functions

void blender::IMB_partial_update_free (ImBuf *ibuf)
Update marking API
void blender::IMB_partial_update_mark_region (ImBuf *ibuf, const rcti &region)
void blender::IMB_partial_update_mark_full (ImBuf *ibuf)
void blender::IMB_mark_dirty (ImBuf *ibuf)
Update collect API
void blender::IMB_partial_update_flush (ImBuf *ibuf)
imbuf::ChangesetID blender::IMB_partial_update_changeset_id_current ()
imbuf::ChangesetID blender::IMB_partial_update_changeset_id_next ()
imbuf::partial_update::Changes blender::IMB_partial_update_collect (ImBuf *ibuf, imbuf::ChangesetID last_changeset_id)

Variables

constexpr int blender::imbuf::partial_update::CHUNK_SIZE = 256

Detailed Description

To reduce the overhead of GPU updates for painting this file contains a mechanism to detect subsets of the image that are changed. The image is split into chunks of size #CHUNK_SIZE with modification tracking for each.

Changes that happen over time are organized in changesets. Consumers of these changes store a changeset ID, and can then query changes since the last changeset ID.

Changeset IDs are global across image buffers, which makes it possible to track a single ID without a tight coupling to consumers as follows.

for each ibuf: IMB_partial_update_flush(ibuf) new_changest_id = IMB_partial_update_changeset_id_current() for each ibuf: changes = IMB_partial_update_collect(ibuf, last_changeset_id) apply changes last_changeset_id = new_changest_id

Definition in file IMB_partial_update.hh.