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-11-05 22:40:02 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-11-05 22:40:02 +0300
commitf0bc7f3261b823fe4efbe802ec6a2f3471bedd47 (patch)
tree6df158bfa1080a2e5a96fbbf73aa502f2423556c /intern
parent81bee0e75a9911cf80eed00acaee8003cde55c28 (diff)
parent4b56eed0f786562dfe961e23091f4f20c16a9e90 (diff)
Merge branch 'blender-v3.0-release'
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/kernel/light/light.h2
-rw-r--r--intern/cycles/kernel/osl/services.cpp13
2 files changed, 10 insertions, 5 deletions
diff --git a/intern/cycles/kernel/light/light.h b/intern/cycles/kernel/light/light.h
index 746c7747569..2e7f862a715 100644
--- a/intern/cycles/kernel/light/light.h
+++ b/intern/cycles/kernel/light/light.h
@@ -353,8 +353,8 @@ ccl_device bool light_sample_from_distant_ray(KernelGlobals kg,
/* compute pdf */
float invarea = klight->distant.invarea;
ls->pdf = invarea / (costheta * costheta * costheta);
- ls->pdf *= kernel_data.integrator.pdf_lights;
ls->eval_fac = ls->pdf;
+ ls->pdf *= kernel_data.integrator.pdf_lights;
return true;
}
diff --git a/intern/cycles/kernel/osl/services.cpp b/intern/cycles/kernel/osl/services.cpp
index ca0a5a068b3..389c1e2b746 100644
--- a/intern/cycles/kernel/osl/services.cpp
+++ b/intern/cycles/kernel/osl/services.cpp
@@ -832,16 +832,21 @@ static bool get_object_attribute(const OSLGlobals::Attribute &attr,
{
if (attr.type == TypeDesc::TypePoint || attr.type == TypeDesc::TypeVector ||
attr.type == TypeDesc::TypeNormal || attr.type == TypeDesc::TypeColor) {
- return set_attribute_float3(*(float3 *)attr.value.data(), type, derivatives, val);
+ const float *data = (const float *)attr.value.data();
+ return set_attribute_float3(make_float3(data[0], data[1], data[2]), type, derivatives, val);
}
else if (attr.type == TypeFloat2) {
- return set_attribute_float2(*(float2 *)attr.value.data(), type, derivatives, val);
+ const float *data = (const float *)attr.value.data();
+ return set_attribute_float2(make_float2(data[0], data[1]), type, derivatives, val);
}
else if (attr.type == TypeDesc::TypeFloat) {
- return set_attribute_float(*(float *)attr.value.data(), type, derivatives, val);
+ const float *data = (const float *)attr.value.data();
+ return set_attribute_float(data[0], type, derivatives, val);
}
else if (attr.type == TypeRGBA || attr.type == TypeDesc::TypeFloat4) {
- return set_attribute_float4(*(float4 *)attr.value.data(), type, derivatives, val);
+ const float *data = (const float *)attr.value.data();
+ return set_attribute_float4(
+ make_float4(data[0], data[1], data[2], data[3]), type, derivatives, val);
}
else if (attr.type == type) {
size_t datasize = attr.value.datasize();