Fix T53357: harmless assert after recent addition of render time pass.

This commit is contained in:
Brecht Van Lommel 2017-11-23 17:00:18 +01:00
parent dd04f54e84
commit 6be95f8778
Notes: blender-bot 2023-02-14 08:42:53 +01:00
Referenced by issue #53357, Given file crash when redering with Cycles in current master (debug build) - Pass issue?
1 changed files with 9 additions and 8 deletions

View File

@ -236,10 +236,17 @@ bool RenderBuffers::get_pass_rect(PassType type, float exposure, int sample, int
int size = params.width*params.height;
if(components == 1) {
if(components == 1 && type == PASS_RENDER_TIME) {
/* Render time is not stored by kernel, but measured per tile. */
float val = (float) (1000.0 * render_time/(params.width * params.height * sample));
for(int i = 0; i < size; i++, pixels++) {
pixels[0] = val;
}
}
else if(components == 1) {
assert(pass.components == components);
/* scalar */
/* Scalar */
if(type == PASS_DEPTH) {
for(int i = 0; i < size; i++, in += pass_stride, pixels++) {
float f = *in;
@ -264,12 +271,6 @@ bool RenderBuffers::get_pass_rect(PassType type, float exposure, int sample, int
}
}
#endif
else if(type == PASS_RENDER_TIME) {
float val = (float) (1000.0 * render_time/(params.width * params.height * sample));
for(int i = 0; i < size; i++, pixels++) {
pixels[0] = val;
}
}
else {
for(int i = 0; i < size; i++, in += pass_stride, pixels++) {
float f = *in;