Skip to content

Conversation

@laurelkeys
Copy link
Contributor

@laurelkeys laurelkeys commented Jun 29, 2020

The color map post-processing stage, applied when False Colors is enabled, is being called twice on Stop Rendering (Shift+F5).


This happens by on_rendering_abort() being called and emitting a signal_rendering_abort() at:

MasterRenderer::RenderingResult render(IRendererController& renderer_controller)

which also results in emitting signal_rendering_failed() on:

const MasterRenderer::RenderingResult rendering_result =
m_master_renderer.render(m_renderer_controller);
if (rendering_result.m_status != MasterRenderer::RenderingResult::Succeeded)
emit signal_rendering_failed();

Thus, slot_rendering_end() runs twice.


I'm submitting a "conservative" fix, as it only prevents False Colors from being applied when a "failed" signal is emitted (other previous behavior stay the same).

However, it would be interesting to remove unnecessary computations that are being run twice. Creating a new signal_rendering_aborted() on renderingmanager.cpp could help splitting what should be run on "aborting" from "failing", e.g.:

- if (rendering_result.m_status != MasterRenderer::RenderingResult::Succeeded)
-     emit signal_rendering_failed();
+ switch (rendering_result.m_status)
+ {
+   case MasterRenderer::RenderingResult::Succeeded:
+     break;
+ 
+   case MasterRenderer::RenderingResult::Aborted:
+     emit signal_rendering_aborted();
+     break;
+ 
+   default:
+     emit signal_rendering_failed();
+     break;
+ }

Copy link
Member

@oktomus oktomus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks !

Creating a new signal_rendering_aborted() on renderingmanager.cpp could help splitting what should be run on "aborting" from "failing"

You mean a new signal_rendering_failed ? If so, I think it's a good idea.

@laurelkeys
Copy link
Contributor Author

Thanks !

Creating a new signal_rendering_aborted() on renderingmanager.cpp could help splitting what should be run on "aborting" from "failing"

You mean a new signal_rendering_failed ? If so, I think it's a good idea.

Sorry, on_rendering_abort() emits signal_rendering_abort() (not signal_rendering_aborted() as I had previously written at the PR description, this isn't declared).

The MasterRendererThread inside renderingmanager.cpp has a single "failed" signal, which it emits both when m_status is Aborted and Failed (line 116 of the second code snippet in the description above).

So, adding an alternative for signal_rendering_failed to be called when the render is aborted (e.g. signal_rendering_aborted) would give us more information:

image

@oktomus oktomus force-pushed the signal-rendering-end branch from cc68fe4 to 6284638 Compare October 18, 2020 13:19
Copy link
Member

@oktomus oktomus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@laurelkeys We tested and modified the fix with @dictoon. Instead of adding a new flag for the failure, we prevented the slot slot_rendering_end from being triggered twice.

The main fix is in mainwindow/rendering/renderingmanager.cpp.

We were also reporting an abort when it was actually a failure.

@oktomus oktomus added the PR | Squash This PR must be squashed when merged. label Oct 18, 2020
@oktomus oktomus merged commit 0acfc05 into appleseedhq:master Oct 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR | Squash This PR must be squashed when merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants