Merge branch 'blender-v2.93-release'

This commit is contained in:
Brecht Van Lommel 2021-04-29 16:00:05 +02:00
commit 734c8f9a77
6 changed files with 83 additions and 57 deletions

View File

@ -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")

View File

@ -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;
}

View File

@ -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()

View File

@ -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();

View File

@ -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] = "";

View File

@ -815,66 +815,70 @@ static void ffmpeg_postprocess(struct anim *anim)
anim->y);
}
if (ENDIAN_ORDER == B_ENDIAN) {
int *dstStride = anim->pFrameRGB->linesize;
uint8_t **dst = anim->pFrameRGB->data;
const int dstStride2[4] = {dstStride[0], 0, 0, 0};
uint8_t *dst2[4] = {dst[0], 0, 0, 0};
int x, y, h, w;
unsigned char *bottom;
unsigned char *top;
# if defined(__x86_64__) || defined(_M_X64)
/* Scale and flip image over Y axis in one go, using negative strides.
* This doesn't work with arm/powerpc though and may be misusing the API.
* Limit it x86_64 where it appears to work.
* http://trac.ffmpeg.org/ticket/9060 */
int *dstStride = anim->pFrameRGB->linesize;
uint8_t **dst = anim->pFrameRGB->data;
const int dstStride2[4] = {-dstStride[0], 0, 0, 0};
uint8_t *dst2[4] = {dst[0] + (anim->y - 1) * dstStride[0], 0, 0, 0};
sws_scale(anim->img_convert_ctx,
(const uint8_t *const *)input->data,
input->linesize,
0,
anim->y,
dst2,
dstStride2);
sws_scale(anim->img_convert_ctx,
(const uint8_t *const *)input->data,
input->linesize,
0,
anim->y,
dst2,
dstStride2);
# else
/* Scale with swscale then flip image over Y axis. */
int *dstStride = anim->pFrameRGB->linesize;
uint8_t **dst = anim->pFrameRGB->data;
const int dstStride2[4] = {dstStride[0], 0, 0, 0};
uint8_t *dst2[4] = {dst[0], 0, 0, 0};
int x, y, h, w;
unsigned char *bottom;
unsigned char *top;
bottom = (unsigned char *)ibuf->rect;
top = bottom + ibuf->x * (ibuf->y - 1) * 4;
sws_scale(anim->img_convert_ctx,
(const uint8_t *const *)input->data,
input->linesize,
0,
anim->y,
dst2,
dstStride2);
h = (ibuf->y + 1) / 2;
w = ibuf->x;
bottom = (unsigned char *)ibuf->rect;
top = bottom + ibuf->x * (ibuf->y - 1) * 4;
for (y = 0; y < h; y++) {
unsigned char tmp[4];
unsigned int *tmp_l = (unsigned int *)tmp;
h = (ibuf->y + 1) / 2;
w = ibuf->x;
for (x = 0; x < w; x++) {
tmp[0] = bottom[0];
tmp[1] = bottom[1];
tmp[2] = bottom[2];
tmp[3] = bottom[3];
for (y = 0; y < h; y++) {
unsigned char tmp[4];
unsigned int *tmp_l = (unsigned int *)tmp;
bottom[0] = top[0];
bottom[1] = top[1];
bottom[2] = top[2];
bottom[3] = top[3];
for (x = 0; x < w; x++) {
tmp[0] = bottom[0];
tmp[1] = bottom[1];
tmp[2] = bottom[2];
tmp[3] = bottom[3];
*(unsigned int *)top = *tmp_l;
bottom[0] = top[0];
bottom[1] = top[1];
bottom[2] = top[2];
bottom[3] = top[3];
bottom += 4;
top += 4;
}
top -= 8 * w;
*(unsigned int *)top = *tmp_l;
bottom += 4;
top += 4;
}
top -= 8 * w;
}
else {
int *dstStride = anim->pFrameRGB->linesize;
uint8_t **dst = anim->pFrameRGB->data;
const int dstStride2[4] = {-dstStride[0], 0, 0, 0};
uint8_t *dst2[4] = {dst[0] + (anim->y - 1) * dstStride[0], 0, 0, 0};
sws_scale(anim->img_convert_ctx,
(const uint8_t *const *)input->data,
input->linesize,
0,
anim->y,
dst2,
dstStride2);
}
# endif
if (need_aligned_ffmpeg_buffer(anim)) {
uint8_t *src = anim->pFrameRGB->data[0];