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
path: root/intern
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2021-04-29 17:00:05 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-04-29 17:00:05 +0300
commit734c8f9a7717cf1b94a53045f19d1af22031db35 (patch)
treeca57bbd778c12e84afe4b5ba594e0d02ef2a69b9 /intern
parent7627e0980ddc860917f0484a976956eacbcbe1ac (diff)
parent87ba01dba90b0b2ffbad2b9e07552734959814db (diff)
Merge branch 'blender-v2.93-release'
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/blender/addon/ui.py1
-rw-r--r--intern/cycles/kernel/kernel_light_common.h8
-rw-r--r--intern/cycles/render/attribute.cpp3
-rw-r--r--intern/cycles/render/nodes.h14
-rw-r--r--intern/cycles/util/util_system.cpp10
5 files changed, 29 insertions, 7 deletions
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index 73bc114893a..0b7f548c792 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -552,6 +552,7 @@ class CYCLES_RENDER_PT_light_paths_fast_gi(CyclesButtonsPanel, Panel):
if world:
light = world.light_settings
+ sub.prop(light, "ao_factor", text="AO Factor")
layout.prop(light, "distance", text="AO Distance")
diff --git a/intern/cycles/kernel/kernel_light_common.h b/intern/cycles/kernel/kernel_light_common.h
index c21c517a353..4a683d36226 100644
--- a/intern/cycles/kernel/kernel_light_common.h
+++ b/intern/cycles/kernel/kernel_light_common.h
@@ -200,12 +200,12 @@ ccl_device bool light_spread_clamp_area_light(const float3 P,
* uv coordinates. */
const float new_center_u = 0.5f * (min_u + max_u);
const float new_center_v = 0.5f * (min_v + max_v);
- const float new_len_u = 0.5f * (max_u - min_u);
- const float new_len_v = 0.5f * (max_v - min_v);
+ const float new_len_u = max_u - min_u;
+ const float new_len_v = max_v - min_v;
*lightP = *lightP + new_center_u * u + new_center_v * v;
- *axisu = u * new_len_u * 2.0f;
- *axisv = v * new_len_v * 2.0f;
+ *axisu = u * new_len_u;
+ *axisv = v * new_len_v;
return true;
}
diff --git a/intern/cycles/render/attribute.cpp b/intern/cycles/render/attribute.cpp
index 331d30802f1..d6a638fd4cd 100644
--- a/intern/cycles/render/attribute.cpp
+++ b/intern/cycles/render/attribute.cpp
@@ -689,6 +689,9 @@ void AttributeSet::update(AttributeSet &&new_attributes)
it++;
}
+
+ /* If all attributes were replaced, transform is no longer applied. */
+ geometry->transform_applied = false;
}
void AttributeSet::clear_modified()
diff --git a/intern/cycles/render/nodes.h b/intern/cycles/render/nodes.h
index fb9cf0c9836..99cb0b779b8 100644
--- a/intern/cycles/render/nodes.h
+++ b/intern/cycles/render/nodes.h
@@ -1600,11 +1600,23 @@ class SetNormalNode : public ShaderNode {
NODE_SOCKET_API(float3, direction)
};
-class OSLNode : public ShaderNode {
+class OSLNode final : public ShaderNode {
public:
static OSLNode *create(ShaderGraph *graph, size_t num_inputs, const OSLNode *from = NULL);
~OSLNode();
+ static void operator delete(void *ptr)
+ {
+ /* Override delete operator to silence new-delete-type-mismatch ASAN warnings
+ * regarding size mismatch in the destructor. This is intentional as we allocate
+ * extra space at the end of the node. */
+ ::operator delete(ptr);
+ }
+ static void operator delete(void *, void *)
+ {
+ /* Deliberately empty placement delete operator, to avoid MSVC warning C4291. */
+ }
+
ShaderNode *clone(ShaderGraph *graph) const;
char *input_default_value();
diff --git a/intern/cycles/util/util_system.cpp b/intern/cycles/util/util_system.cpp
index 6500a59e42c..8971867b736 100644
--- a/intern/cycles/util/util_system.cpp
+++ b/intern/cycles/util/util_system.cpp
@@ -145,7 +145,7 @@ int system_cpu_num_active_group_processors()
return numaAPI_GetNumCurrentNodesProcessors();
}
-#if !defined(_WIN32) || defined(FREE_WINDOWS)
+#if !defined(__APPLE__) && (!defined(_WIN32) || defined(FREE_WINDOWS))
static void __cpuid(int data[4], int selector)
{
# if defined(__x86_64__)
@@ -166,7 +166,13 @@ static void __cpuid(int data[4], int selector)
string system_cpu_brand_string()
{
-#if !defined(WIN32) && !defined(__x86_64__) && !defined(__i386__)
+#if defined(__APPLE__)
+ char modelname[512] = "";
+ size_t bufferlen = 512;
+ if (sysctlbyname("machdep.cpu.brand_string", &modelname, &bufferlen, NULL, 0) == 0) {
+ return modelname;
+ }
+#elif !defined(WIN32) && !defined(__x86_64__) && !defined(__i386__)
FILE *cpuinfo = fopen("/proc/cpuinfo", "r");
if (cpuinfo != nullptr) {
char cpuinfo_buf[513] = "";