Realtime Compositor: Implement Texture node

This patch implements the Texture node for the realtime compositor. The
evaluation of the texture is not GPU accelerated, but is cached as a
form of temporary implementation since the Texture node is deprecated
and will be removed in the future. Furthermore, texture node evaluation
is not supported for now.

This patch also introduces the concept of an ID static cache, which
uses the DrawDataList mechanism to invalidate the cache as needed,
consequently, a DrawDataList was added to the Tex ID structure.

An improvement that should be implemented outside of this patch is to
implement support for proxy textures in results to avoid redundant
copies in the execute method of the texture node. This should be
straightforward bit will be implemented in a separate patch.

Pull Request: https://projects.blender.org/blender/blender/pulls/107291
This commit is contained in:
Omar Emara
2023-04-25 09:04:35 +02:00
committed by Omar Emara
parent 2cbf536605
commit 151a53110c
11 changed files with 308 additions and 12 deletions

View File

@@ -56,6 +56,8 @@
#include "RE_texture.h"
#include "DRW_engine.h"
#include "BLO_read_write.h"
static void texture_init_data(ID *id)
@@ -100,6 +102,8 @@ static void texture_copy_data(Main *bmain, ID *id_dst, const ID *id_src, const i
texture_dst->nodetree->owner_id = &texture_dst->id;
}
BLI_listbase_clear((ListBase *)&texture_dst->drawdata);
if ((flag & LIB_ID_COPY_NO_PREVIEW) == 0) {
BKE_previewimg_id_copy(&texture_dst->id, &texture_src->id);
}
@@ -112,6 +116,8 @@ static void texture_free_data(ID *id)
{
Tex *texture = (Tex *)id;
DRW_drawdata_free(id);
/* is no lib link block, but texture extension */
if (texture->nodetree) {
ntreeFreeEmbeddedTree(texture->nodetree);