Skip to content

Update tutorial to use dynamic state for viewport and scissor #293

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

Merged
merged 23 commits into from
Jul 3, 2022
Merged

Update tutorial to use dynamic state for viewport and scissor #293

merged 23 commits into from
Jul 3, 2022

Conversation

SaschaWillems
Copy link
Contributor

This PR updates the tutorial to use dynamic state for viewport and scissor rectangles. This simplifies things a lot and no longer requires e.g. pipelines and render passes to be recreated with the swap chain on window resize.

  • Update chapter "Fixed function":
    • Better wording on baked state in pipeline state objects
    • Moved dynamic state paragraph to the top and also slightly reworded it
    • Updated the viewport and scissor state chapter with dynamic state and why it's better to use this instead of baking it
  • Update chapter "Command buffers"
    • Added viewport and scissor setup to command buffer recording
  • Update chapter "Swapchain recreation"
    • With dynamic state for viewport and scissor, it's no longer required to recreate pipeline and render pass when the swapchain is recreated
  • Update all code files that had viewport and scissor state baked into the pipeline to use dynamic state instead and set viewport and scissor at command buffer creation
  • Update all code files after the swap chain chapter to no longer recreate the render pass and pipeline when the swap chain was recreated

@Overv
Copy link
Owner

Overv commented Jun 12, 2022

I'll review this sometime this week.

@Overv Overv self-requested a review June 20, 2022 19:51
SaschaWillems and others added 2 commits June 25, 2022 10:08
@Overv
Copy link
Owner

Overv commented Jun 27, 2022

If you replace the link and (re)move the early command buffer mentions then I'll approve and merge 👍

@SaschaWillems
Copy link
Contributor Author

I have pushed the changes.

@Overv Overv merged commit 8780354 into Overv:master Jul 3, 2022
Overv added a commit that referenced this pull request Mar 8, 2023
* Prefer use of dynamic state for viewport and scissor

* Slight rewording, working in-page anchor

* Updated command buffers chapter and code to use dynamic viewport and scissor state

* Updated swap chain recreation chapter

No more need to recreate the graphics pipeline as viewport and scissor state are now dynamic

* Updated command buffer chapter code to use dynamic viewport and scissor

* Removed render pass destruction/creation for swap chain recreation

This is not needed anymore

* Use dynamic state for viewport and scissor for samples after the fixed function chapter

* Use dynamic state for viewport and scissor for samples after the swap chain recreation chapter

Removed render pass destruction/creation for swap chain recreation, no longer necessary

* Removed duplicate code

* Wording change

* Changed wording on chapter intro, moved dynamic state paragraph to the top

* Fixed wording

* Fixed wording

* C++ style cast

* Wording

* Wording

* Wording

* Added note on renderpass recreation

* Apply suggestions from code review

Incorporate suggestions

Co-authored-by: Alexander Overvoorde <[email protected]>

* Added dynamic state to conclusion chapter

* Remove unnecessary link

* Remove code referencing command buffers too early

Co-authored-by: Alexander Overvoorde <[email protected]>
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.

2 participants