53 return sizeof(ustring);
59 return sizeof(
void *);
97 return &zero_transform;
102 static ustring names[] = {ustring(
"undefined"),
104 ustring(
"boolean"), ustring(
"float"),
105 ustring(
"int"), ustring(
"uint"),
106 ustring(
"uint64"), ustring(
"color"),
107 ustring(
"vector"), ustring(
"point"),
108 ustring(
"normal"), ustring(
"point2"),
109 ustring(
"closure"), ustring(
"string"),
110 ustring(
"enum"), ustring(
"transform"),
113 ustring(
"array_boolean"), ustring(
"array_float"),
114 ustring(
"array_int"), ustring(
"array_color"),
115 ustring(
"array_vector"), ustring(
"array_point"),
116 ustring(
"array_normal"), ustring(
"array_point2"),
117 ustring(
"array_string"), ustring(
"array_transform"),
118 ustring(
"array_node")};
120 constexpr size_t num_names =
sizeof(names) /
sizeof(*names);
123 return names[(
int)type];
128 return (type ==
COLOR || type ==
VECTOR || type ==
POINT || type == NORMAL);
148 const void *default_value,
162 socket.
flags = flags | extra_flags;
163 assert(inputs.size() < std::numeric_limits<SocketModifiedFlags>::digits);
165 inputs.push_back(socket);
179 outputs.push_back(socket);
185 if (socket.
name == name) {
196 if (socket.
name == name) {
208 static unordered_map<ustring, NodeType, ustringHash> _types;
217 fprintf(stderr,
"Node type %s registered twice!\n", name_);
226 type->create = create_;
232 unordered_map<ustring, NodeType, ustringHash>::iterator it =
types().
find(name);
233 return (it ==
types().end()) ?
NULL : &it->second;
#define CCL_NAMESPACE_END
draw_view in_light_buf[] float
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
unsigned __int64 uint64_t
vector< SocketType, std::allocator< SocketType > > inputs
const SocketType * find_output(ustring name) const
static const NodeType * find(ustring name)
static unordered_map< ustring, NodeType, ustringHash > & types()
static NodeType * add(const char *name, CreateFunc create, Type type=NONE, const NodeType *base=NULL)
NodeType(Type type=NONE, const NodeType *base=NULL)
void register_output(ustring name, ustring ui_name, SocketType::Type type)
const SocketType * find_input(ustring name) const
vector< SocketType, std::allocator< SocketType > > outputs
void register_input(ustring name, ustring ui_name, SocketType::Type type, int struct_offset, const void *default_value, const NodeEnum *enum_values=NULL, const NodeType *node_type=NULL, int flags=0, int extra_flags=0)
const void * default_value
const NodeType * node_type
static bool is_float3(Type type)
static ustring type_name(Type type)
static void * zero_default_value()
const NodeEnum * enum_values
SocketModifiedFlags modified_flag_bit