Fix T49864: EnvMap baking crashes 2.78 if 'Full Sample' checked in AA
This commit is contained in:
parent
f89c6e739a
commit
a70a7f9db3
Notes:
blender-bot
2023-02-14 10:54:29 +01:00
Referenced by issue #49864, EnvMap baking crashes 2.78 if 'Full Sample' checked in AA
|
@ -1026,15 +1026,16 @@ void IMB_exr_set_channel(void *handle, const char *layname, const char *passname
|
|||
ExrChannel *echan;
|
||||
char name[EXR_TOT_MAXNAME + 1];
|
||||
|
||||
if (layname) {
|
||||
if (layname && layname[0] != '\0') {
|
||||
char lay[EXR_LAY_MAXNAME + 1], pass[EXR_PASS_MAXNAME + 1];
|
||||
BLI_strncpy(lay, layname, EXR_LAY_MAXNAME);
|
||||
BLI_strncpy(pass, passname, EXR_PASS_MAXNAME);
|
||||
|
||||
BLI_snprintf(name, sizeof(name), "%s.%s", lay, pass);
|
||||
}
|
||||
else
|
||||
else {
|
||||
BLI_strncpy(name, passname, EXR_TOT_MAXNAME - 1);
|
||||
}
|
||||
|
||||
echan = (ExrChannel *)BLI_findstring(&data->channels, name, offsetof(ExrChannel, name));
|
||||
|
||||
|
@ -1043,8 +1044,9 @@ void IMB_exr_set_channel(void *handle, const char *layname, const char *passname
|
|||
echan->ystride = ystride;
|
||||
echan->rect = rect;
|
||||
}
|
||||
else
|
||||
else {
|
||||
printf("IMB_exr_set_channel error %s\n", name);
|
||||
}
|
||||
}
|
||||
|
||||
float *IMB_exr_channel_rect(void *handle, const char *layname, const char *passname, const char *viewname)
|
||||
|
|
|
@ -61,6 +61,7 @@
|
|||
#include "renderpipeline.h"
|
||||
#include "texture.h"
|
||||
#include "zbuf.h"
|
||||
#include "render_result.h"
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
|
@ -493,11 +494,18 @@ static void render_envmap(Render *re, EnvMap *env)
|
|||
env_rotate_scene(envre, tmat, 0);
|
||||
|
||||
if (re->test_break(re->tbh) == 0) {
|
||||
RenderLayer *rl = envre->result->layers.first;
|
||||
int y;
|
||||
float *alpha;
|
||||
float *rect;
|
||||
|
||||
if (envre->result->do_exr_tile) {
|
||||
BLI_rw_mutex_lock(&envre->resultmutex, THREAD_LOCK_WRITE);
|
||||
render_result_exr_file_end(envre);
|
||||
BLI_rw_mutex_unlock(&envre->resultmutex);
|
||||
}
|
||||
|
||||
RenderLayer *rl = envre->result->layers.first;
|
||||
|
||||
/* envmap is rendered independently of multiview */
|
||||
rect = RE_RenderLayerGetPass(rl, RE_PASSNAME_COMBINED, "");
|
||||
ibuf = IMB_allocImBuf(envre->rectx, envre->recty, 24, IB_rect | IB_rectfloat);
|
||||
|
|
Loading…
Reference in New Issue