-
Notifications
You must be signed in to change notification settings - Fork 201
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
Pixar batch renderer refactoring and performance improvements #577
Pixar batch renderer refactoring and performance improvements #577
Commits on Jun 9, 2020
-
[px_vp20] add GetMFrameContextDisplayStyle() utility function for the…
… legacy viewport This creates a public utility function out of the _ToMFrameContextDisplayStyle() private, static function in PxrMayaHdShapeAdapter. A subsequent commit will remove the old function and replace its usage with the new public function.
Configuration menu - View commit details
-
Copy full SHA for 8ac460e - Browse repository at this point
Copy the full SHA 8ac460eView commit details -
[pxrUsdMayaGL] use new utility function to convert legacy display sta…
…tus for VP 2.0 This change removes the private, static _ToMFrameContextDisplayStyle for PxrMayaHdShapeAdapter in favor of the newly added px_LegacyViewportUtils::GetMFrameContextDisplayStyle().
Configuration menu - View commit details
-
Copy full SHA for 4970573 - Browse repository at this point
Copy the full SHA 4970573View commit details -
[px_vp20] add functions for testing whether the display style indicat…
…es bounding box rendering
Configuration menu - View commit details
-
Copy full SHA for 4f41065 - Browse repository at this point
Copy the full SHA 4f41065View commit details -
[pxrUsdMayaGL] add batch renderer methods for drawing bounding boxes …
…only The current batch renderer API offers Draw() functions that draw shapes, bounding boxes, or both depending on the user data. The usage, however, is that only the PxrHdImagingShape invokes a draw for all of the shapes, and then individual shapes only need to draw their bounding boxes. This change adds independent bounding box-only methods that the shapes can use when they need to draw their bounding boxes. Subsequent commits will update MPxDrawOverrides and MPxSurfaceShapeUIs to use the appropriate draw method.
Configuration menu - View commit details
-
Copy full SHA for 2db526e - Browse repository at this point
Copy the full SHA 2db526eView commit details -
[pxrUsdMayaGL] always query the shape's bounding box when preparing f…
…or viewport draw This ensures that the bounding box is always available in case the viewport display style is changed and we don't end up executing another shape adapter Sync().
Configuration menu - View commit details
-
Copy full SHA for a549120 - Browse repository at this point
Copy the full SHA a549120View commit details -
[pxrUsdMayaGL] remove early out in GetMayaUserData()
Since practically we will now always have a bounding box in GetMayaUserData(), we remove the early return that used to check for it.
Configuration menu - View commit details
-
Copy full SHA for 1d2ad70 - Browse repository at this point
Copy the full SHA 1d2ad70View commit details -
[pxrUsdMayaGL] add private helper function for determining active sta…
…tus from displayStatus There are a handful of Maya displayStatus values that we consider "active", which means that Hydra should draw them including their wireframe. This reduces some duplicated code for determining whether the shape is active.
Configuration menu - View commit details
-
Copy full SHA for 1cecda7 - Browse repository at this point
Copy the full SHA 1cecda7View commit details -
[pxrUsdMayaGL] add useWireframe field to the render params
This field will provide an easy way to re-use the state determined during Sync(). Subsequent changes will make it so that only the displayStatus (and not the viewport-specific displayStyle) determine whether or not to use the wireframe.
Configuration menu - View commit details
-
Copy full SHA for e4a7ace - Browse repository at this point
Copy the full SHA e4a7aceView commit details -
[pxrUsdMayaGL] store whether or not to use the wireframe into the ren…
…der params This boolean will soon be based on only the shape's display status and not any viewport's display style, so it can accurately be cached during calls to Sync() and re-used in between.
Configuration menu - View commit details
-
Copy full SHA for 93a82ce - Browse repository at this point
Copy the full SHA 93a82ceView commit details -
[pxrUsdMayaGL] use render params useWireframe and query displayStatus…
… when computing repr This change renames the shape adapter GetReprSelectorForDisplayState() function to GetReprSelectorForDisplayStyle(), makes it non-virtual, and only requires that the displayStyle be provided. It will query Maya for the shape's displayStatus itself. We also use the render params' useWireframe field to determine whether or not to use a repr that includes the wireframe, in addition to the displayStyle. Note that we are still erroneously using the displayStyle at Sync() time to decide whether or not to enable lighting. This can be addressed later but for now it only causes subtly incorrect visual results for wireframe display styles in certain cases.
Configuration menu - View commit details
-
Copy full SHA for 7746547 - Browse repository at this point
Copy the full SHA 7746547View commit details -
[pxrUsdMayaGL] remove drawShape and drawBoundingBox params from GetRe…
…nderParams() Draw overrides for individual shapes will call the batch renderer's DrawBoundingBox() and pxrHdImagingShape's draw override will call Draw(), so we don't need the shape adapters to track (unreliably) whether to draw its shape and/or bounding box, especially since those can also vary depending on each viewport's displayStyle.
Configuration menu - View commit details
-
Copy full SHA for ba208df - Browse repository at this point
Copy the full SHA ba208dfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6ba5129 - Browse repository at this point
Copy the full SHA 6ba5129View commit details -
[pxrUsdMayaGL] call batch renderer DrawBoundingBox() from USD proxy s…
…hape draw callbacks Only the pxrHdImagingShape will actually invoke a Hydra draw to render shapes, so the only reason that individual shape draw callbacks will do any drawing is if they need to draw the bounding box for their shape.
Configuration menu - View commit details
-
Copy full SHA for 90aeee4 - Browse repository at this point
Copy the full SHA 90aeee4View commit details -
[pxrUsdMayaGL] make batch renderer Draw() only handle Hydra drawing
With the pxrHdImagingShape draw override now the only one that calls Draw(), we don't need any bounding-box related drawing code in those methods anymore, since individual shape draw overrides are instead expected to call DrawBoundingBox() as necessary from their own draw callbacks.
Configuration menu - View commit details
-
Copy full SHA for 5fff187 - Browse repository at this point
Copy the full SHA 5fff187View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7aa7034 - Browse repository at this point
Copy the full SHA 7aa7034View commit details -
[pxrUsdMayaGL] always store the wireframe color in the render params
Since we may not get another Sync() callback if the viewport display style is changed, we need to make sure that the wireframe color is always available from the render params. This may lead to slightly different shape adapter bucketing behavior, since the render params for shapes will pretty much always have a non-zero wireframe color now, but it shouldn't practically impact performance significantly. This also modifies the _GetWireframeColor() function to handle the MColor to GfVec4f conversion so that clients don't have to, and so that they can pass a pointer to the render params' wireframeColor directly.
Configuration menu - View commit details
-
Copy full SHA for 4189220 - Browse repository at this point
Copy the full SHA 4189220View commit details -
[pxrUsdMayaGL] remove virtual dispatch for shape adapter methods and/…
…or define them inline
Configuration menu - View commit details
-
Copy full SHA for 4fdc11c - Browse repository at this point
Copy the full SHA 4fdc11cView commit details -
[pxrUsdMayaGL] remove virtual dispatch of shape adapter Sync()
Derived classes can control their own behaviors in the protected _Sync().
Configuration menu - View commit details
-
Copy full SHA for 7846579 - Browse repository at this point
Copy the full SHA 7846579View commit details -
[pxrUsdMayaGL] make shape adapter base class responsible for identifiers
This moves all computation of a unique identifier for the shape into the shape adapter base class and removes it from derived classes. Instead of a fixed string and a hash of the Maya object, we instead query Maya for the node's UUID and use that directly as the shape's "identifier", which we also use both as the name of its rprim collection, and to construct the delegate ID. We use the node's UUID since MPxDrawOverrides may be constructed and destructed over the course of a node's lifetime (e.g. by doing 'ogs -reset'). Since the draw override owns the shape adapter, we therefore need an identifier tied to the node's lifetime rather than to the shape adapter's lifetime. With the delegate ID now stored in the base class, its accessor no longer needs to be virtual, and also gets defined inline.
Configuration menu - View commit details
-
Copy full SHA for d62fb64 - Browse repository at this point
Copy the full SHA d62fb64View commit details -
Configuration menu - View commit details
-
Copy full SHA for d3bbd46 - Browse repository at this point
Copy the full SHA d3bbd46View commit details -
[pxrUsdMayaGL] make shape adapter's _shapeDagPath a private field
Now that a bunch of other shape adapter data is recomputed whenever _SetDagPath() is called, we want to make sure that _shapeDagPath is not changed any other way, so this change makes it private instead of protected. Existing usage of the field now uses the public accessor instead.
Configuration menu - View commit details
-
Copy full SHA for aa65162 - Browse repository at this point
Copy the full SHA aa65162View commit details -
[pxrUsdMayaGL] use renderTags token from HdTokens instead of private …
…one in scene delegate
Configuration menu - View commit details
-
Copy full SHA for 5f0d234 - Browse repository at this point
Copy the full SHA 5f0d234View commit details -
[pxrUsdMayaGL] move GetPickingTasks() after GetRenderTasks()
This makes the ordering in the cpp file consistent with the declaration order in the header.
Configuration menu - View commit details
-
Copy full SHA for 2d0b160 - Browse repository at this point
Copy the full SHA 2d0b160View commit details -
Configuration menu - View commit details
-
Copy full SHA for 04ab04b - Browse repository at this point
Copy the full SHA 04ab04bView commit details -
[pxrUsdMayaGL] get viewport displayStyle in _RenderBatches() and plum…
…b it down to GetRenderTasks() displayStatus may vary per viewport, so we need to select the repr for each shape at draw time rather than at Sync() time. Subsequent commits will make use of the displayStyle by querying each shape adapter for the repr that should be used.
Configuration menu - View commit details
-
Copy full SHA for d4fdf26 - Browse repository at this point
Copy the full SHA d4fdf26View commit details -
[pxrUsdMayaGL] remove old, and now inaccurate, refactoring comments i…
…n GetRenderTasks()
Configuration menu - View commit details
-
Copy full SHA for fd0860c - Browse repository at this point
Copy the full SHA fd0860cView commit details -
[pxrUsdMayaGL] use a single selection task instead of one per render …
…params hash Since the parameters to the selection task do not vary based on anything shape related and in fact never change at all, there's no reason that we need one per set of unique render params. We can just always use the same one for all shapes.
Configuration menu - View commit details
-
Copy full SHA for d1232ad - Browse repository at this point
Copy the full SHA d1232adView commit details -
[pxrUsdMayaGL] map collection names to render tasks and render params…
… hashes to render setup tasks This change simplifies the mapping of HdRprimCollection names to render task IDs and hashes of render params to render setup task IDs, respectively. Since the batch renderer now never changes the collection of a render task itself, it no longer needs to mark them dirty on every draw. Note that this commit would actually cause somewhat of a performance regression on its own, since the single render task per collection would get thrashed a bit more as its repr is changed. Subsequent commits will make the shape adapters manage a collection and a render task ID *per* repr. This also allows the shape adapter to notify the change tracker when its collections or tasks need to be dirtied.
Configuration menu - View commit details
-
Copy full SHA for d7926c4 - Browse repository at this point
Copy the full SHA d7926c4View commit details -
[pxrUsdMayaGL] add a way to plumb shape adapters into GetRenderTasks(…
…) using prim filters This will allow us to delay computing which repr to use until draw time and to query the necessary data from the shape adapters directly. The original mechanism will be supported by specifying the shape adapter as nullptr in the prim filter. This commit adds the plumbing and a subsequent commit will take advantage of it when the shape adapters manage a collection per repr.
Configuration menu - View commit details
-
Copy full SHA for b59b187 - Browse repository at this point
Copy the full SHA b59b187View commit details -
[pxrUsdMayaGL] make shape adapters manage a collection and a render t…
…ask ID per repr This change provides a consistent one-to-one mapping between reprs, collections, and render tasks in the shape adapter. This results in minimal draw batch thrashing within hydra when the repr changes due to a change in Maya viewport displayStyle, since the repr on the collection never needs to change and the collection on the render task never needs to change. The shape adapter must be queried for which collection and render task ID to use based on a particular repr, so that handling has been added where necessary in the batch renderer and scene/task delegate. When rendering, the shape adapters are plumbed through to GetRenderTasks() where we determine what repr to use based on the displayStyle, and then use that repr to get the appropriate collection and render task ID for each shape we're drawing.
Configuration menu - View commit details
-
Copy full SHA for 9d27bf8 - Browse repository at this point
Copy the full SHA 9d27bf8View commit details -
[pxrUsdMayaGL] push "drawShape" out of shape adapter Sync() and into …
…GetRenderTasks() Storing whether or not to draw the shape during Sync() is not correct since we may be drawing for multiple viewports with differing displayStyles, or we may change displayStyles on a particular viewport and not get another prepareForDraw() callback. To fix this, instead of setting the delegate's root visibility during sync, we check during GetRenderTasks() to see whether there's an active render for the given displayStatus, and simply skip adding the render task if there isn't one.
Configuration menu - View commit details
-
Copy full SHA for ece9429 - Browse repository at this point
Copy the full SHA ece9429View commit details -
[pxrUsdMayaGL] add a shape adapter function for dirtying its render t…
…asks Though this is not yet being used, this function can be used to notify the change tracker when the shape adapter detects a change in the shape that requires regenerating draw batches.
Configuration menu - View commit details
-
Copy full SHA for 7acc081 - Browse repository at this point
Copy the full SHA 7acc081View commit details -
[pxrUsdMayaGL] add missing header includes in batch renderer .h and .…
…cpp files Symbols from these headers are used, but the headers were not being included.
Configuration menu - View commit details
-
Copy full SHA for f3f0405 - Browse repository at this point
Copy the full SHA f3f0405View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4fbe00e - Browse repository at this point
Copy the full SHA 4fbe00eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 24031f0 - Browse repository at this point
Copy the full SHA 24031f0View commit details