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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2020-03-08 16:21:29 +0300
committerBrecht Van Lommel <brecht@blender.org>2020-03-11 22:45:39 +0300
commit6cf4861c3ac09fd65a765e8f8e3584713cc5303b (patch)
treeb2b104fbda65b67c56dd2a39ad812c89bc5b1ee2 /intern/cycles/render/nodes.h
parentd8aa613d94caf6a3d82a8f4e9e90b9b8f5c61a7d (diff)
Cleanup: refactor image loading to use abstract ImageLoader base class
Rather than passing around void pointers, various Blender image sources now subclass this. OIIO is also just another type of image loader. Also fixes T67718: Cycles viewport render crash editing point density settings
Diffstat (limited to 'intern/cycles/render/nodes.h')
-rw-r--r--intern/cycles/render/nodes.h31
1 files changed, 16 insertions, 15 deletions
diff --git a/intern/cycles/render/nodes.h b/intern/cycles/render/nodes.h
index 99e676fc8cb..1f52a2a49ab 100644
--- a/intern/cycles/render/nodes.h
+++ b/intern/cycles/render/nodes.h
@@ -80,6 +80,12 @@ class ImageSlotTextureNode : public TextureNode {
special_type = SHADER_SPECIAL_TYPE_IMAGE_SLOT;
}
+ virtual bool equals(const ShaderNode &other)
+ {
+ const ImageSlotTextureNode &other_node = (const ImageSlotTextureNode &)other;
+ return TextureNode::equals(other) && handle == other_node.handle;
+ }
+
ImageHandle handle;
};
@@ -95,16 +101,14 @@ class ImageTextureNode : public ImageSlotTextureNode {
virtual bool equals(const ShaderNode &other)
{
- const ImageTextureNode &image_node = (const ImageTextureNode &)other;
- return ImageSlotTextureNode::equals(other) && builtin_data == image_node.builtin_data &&
- animated == image_node.animated;
+ const ImageTextureNode &other_node = (const ImageTextureNode &)other;
+ return ImageSlotTextureNode::equals(other) && animated == other_node.animated;
}
- ImageKey image_key() const;
+ ImageParams image_params() const;
/* Parameters. */
ustring filename;
- void *builtin_data;
ustring colorspace;
ImageAlphaType alpha_type;
NodeImageProjection projection;
@@ -135,16 +139,14 @@ class EnvironmentTextureNode : public ImageSlotTextureNode {
virtual bool equals(const ShaderNode &other)
{
- const EnvironmentTextureNode &env_node = (const EnvironmentTextureNode &)other;
- return ImageSlotTextureNode::equals(other) && builtin_data == env_node.builtin_data &&
- animated == env_node.animated;
+ const EnvironmentTextureNode &other_node = (const EnvironmentTextureNode &)other;
+ return ImageSlotTextureNode::equals(other) && animated == other_node.animated;
}
- ImageKey image_key() const;
+ ImageParams image_params() const;
/* Parameters. */
ustring filename;
- void *builtin_data;
ustring colorspace;
ImageAlphaType alpha_type;
NodeEnvironmentProjection projection;
@@ -357,23 +359,22 @@ class PointDensityTextureNode : public ShaderNode {
return true;
}
- void add_image(ImageManager *image_manager);
-
/* Parameters. */
ustring filename;
NodeTexVoxelSpace space;
InterpolationType interpolation;
Transform tfm;
float3 vector;
- void *builtin_data;
/* Runtime. */
ImageHandle handle;
+ ImageParams image_params() const;
+
virtual bool equals(const ShaderNode &other)
{
- const PointDensityTextureNode &point_dendity_node = (const PointDensityTextureNode &)other;
- return ShaderNode::equals(other) && builtin_data == point_dendity_node.builtin_data;
+ const PointDensityTextureNode &other_node = (const PointDensityTextureNode &)other;
+ return ShaderNode::equals(other) && handle == other_node.handle;
}
};