Skip to content
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

Fix Vulkan issues with VK_ERROR_OUT_OF_DATE caused by the swapchain not being updated on a resize #4740

Conversation

spham-amzn
Copy link
Contributor

On Linux using the MaterialEditor, it was observed that at least ScreenChangeInternal and UpdateLater needed the swapchain to be recreated. Will test on Windows

  • Updated the RenderViewportWidget::event method to call 'SendWindowResizeEvent' on specific events
  • Moved the onResize to one of the events in RenderViewportWidget::event

Signed-off-by: Steve Pham spham@amazon.com

…ot being updated on a resize

- Updated the RenderViewportWidget::event method to call 'SendWindowResizeEvent' on specific events
- Moved the onResize to one of the events in RenderViewportWidget::event

Signed-off-by: Steve Pham <spham@amazon.com>
switch (event->type())
{
case QEvent::ScreenChangeInternal:
case QEvent::UpdateLater:
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this needed? I'm not sure what would be queueing a render here, but it also can't hurt to make sure the swap chain is valid if we do.

Copy link
Contributor

Choose a reason for hiding this comment

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

Current Vulkan swapchain creation doesn't support recreation if changes in surface is detected. The only chance is through resize event, where the surface and swapchain are created from scratch, same as in initialization.
There 2 more events are found to change the surface as well. So we need to call resize, as this is currently the only way.
I am adding swapchain recreation now. This change can be a workaround to avoid crashes for Material Editor and UI Editor.

@spham-amzn spham-amzn merged commit e646433 into o3de:development Oct 18, 2021
@spham-amzn spham-amzn deleted the LYN-7089/FixVulkanOutOfDateIssues branch October 18, 2021 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants