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

Use dynamic viewport states. #12

Closed
crud89 opened this issue Apr 27, 2021 · 1 comment · Fixed by #19
Closed

Use dynamic viewport states. #12

crud89 opened this issue Apr 27, 2021 · 1 comment · Fixed by #19
Assignees
Labels
Module: Vulkan 🌋 The issue involves the Vulkan backend. Priority: Medium A issue with normal priority. Type: Feature Request New feature or request. Type: Requirement An implementation is required before the next release.
Milestone

Comments

@crud89
Copy link
Owner

crud89 commented Apr 27, 2021

In Vulkan there are two ways for updating a viewport. Currently only static viewports, that are directly passed to the pipeline during creation are supported. The problem is, that a resize requires all pipelines to be recreated in this case, which can be inefficient. Dynamic viewport states do not require the pipeline itself to be recreated, but only the swap-chain. In this case, a vkCmdSetViewport call is made to set the viewport. The problem with this approach, however, is, that it might not be as efficient during runtime.

Since there are tradeoffs with both approaches, we should support them both.

@crud89 crud89 added Type: Feature Request New feature or request. Module: Vulkan 🌋 The issue involves the Vulkan backend. labels Apr 27, 2021
crud89 added a commit that referenced this issue May 4, 2021
Instead pipelines should be bound manually during execution. This
contributes to issue #10.

The sole reason for resetting the whole pipeline was to allow for
viewports to be resized. This now requires us to use dynamic viewport
and scissor states, as mentioned in issue #12.
@crud89 crud89 added this to the Alpha #01 milestone May 4, 2021
@crud89
Copy link
Owner Author

crud89 commented May 4, 2021

There is an overhead with re-creating all pipelines when resizing the frame buffer. The only reason why pipelines are re-created is to support viewport and scissor resizing. Meanwhile, dynamic viewport an scissor states do not have any significant impact on render performance (only one vkCmdSetViewport and one vkCmdSetScissor call per pipeline bind event). Hence we could drop static viewports alltogether in favor of more straightforward resize handling.

@crud89 crud89 changed the title Allow dynamic viewport states. Use dynamic viewport states. May 4, 2021
@crud89 crud89 self-assigned this May 4, 2021
@crud89 crud89 pinned this issue May 4, 2021
@crud89 crud89 added Priority: Medium A issue with normal priority. Status: In Progress Type: Requirement An implementation is required before the next release. labels May 4, 2021
@crud89 crud89 linked a pull request May 4, 2021 that will close this issue
9 tasks
@crud89 crud89 closed this as completed May 5, 2021
@crud89 crud89 unpinned this issue May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Module: Vulkan 🌋 The issue involves the Vulkan backend. Priority: Medium A issue with normal priority. Type: Feature Request New feature or request. Type: Requirement An implementation is required before the next release.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant