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 <brecht@blender.org>2021-09-20 18:59:20 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-09-21 15:55:54 +0300
commit08031197250aeecbaca3803254e6f25b8c7b7b37 (patch)
tree6fe7ab045f0dc0a423d6557c4073f34309ef4740 /intern/cycles/graph
parentfa6b1007bad065440950cd67deb16a04f368856f (diff)
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity, new shadow catcher, revamped sampling settings, subsurface scattering anisotropy, new GPU volume sampling, improved PMJ sampling pattern, and more. Some features have also been removed or changed, breaking backwards compatibility. Including the removal of the OpenCL backend, for which alternatives are under development. Release notes and code docs: https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles https://wiki.blender.org/wiki/Source/Render/Cycles Credits: * Sergey Sharybin * Brecht Van Lommel * Patrick Mours (OptiX backend) * Christophe Hery (subsurface scattering anisotropy) * William Leeson (PMJ sampling pattern) * Alaska (various fixes and tweaks) * Thomas Dinges (various fixes) For the full commit history, see the cycles-x branch. This squashes together all the changes since intermediate changes would often fail building or tests. Ref T87839, T87837, T87836 Fixes T90734, T89353, T80267, T80267, T77185, T69800
Diffstat (limited to 'intern/cycles/graph')
-rw-r--r--intern/cycles/graph/node.cpp2
-rw-r--r--intern/cycles/graph/node.h18
2 files changed, 17 insertions, 3 deletions
diff --git a/intern/cycles/graph/node.cpp b/intern/cycles/graph/node.cpp
index 57f25283f85..8294e716ebe 100644
--- a/intern/cycles/graph/node.cpp
+++ b/intern/cycles/graph/node.cpp
@@ -814,7 +814,7 @@ bool Node::socket_is_modified(const SocketType &input) const
return (socket_modified & input.modified_flag_bit) != 0;
}
-bool Node::is_modified()
+bool Node::is_modified() const
{
return socket_modified != 0;
}
diff --git a/intern/cycles/graph/node.h b/intern/cycles/graph/node.h
index aa365baeccd..8f27a82d37b 100644
--- a/intern/cycles/graph/node.h
+++ b/intern/cycles/graph/node.h
@@ -16,6 +16,8 @@
#pragma once
+#include <type_traits>
+
#include "graph/node_type.h"
#include "util/util_array.h"
@@ -34,7 +36,10 @@ struct Transform;
#define NODE_SOCKET_API_BASE_METHODS(type_, name, string_name) \
const SocketType *get_##name##_socket() const \
{ \
- static const SocketType *socket = type->find_input(ustring(string_name)); \
+ /* Explicitly cast to base class to use `Node::type` even if the derived class defines \
+ * `type`. */ \
+ const Node *self_node = this; \
+ static const SocketType *socket = self_node->type->find_input(ustring(string_name)); \
return socket; \
} \
bool name##_is_modified() const \
@@ -111,6 +116,15 @@ struct Node {
void set(const SocketType &input, const Transform &value);
void set(const SocketType &input, Node *value);
+ /* Implicitly cast enums and enum classes to integer, which matches an internal way of how
+ * enumerator values are stored and accessed in a generic API. */
+ template<class ValueType, typename std::enable_if_t<std::is_enum_v<ValueType>> * = nullptr>
+ void set(const SocketType &input, const ValueType &value)
+ {
+ static_assert(sizeof(ValueType) <= sizeof(int), "Enumerator type should fit int");
+ set(input, static_cast<int>(value));
+ }
+
/* set array values. the memory from the input array will taken over
* by the node and the input array will be empty after return */
void set(const SocketType &input, array<bool> &value);
@@ -164,7 +178,7 @@ struct Node {
bool socket_is_modified(const SocketType &input) const;
- bool is_modified();
+ bool is_modified() const;
void tag_modified();
void clear_modified();