Commit Graph

8 Commits (4d8c8fdda39849eb3a358a2fc8b5ab5c2304d237)

Author SHA1 Message Date
Chris Burel d2cdb511d0
Improve the framerate of Editor widgets that update in the TickBus (#7408)
Previously, with no level loaded in the main editor, and no assets loaded
in the EMotionFX editor, the AnimGraph viewport would only update at 15fps,
even on a 64 core machine.

Digging into this with Pix, I found that EMotionFX's UI would only get
updated for every other call to the ComponentApplication tick.

The Editor's QApplication instance controls how the
`ComponentApplication::OnTick` method is called. This is done in the
`maybeProcessIdle()` method. Generally, I found callstacks like this:

```
EditorQtApplication::maybeProcessIdle()
  CCryEditApp::OnIdle()
    CCryEditApp::IdleProcessing()
      CGameEngine::Update()                  # ~2.2ms
        PhysX::Update()                      # ~1.8ms
        EMotionFX::Update()                  # ~0.2ms
          calls QWidget::update() on all the widgets that change per
          frame, only puts update events on the event queue, doesn't
          paint anything
      AZ::ComponentApplication::TickSystem() # ~25ms
        renders the frame with Atom          # ~24ms
```

The `maybeProcessIdle()` method is invoked by a QTimer, with a timeout
that changes depending on the application state. If the Editor is in
game mode, it used a timeout of 0, which essentially forced the game to
run at as high an fps as possible. If the Editor application has focus,
it used a timeout of 1ms, asking for the idle processing to happen at
1000 fps.  Otherwise, it used a timeout of 10ms, asking for idle
processing at 100 fps.

Those fps targets are not realistic. What happened in this case is that
while the PhysX system was being updated, while the previous
`maybeProcessIdle()` call was still processing, the idle processing
timer would timeout again, and place a timer event on Qt's event queue,
before anything else had a chance to do anything. Only afterward would
EMotionFX's MainWindow::OnTick would be invoked, placing paint events on
Qt's event queue.

The fix for this is to use a single shot timer at the end of each
`maybeProcessIdle()` call. This ensures that any events that are
enqueued during the `maybeProcessIdle()` call are processed prior to the
next call to `maybeProcessIdle()`.

Signed-off-by: Chris Burel <burelc@amazon.com>
4 years ago
Chris Galvan 1c6fbdab2a Removed legacy/unused IEventLoopHook
Signed-off-by: Chris Galvan <chgalvan@amazon.com>
4 years ago
Yaakuro 8e03d6f306
Separate application into platform specific files. (#4799)
Signed-off-by: Yaakuro <y1@codeposer.net>
4 years ago
Guthrie Adams 7cb2f62d4b
Merge pull request #1250 from aws-lumberyard-dev/lawalfua/commonToolsApplication
Addition of a base AzQtToolsApplication class
4 years ago
Steve Pham 38261d0800
Shorten copyright headers by splitting into 2 lines (#2213)
* Updated all copyright headers to split the longer original copyright line into 2 shorter lines

Signed-off-by: Steve Pham <spham@amazon.com>
4 years ago
Dayo Lawal 8f22bff1fb QEditorApplication inheriting from AzQtApplication
Signed-off-by: Dayo Lawal <lawalfua@amazon.com>
4 years ago
Steve Pham b4a2edec6a
Final update copyright headers to reference license files at the repo root (#1693)
* Final update copyright headers to reference license files at the repo root

Signed-off-by: spham <spham@amazon.com>

* Fix copyright validator unit tests to support the stale O3DE header scenario

Signed-off-by: spham <spham@amazon.com>
5 years ago
Esteban Papp e34e36cb35 git mv Code\Sandbox\Editor Code/Editor
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
5 years ago