Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
0c2b9cf
Prefer use of dynamic state for viewport and scissor
SaschaWillems Apr 1, 2022
84ad844
Slight rewording, working in-page anchor
SaschaWillems Apr 2, 2022
e83821a
Updated command buffers chapter and code to use dynamic viewport and …
SaschaWillems Apr 2, 2022
a54e39e
Updated swap chain recreation chapter
SaschaWillems Apr 2, 2022
51c260e
Updated command buffer chapter code to use dynamic viewport and scissor
SaschaWillems Apr 2, 2022
858d92d
Removed render pass destruction/creation for swap chain recreation
SaschaWillems Apr 2, 2022
0dd95af
Use dynamic state for viewport and scissor for samples after the fixe…
SaschaWillems Apr 2, 2022
806b78d
Use dynamic state for viewport and scissor for samples after the swap…
SaschaWillems Apr 2, 2022
e7e9d8d
Removed duplicate code
SaschaWillems Apr 2, 2022
0c60c92
Wording change
SaschaWillems Apr 2, 2022
35dd1d6
Changed wording on chapter intro, moved dynamic state paragraph to th…
SaschaWillems Apr 2, 2022
7c9d4da
Fixed wording
SaschaWillems Apr 19, 2022
dac0600
Fixed wording
SaschaWillems Apr 19, 2022
8bf72b9
C++ style cast
SaschaWillems Apr 19, 2022
04c6501
Wording
SaschaWillems Apr 19, 2022
7eac464
Wording
SaschaWillems Apr 19, 2022
1fb414b
Wording
SaschaWillems Apr 19, 2022
ea851d5
Added note on renderpass recreation
SaschaWillems May 6, 2022
de18ed9
Merge branch 'master' into dynamic_viewport
SaschaWillems Jun 11, 2022
cdaf5e6
Apply suggestions from code review
SaschaWillems Jun 25, 2022
748086e
Added dynamic state to conclusion chapter
SaschaWillems Jun 26, 2022
1e5de0b
Remove unnecessary link
SaschaWillems Jul 3, 2022
f87bfe7
Remove code referencing command buffers too early
SaschaWillems Jul 3, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply suggestions from code review
Incorporate suggestions

Co-authored-by: Alexander Overvoorde <overv161@gmail.com>
  • Loading branch information
SaschaWillems and Overv authored Jun 25, 2022
commit cdaf5e640c7bed19615acc5068f3450d973fd848
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ scissor.offset = {0, 0};
scissor.extent = swapChainExtent;
```

Viewport(s) and scissor rectangle(s) can either be specified as a static part of the pipeline or as a [dynamic state](#dynamic-state) set in the command buffer. While the former is more in line with the other states it's often convenient to make viewport and scissor state dynamic as it gives you a lot more flexibility. This is very common all implementations can handle this dynamic state without performance penalty.
Viewport(s) and scissor rectangle(s) can either be specified as a static part of the pipeline or as a [dynamic state](#dynamic-state) set in the command buffer. While the former is more in line with the other states it's often convenient to make viewport and scissor state dynamic as it gives you a lot more flexibility. This is very common and all implementations can handle this dynamic state without a performance penalty.

When opting for dynamic viewport(s) and scissor rectangle(s) you need to enable the respective dynamic states for the pipeline:

Expand All @@ -152,7 +152,7 @@ dynamicState.dynamicStateCount = static_cast<uint32_t>(dynamicStates.size());
dynamicState.pDynamicStates = dynamicStates.data();
```

And then only to specify their count at pipeline creation time:
And then you only need to specify their count at pipeline creation time:

```c++
VkPipelineViewportStateCreateInfo viewportState{};
Expand Down Expand Up @@ -187,7 +187,7 @@ viewportState.scissorCount = 1;
viewportState.pScissors = &scissor;
```

Independent of how you set them, it's is possible to use multiple viewports and scissor rectangles on some graphics cards, so the structure members reference an array of them. Using multiple requires enabling a GPU feature (see logical device creation)
Independent of how you set them, it's is possible to use multiple viewports and scissor rectangles on some graphics cards, so the structure members reference an array of them. Using multiple requires enabling a GPU feature (see logical device creation).

## Rasterizer

Expand Down