-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multithreaded, selective attribute updates #1156
Conversation
Have you run the
I also notice that you've started using I'll dive into a proper review once we know what's going on with the test failure... |
Gah - yeah, I was just running GafferSceneTest wasn't I - what was I thinking. I'll take a look |
231ac4c
to
14850e0
Compare
Right - so it looks like that was an uncaught exception problem. I've added basic exception handling to the tbb::pipeline functions too stop the crash - the problem now being that it'll spam you with errors if there's something wrong with the graph, rather than just terminating. I'll see if I can find a better way of doing that... Also, I'm getting a test failure in testMoveCoordinateSystem, which miiiiiight just be numerical precision in the shader or something, although I haven't fully investigated it yet. Anyway, there you go |
eh? I wrote out all the "myLovelyPlane" images that were getting tested, and they all seemed fine. The 'eck? |
So it looks like the back plane wasn't covering the entire render in the test, leaving a margin of pixels with unexpected values. If I scale the plane by a factor of 10, that fixes the failures, although it's a bit of a mystery to me why that margin was being read in the first place, as it's reading at uv coordinates 0.1,0.1, 0.5,0.5 and 0.9,0.9, which don't sound like they'd be anywhere near the edge. |
Just got some new performance stats for the robot from this morning, for doing a big shader edit hitting 2600 objects. This is from 3delight 11.0.133, where they've sped up the RiEdit stuff quite a bit:
So 3delight 11.0.133 is considerably better than 3delight 11.0.126. It's interesting how commenting out the RiShader calls cuts the startup time in half.... it looks like most of the 3delight startup time is going into instantiating shaders? Anyway, it kind of looks like the IECoreRi code's costing us 8 seconds doesn't it? Traversal takes 4 seconds, but that happens in the background, so I reckon blasting through an equivalent precompiled list of IECoreRi calls in a single thread would probably take 8 seconds. On top of that, it looks like the RiEdit blocks cost us an extra 4 seconds |
So, after playing around with IECoreRI a bit, I managed to get that 8 seconds down to 5.5. Here's what I've done so far:
It also looks like you can knock another half second off by commenting out the bit in RendererImplementation::shader() that builds the type hints - apparently it doesn't like making all those map insertions. |
Nice! Did you actually measure the Now we have |
m_childIndices.push_back( 0 ); | ||
} | ||
|
||
void next() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'm right in saying that this is an implementation detail of SceneGraphIteratorFilter? If that's the case, can you make it private to make it clear that it's not something that tbb will use directly.
I've made a bunch of inline comments - a few style things that should be easy to fix, a couple of suggestions which should help with performance, and a couple of questions to aid my understanding. Thanks for the clear comments on the filter tasks - they made the code very easy to dive into. There's one broader issue here as well though. It's not allowed to use "scene:path" values that aren't predetermined as being valid - where validity means "every name in the path is present in the childNames at that level" (SceneAlgo provides a check for this with |
Do you know what'll happen with the "suspend rendering during edits" change with 3delight prior to 11.0.138? I suspect it might be a problem, and I really want to keep Gaffer compatible with the free download of 3delight as far as possible. |
Just rebased from master and removed "fixed hang when switching from 'paused' to 'stopped'" commit, as that was in the master already |
24c399d
to
e2f09c7
Compare
Hmm - I tried it on 11.0.134 actually, and surprisingly the code in commit 87b819a wasn't a problem. Also, I just checked on the 3delight website, and the free download is version 11.0.142 |
Just made a little addition so inactive InteractiveRenders don't do the childNames check when the childNames plug gets dirtied |
Hey, are we ready to get this rolling? People are complaining about the IPR crashing when they fiddle with the graph while it's starting up and stuff like that. You reckon I should add a simple stderr startup progress indicator first actually? |
Yeah, I think we're pretty much there aren't we? I'd just like to take it for a bit of a spin before merging (I've only looked at the code so far). Do you know when we're planning to make the next release? And do you think it'd be good to do some user testing before merging or are you happy to get it straight into the wild? |
I think the old one's a bit temperamental anyway, probably because of the asynchronous startup, so I'd be fairly happy just slapping it down and seeing what happens. What do you reckon about the progress indicator? It'd make people less annoyed at the new UI freezes |
Hi David,
I've been unable to get the same to happen on master. Since |
Actually it's possible that's because it hasn't been rebased onto master yet? I'll give that a go |
I was testing with a merge of your branch onto master, if that helps at all - using the command line that GitHub gives at the bottom of this pull request. |
Initial scene output also goes directly to the renderer, rather than via procedurals, so we can block the main thread
Uncaught exceptions were previously causing hangs
In this commit I'm checking for changing child names when the childNames plug gets dirtied (I'm reluctant to do it during a regular update because it means extra hash/plug evaluations, sorting lists etc during something I want to be fast). If a location's child names change, the lists get compared, and locations in the scene graph that are no longer present get an m_locationPresent flag that I've added set to false. This stops the SceneGraphIteratorFilter traversing into them so they don't get updated.
e61e719
to
0ec757e
Compare
ah there we go - it's because I wasn't catching exceptions in plugDirtied(). Updated |
Hello. Is this ready to go? |
Yep, thanks. I do have a couple of notes on it still, but I think it's more important that we get this into people's hands first... |
Multithreaded, selective attribute updates
Initial scene output also goes directly to the renderer, rather than via procedurals, so we can block the main thread