KhronosGroup / KhronosGroup/Vulkan-Docs
Pipeline states VUs issues?
@critsec is already working on this.
Since Aug 21, 2017.
- Dominant language
- JavaScript
- Stars
- 3.3k
- Forks
- 549
- Avg merge
- 5d 5h
- Merged PRs (30d)
- 2
Description
I feel the pipeline state VUs are a bit off in several places:
VkGraphicsPipelineCreateInfoVU says:
- If no element of the
pDynamicStatesmember ofpDynamicStateisVK_DYNAMIC_STATE_VIEWPORT, thepViewportsmember ofpViewportStatemust be a pointer to an array ofpViewportState::viewportCountVkViewportstructures
and
- If the
rasterizerDiscardEnablemember ofpRasterizationStateisVK_FALSE,pViewportStatemust be a pointer to a validVkPipelineViewportStateCreateInfostructure
So, what if rasterizerDiscardEnable is VK_TRUE and pDynamicStates does not contain VK_DYNAMIC_STATE_VIEWPORT? In such case one VU allows invalid pViewportState, but the other requires valid state inside it (suspicious).
- Similarly as # 1 but for scissors.
VkGraphicsPipelineCreateInfoVU says:
- If the wide lines feature is not enabled, and no element of the
pDynamicStatesmember ofpDynamicStateisVK_DYNAMIC_STATE_LINE_WIDTH, thelineWidthmember ofpRasterizationStatemust be1.0
If rasterizerDiscardEnable is VK_TRUE does it make sense to require lineWidth to be set? Is the value used for something in such case?
- Does it even make sense to allow
VK_DYNAMIC_STATE_LINE_WIDTHinpDynamicStatesif wide lines feature is not enabled? In such case only one value(1.0) exists. Sounds unnecessary to set it dynamically and sounds unnecessary even for flexibility sake cosidering that feature is enabled/disabled for a whole Device.
VkGraphicsPipelineCreateInfoVU says:
- If the
rasterizerDiscardEnablemember ofpRasterizationStateisVK_FALSE,pMultisampleStatemust be a pointer to a validVkPipelineMultisampleStateCreateInfostructure
and
- If
subpassuses color and/or depth/stencil attachments, then therasterizationSamplesmember ofpMultisampleStatemust equal the maximum of the sample counts of those subpass attachments
What if rasterizerDiscardEnable is VK_TRUE and subpass uses color attachment? One VU allows invalid pMultisampleState while other requires a valid state inside it (suspicious).
- If
subpasshas a depth/stencil attachment and depth test, stencil test, or depth bounds test are enabled, then therasterizationSamples member ofpMultisampleStatemust be the same as the sample count of the depth/stencil attachment
Could be more explicitly worded (how do I know those tests are enabled? This VU uses "has a depth/stencil attachment"; does UNUSED count?).
Also does rasterizerDiscardEnable=VK_TRUE also imply those tests are disabled or not? Shouldn't there be VU forcing user to explicitly disable those tests if rasterizerDiscardEnable=VK_TRUE to reduce surprises?
If
subpasshas any color attachments, then therasterizationSamplesmember ofpMultisampleStatemust be greater than or equal to the sample count for those subpass attachments
What if rasterizerDiscardEnable is VK_TRUE and subpass has color attachments? One VU allows invalid pMultisampleState while this VU requires valid value inside it (suspicious).
If
subpassdoes not use any color and/or depth/stencil attachments, then therasterizationSamplesmember ofpMultisampleStatemust follow the rules for a zero-attachment subpass
What if rasterizerDiscardEnable is VK_TRUE and subpass has no such attachments? One VU allows invalid pMultisampleState while this VU requires valid value inside it (suspicious).
- Why does
pAttachments[]ofVkPipelineColorBlendStateCreateInfohave to be valid for subpass attachments that areVK_ATTACHMENT_UNUSED?
pDynamicStateparameter descriptions are twice in the text. Well, the paragraps below the bullet point parameter descriptions seem redundant.
- Should
pDynamicStatehaveVK_DYNAMIC_STATE_VIEWPORTifrasterizerDiscardEnableisVK_TRUE(i.e.pViewportStateis invalid). What is the the viewport count in that case? Does it still have to be set as draw commands say:
If the
VkPipelineobject currently bound toVK_PIPELINE_BIND_POINT_GRAPHICSrequires any dynamic state, that state must have been set on the current command buffer
- Similarly as # 8 but for scissors.
a) Should VK_DYNAMIC_STATE_LINE_WIDTH be allowed in pDynamicStates if rasterization is disabled? Does it really have to be set before a draw command?
b) Should VK_DYNAMIC_STATE_DEPTH_BIAS be allowed in pDynamicStates if depthBiasEnable is VK_FALSE? Does it still really have to be set before a draw command?
c) Similarly should other VK_DYNAMIC_STATE_* be allowed if that feature is disabled elsewhere in the VkGraphicsPipelineCreateInfo?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.