Geometry Nodes: Matrix socket type, attribute type, and initial nodes #116166
|
@ -97,17 +97,29 @@ CUDADevice::CUDADevice(const DeviceInfo &info, Stats &stats, Profiler &profiler)
|
|||
cuda_assert(cuDeviceGetAttribute(
|
||||
&pitch_alignment, CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT, cuDevice));
|
||||
|
||||
unsigned int ctx_flags = CU_CTX_LMEM_RESIZE_TO_MAX;
|
||||
if (can_map_host) {
|
||||
ctx_flags |= CU_CTX_MAP_HOST;
|
||||
init_host_memory();
|
||||
}
|
||||
|
||||
int active = 0;
|
||||
unsigned int ctx_flags = 0;
|
||||
cuda_assert(cuDevicePrimaryCtxGetState(cuDevice, &ctx_flags, &active));
|
||||
|
||||
/* Configure primary context only once. */
|
||||
if (active == 0) {
|
||||
ctx_flags |= CU_CTX_LMEM_RESIZE_TO_MAX;
|
||||
result = cuDevicePrimaryCtxSetFlags(cuDevice, ctx_flags);
|
||||
if (result != CUDA_SUCCESS && result != CUDA_ERROR_PRIMARY_CONTEXT_ACTIVE) {
|
||||
set_error(string_printf("Failed to configure CUDA context (%s)", cuewErrorString(result)));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* Create context. */
|
||||
result = cuCtxCreate(&cuContext, ctx_flags, cuDevice);
|
||||
result = cuDevicePrimaryCtxRetain(&cuContext, cuDevice);
|
||||
|
||||
if (result != CUDA_SUCCESS) {
|
||||
set_error(string_printf("Failed to create CUDA context (%s)", cuewErrorString(result)));
|
||||
set_error(string_printf("Failed to retain CUDA context (%s)", cuewErrorString(result)));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -124,7 +136,7 @@ CUDADevice::~CUDADevice()
|
|||
{
|
||||
texture_info.free();
|
||||
|
||||
cuda_assert(cuCtxDestroy(cuContext));
|
||||
cuda_assert(cuDevicePrimaryCtxRelease(cuDevice));
|
||||
}
|
||||
|
||||
bool CUDADevice::support_device(const uint /*kernel_features*/)
|
||||
|
|
|
@ -1850,6 +1850,42 @@ static void versioning_grease_pencil_stroke_radii_scaling(GreasePencil *grease_p
|
|||
}
|
||||
}
|
||||
|
||||
static void fix_geometry_nodes_object_info_scale(bNodeTree &ntree)
|
||||
{
|
||||
using namespace blender;
|
||||
MultiValueMap<bNodeSocket *, bNodeLink *> out_links_per_socket;
|
||||
LISTBASE_FOREACH (bNodeLink *, link, &ntree.links) {
|
||||
if (link->fromnode->type == GEO_NODE_OBJECT_INFO) {
|
||||
out_links_per_socket.add(link->fromsock, link);
|
||||
}
|
||||
}
|
||||
|
||||
LISTBASE_FOREACH_MUTABLE (bNode *, node, &ntree.nodes) {
|
||||
if (node->type != GEO_NODE_OBJECT_INFO) {
|
||||
continue;
|
||||
}
|
||||
bNodeSocket *scale = nodeFindSocket(node, SOCK_OUT, "Scale");
|
||||
const Span<bNodeLink *> links = out_links_per_socket.lookup(scale);
|
||||
if (links.is_empty()) {
|
||||
continue;
|
||||
}
|
||||
bNode *absolute_value = nodeAddNode(nullptr, &ntree, "ShaderNodeVectorMath");
|
||||
absolute_value->custom1 = NODE_VECTOR_MATH_ABSOLUTE;
|
||||
absolute_value->parent = node->parent;
|
||||
absolute_value->locx = node->locx + 100;
|
||||
absolute_value->locy = node->locy - 50;
|
||||
nodeAddLink(&ntree,
|
||||
node,
|
||||
scale,
|
||||
absolute_value,
|
||||
static_cast<bNodeSocket *>(absolute_value->inputs.first));
|
||||
for (bNodeLink *link : links) {
|
||||
link->fromnode = absolute_value;
|
||||
link->fromsock = static_cast<bNodeSocket *>(absolute_value->outputs.first);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void blo_do_versions_400(FileData *fd, Library * /*lib*/, Main *bmain)
|
||||
{
|
||||
if (!MAIN_VERSION_FILE_ATLEAST(bmain, 400, 1)) {
|
||||
|
@ -2628,6 +2664,7 @@ void blo_do_versions_400(FileData *fd, Library * /*lib*/, Main *bmain)
|
|||
if (ntree->type == NTREE_GEOMETRY) {
|
||||
version_geometry_nodes_use_rotation_socket(*ntree);
|
||||
versioning_nodes_dynamic_sockets_2(*ntree);
|
||||
fix_geometry_nodes_object_info_scale(*ntree);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ const char *imb_ext_image[] = {
|
|||
const char *imb_ext_movie[] = {
|
||||
".avi", ".flc", ".mov", ".movie", ".mp4", ".m4v", ".m2v", ".m2t", ".m2ts", ".mts",
|
||||
".ts", ".mv", ".avs", ".wmv", ".ogv", ".ogg", ".r3d", ".dv", ".mpeg", ".mpg",
|
||||
".mpg2", ".vob", ".mkv", ".flv", ".divx", ".xvid", ".mxf", ".webm", nullptr,
|
||||
".mpg2", ".vob", ".mkv", ".flv", ".divx", ".xvid", ".mxf", ".webm", ".gif", nullptr,
|
||||
};
|
||||
|
||||
/** Sort of wrong having audio extensions in imbuf. */
|
||||
|
|
Loading…
Reference in New Issue