182 return get_socket_value<bool>(
this,
input);
188 return get_socket_value<int>(
this,
input);
194 return get_socket_value<uint>(
this,
input);
200 return get_socket_value<float>(
this,
input);
206 return get_socket_value<float2>(
this,
input);
212 return get_socket_value<float3>(
this,
input);
218 return get_socket_value<ustring>(
this,
input);
222 int intvalue = get_socket_value<int>(
this,
input);
223 return (enm.
exists(intvalue)) ? enm[intvalue] : ustring();
234 return get_socket_value<Transform>(
this,
input);
240 return get_socket_value<Node *>(
this,
input);
247 return get_socket_value<array<bool>>(
this,
input);
253 return get_socket_value<array<int>>(
this,
input);
259 return get_socket_value<array<float>>(
this,
input);
265 return get_socket_value<array<float2>>(
this,
input);
271 return get_socket_value<array<float3>>(
this,
input);
277 return get_socket_value<array<ustring>>(
this,
input);
283 return get_socket_value<array<Transform>>(
this,
input);
289 return get_socket_value<array<Node *>>(
this,
input);
296 const void *
src =
input.default_value;
297 void *dst = &get_socket_value<char>(
this,
input);
298 return memcmp(dst,
src,
input.size()) == 0;
305 if (socket.
size() > 0) {
306 memcpy(dst,
src, socket.
size());
323 assert(socket.
type == other_socket.
type);
326 switch (socket.
type) {
328 copy_array<bool>(
this, socket, &other, other_socket);
331 copy_array<float>(
this, socket, &other, other_socket);
334 copy_array<int>(
this, socket, &other, other_socket);
337 copy_array<float3>(
this, socket, &other, other_socket);
340 copy_array<float3>(
this, socket, &other, other_socket);
343 copy_array<float3>(
this, socket, &other, other_socket);
346 copy_array<float3>(
this, socket, &other, other_socket);
349 copy_array<float2>(
this, socket, &other, other_socket);
352 copy_array<ustring>(
this, socket, &other, other_socket);
355 copy_array<Transform>(
this, socket, &other, other_socket);
358 copy_array<void *>(
this, socket, &other, other_socket);
360 array<Node *> &node_array = get_socket_value<array<Node *>>(
this, socket);
376 memcpy(dst,
src, socket.
size());
379 Node *
node = get_socket_value<Node *>(
this, socket);
390 assert(socket.
type == other_socket.
type);
394 switch (socket.
type) {
428 switch (socket.
type) {
430 set(socket, get_socket_value<bool>(&other, socket));
433 set(socket, get_socket_value<float>(&other, socket));
436 set(socket, get_socket_value<int>(&other, socket));
439 set(socket, get_socket_value<uint>(&other, socket));
445 set(socket, get_socket_value<float3>(&other, socket));
448 set(socket, get_socket_value<float2>(&other, socket));
451 set(socket, get_socket_value<ustring>(&other, socket));
454 set(socket, get_socket_value<int>(&other, socket));
457 set(socket, get_socket_value<Transform>(&other, socket));
460 set(socket, get_socket_value<Node *>(&other, socket));
487 switch (socket.
type) {
489 return is_value_equal<bool>(
this, &other, socket);
491 return is_value_equal<float>(
this, &other, socket);
493 return is_value_equal<int>(
this, &other, socket);
495 return is_value_equal<uint>(
this, &other, socket);
497 return is_value_equal<float3>(
this, &other, socket);
499 return is_value_equal<float3>(
this, &other, socket);
501 return is_value_equal<float3>(
this, &other, socket);
503 return is_value_equal<float3>(
this, &other, socket);
505 return is_value_equal<float2>(
this, &other, socket);
509 return is_value_equal<ustring>(
this, &other, socket);
511 return is_value_equal<int>(
this, &other, socket);
513 return is_value_equal<Transform>(
this, &other, socket);
515 return is_value_equal<void *>(
this, &other, socket);
518 return is_array_equal<bool>(
this, &other, socket);
520 return is_array_equal<float>(
this, &other, socket);
522 return is_array_equal<int>(
this, &other, socket);
524 return is_array_equal<float3>(
this, &other, socket);
526 return is_array_equal<float3>(
this, &other, socket);
528 return is_array_equal<float3>(
this, &other, socket);
530 return is_array_equal<float3>(
this, &other, socket);
532 return is_array_equal<float2>(
this, &other, socket);
534 return is_array_equal<ustring>(
this, &other, socket);
536 return is_array_equal<Transform>(
this, &other, socket);
538 return is_array_equal<void *>(
this, &other, socket);
579 for (
size_t i = 0; i <
a.size(); i++) {
588 for (
size_t i = 0; i <
a.size(); i++) {
602 switch (socket.
type) {
604 value_hash<bool>(
this, socket, md5);
607 value_hash<float>(
this, socket, md5);
610 value_hash<int>(
this, socket, md5);
613 value_hash<uint>(
this, socket, md5);
616 float3_hash(
this, socket, md5);
619 float3_hash(
this, socket, md5);
622 float3_hash(
this, socket, md5);
625 float3_hash(
this, socket, md5);
628 value_hash<float2>(
this, socket, md5);
633 value_hash<ustring>(
this, socket, md5);
636 value_hash<int>(
this, socket, md5);
639 value_hash<Transform>(
this, socket, md5);
642 value_hash<void *>(
this, socket, md5);
646 array_hash<bool>(
this, socket, md5);
649 array_hash<float>(
this, socket, md5);
652 array_hash<int>(
this, socket, md5);
655 float3_array_hash(
this, socket, md5);
658 float3_array_hash(
this, socket, md5);
661 float3_array_hash(
this, socket, md5);
664 float3_array_hash(
this, socket, md5);
667 array_hash<float2>(
this, socket, md5);
670 array_hash<ustring>(
this, socket, md5);
673 array_hash<Transform>(
this, socket, md5);
676 array_hash<void *>(
this, socket, md5);
687 template<
typename T>
size_t array_size_in_bytes(
const Node *
node,
const SocketType &socket)
690 return a.size() *
sizeof(
T);
697 size_t total_size = 0;
699 switch (socket.
type) {
714 total_size += socket.
size();
718 total_size += array_size_in_bytes<bool>(
this, socket);
721 total_size += array_size_in_bytes<float>(
this, socket);
724 total_size += array_size_in_bytes<int>(
this, socket);
727 total_size += array_size_in_bytes<float3>(
this, socket);
730 total_size += array_size_in_bytes<float3>(
this, socket);
733 total_size += array_size_in_bytes<float3>(
this, socket);
736 total_size += array_size_in_bytes<float3>(
this, socket);
739 total_size += array_size_in_bytes<float2>(
this, socket);
742 total_size += array_size_in_bytes<ustring>(
this, socket);
745 total_size += array_size_in_bytes<Transform>(
this, socket);
748 total_size += array_size_in_bytes<void *>(
this, socket);
783 Node *
node = get_socket_value<Node *>(
this, socket);
790 const array<Node *> &nodes = get_socket_value<array<Node *>>(
this, socket);
821 if (get_socket_value<T>(
this,
input) == value) {
825 get_socket_value<T>(
this,
input) = value;
831 if (get_socket_value<Node *>(
this,
input) == value) {
835 Node *old_node = get_socket_value<Node *>(
this,
input);
844 get_socket_value<Node *>(
this,
input) = value;
856 get_socket_value<array<T>>(
this,
input).steal_data(value);
869 for (
Node *old_node : old_nodes) {
870 old_node->dereference();
873 for (
Node *new_node : value) {
874 new_node->reference();
877 get_socket_value<array<Node *>>(
this,
input).steal_data(value);
883 printf(
"Node : %s\n",
name.c_str());
886 printf(
"-- socket modified : %s\n", socket.
name.c_str());
typedef float(TangentPoint)[2]
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
void append(const uint8_t *data, int size)
#define CCL_NAMESPACE_END
SyclQueue void void * src
SyclQueue void void size_t num_bytes void
static bool is_socket_array_float3(const SocketType &socket)
static bool is_array_equal(const Node *node, const Node *other, const SocketType &socket)
static bool is_value_equal(const Node *node, const Node *other, const SocketType &socket)
static bool is_socket_float3(const SocketType &socket)
static void copy_array(const Node *node, const SocketType &socket, const Node *other, const SocketType &other_socket)
ccl_global KernelShaderEvalInput * input
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
bool exists(ustring x) const
vector< SocketType, std::allocator< SocketType > > inputs
bool has_default_value(const SocketType &input) const
const array< float3 > & get_float3_array(const SocketType &input) const
static T & get_socket_value(const Node *node, const SocketType &socket)
bool equals(const Node &other) const
const array< float > & get_float_array(const SocketType &input) const
const array< int > & get_int_array(const SocketType &input) const
float get_float(const SocketType &input) const
Transform get_transform(const SocketType &input) const
void set(const SocketType &input, bool value)
void set_value(const SocketType &input, const Node &other, const SocketType &other_input)
void dereference_all_used_nodes()
float3 get_float3(const SocketType &input) const
void set_default_value(const SocketType &input)
const array< bool > & get_bool_array(const SocketType &input) const
void copy_value(const SocketType &input, const Node &other, const SocketType &other_input)
const array< Node * > & get_node_array(const SocketType &input) const
size_t get_total_size_in_bytes() const
SocketModifiedFlags socket_modified
bool get_bool(const SocketType &input) const
float2 get_float2(const SocketType &input) const
const array< ustring > & get_string_array(const SocketType &input) const
const array< float2 > & get_float2_array(const SocketType &input) const
bool socket_is_modified(const SocketType &input) const
ustring get_string(const SocketType &input) const
bool is_a(const NodeType *type)
void set_if_different(const SocketType &input, T value)
Node * get_node(const SocketType &input) const
const NodeOwner * get_owner() const
uint get_uint(const SocketType &input) const
Node(const NodeType *type, ustring name=ustring())
int get_int(const SocketType &input) const
const array< Transform > & get_transform_array(const SocketType &input) const
bool equals_value(const Node &other, const SocketType &input) const
void print_modified_sockets() const
void set_owner(const NodeOwner *owner_)
const void * default_value