Skip to content

Dynamic pipeline state#86

Merged
crud89 merged 8 commits intomainfrom
dynamic-pipeline-state
Mar 23, 2023
Merged

Dynamic pipeline state#86
crud89 merged 8 commits intomainfrom
dynamic-pipeline-state

Conversation

@crud89
Copy link
Copy Markdown
Owner

@crud89 crud89 commented Mar 23, 2023

Describe the pull request

This PR moves the viewport, scissor, blend factors and stencil reference states out of the render pipeline state. This allows for them to be altered without requiring a second pipeline instance. Instead, the command buffer now provides an interface to set the state accordingly.

For the Vulkan backend, this uses the VK_EXT_extended_dynamic_state extension, which has been promoted to core with Vulkan 1.3. This is a good excuse to raise the minimum required SDK version to 1.3.204.1.

Note, that it is now mandatory to set (at least) the viewport and scissor after binding a pipeline and not later than issuing a draw call, e.g.:

renderPass.begin(backBuffer);
auto& commandBuffer = renderPass.activeFrameBuffer().commandBuffer(0);
commandBuffer.use(geometryPipeline);
commandBuffer.setViewports(m_viewport.get());
commandBuffer.setScissors(m_scissor.get());

All samples and the tutorial have been updated to reflect those changes.

Known issues

Note that calling setViewports or setScissors with validation layers enabled will crash the application. This is due to a bug in the validation layer implementation, which hopefully will be resolved soon. (See #88)

@crud89 crud89 added Priority: Medium A issue with normal priority. Type: Requirement Vulkan πŸŒ‹ The issue involves the Vulkan backend. DX12 ❎ The issue involves the DX12 backend. labels Mar 23, 2023
@crud89 crud89 added this to the Alpha #04 milestone Mar 23, 2023
@crud89 crud89 self-assigned this Mar 23, 2023
@crud89 crud89 marked this pull request as ready for review March 23, 2023 20:51
@crud89 crud89 merged commit a002bcc into main Mar 23, 2023
@crud89 crud89 deleted the dynamic-pipeline-state branch March 24, 2023 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DX12 ❎ The issue involves the DX12 backend. Priority: Medium A issue with normal priority. Vulkan πŸŒ‹ The issue involves the Vulkan backend.

Projects

Status: v0.4.1

Development

Successfully merging this pull request may close these issues.

1 participant