Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2021-12-25 13:14:02 +0300
committerJacques Lucke <jacques@blender.org>2021-12-25 13:14:02 +0300
commit28df0107d4a83dd7ce62781bef821092db1e0835 (patch)
tree53c755f72f58bf52ecbff39f60f83d74b36767b5 /source/blender/gpu/GPU_material.h
parentf1e04116f08d80a7523d1b18bbba3c16b0d8943d (diff)
Fix T94362: GPUMaterialTexture references freed ImageUser
The issue was caused by rB7e712b2d6a0d257d272ed35622b41d06274af8df and the fact that `GPUMaterialTexture` contains an `ImageUser *` which references the `ImageUser` on e.g. `NodeTexImage`. Since the node tree update refactor, it is possible that the node tree changes without changing the actual material. Therefore, either the renderer should check if the node tree has changed or it should not store pointers to data in node storage. The latter approach is implemented in this patch. Differential Revision: https://developer.blender.org/D13663
Diffstat (limited to 'source/blender/gpu/GPU_material.h')
-rw-r--r--source/blender/gpu/GPU_material.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/gpu/GPU_material.h b/source/blender/gpu/GPU_material.h
index ea3028e539b..f7a01fadadc 100644
--- a/source/blender/gpu/GPU_material.h
+++ b/source/blender/gpu/GPU_material.h
@@ -24,6 +24,7 @@
#pragma once
#include "DNA_customdata_types.h" /* for CustomDataType */
+#include "DNA_image_types.h"
#include "DNA_listBase.h"
#include "BLI_sys_types.h" /* for bool */
@@ -256,7 +257,8 @@ typedef struct GPUMaterialAttribute {
typedef struct GPUMaterialTexture {
struct GPUMaterialTexture *next, *prev;
struct Image *ima;
- struct ImageUser *iuser;
+ struct ImageUser iuser;
+ bool iuser_available;
struct GPUTexture **colorband;
char sampler_name[32]; /* Name of sampler in GLSL. */
char tiled_mapping_name[32]; /* Name of tile mapping sampler in GLSL. */