KhronosGroup / KhronosGroup/Vulkan-Docs
rasterizerDiscardEnable and ignored parameters
- Dominant language
- JavaScript
- Stars
- 3.3k
- Forks
- 549
- Avg merge
- 5d 5h
- Merged PRs (30d)
- 2
Description
`rasterizerDiscardEnable` is described this way:
> If a pipeline has `rasterizerDiscardEnable` enabled, implementations **may** discard primitives after the final vertex processing stage.
also this way:
> `rasterizerDiscardEnable` controls whether primitives are discarded immediately before the rasterization stage.
and also this way:
> Primitives are discarded before rasterization if the `rasterizerDiscardEnable` member of `VkPipelineRasterizationStateCreateInfo` is enabled. When enabled, primitives are discarded after they are processed by the last active shader stage in the pipeline before rasterization.
Being repeated three times, this is slightly contradictory. The first and second quote says it is discarded after Vertex Post-processing. The first may be brittle if another stage is added in the future, The third says it is discarded after Geometry (or Mesh) shader.
Now currently (per VUs) the ignored parameters seem to be:
- `pViewportState` (whole struct)
- `pMultisampleState` (whole struct)
- `pDepthStencilState` (whole struct)
- `pColorBlendState` (whole struct)
These do not seem to be explicitly stated:
- I suppose `pStages` with `pStages->stage == VK_SHADER_STAGE_FRAGMENT_BIT` is ignored. Should it be stated that other parameters in the same `pStages[]` are ignored and so can be garbage?
- `pRasterizationState` parameters seem largely useless if rasterization is disabled. Should some (all) be ignored?
- Some (all?) dynamic state is not really relevant when rasterization is disabled. Could `pDynamicState` be ignored by the driver? Or at least the specific enums could be ignored.
- The enums control whether the `vkCmdSet*` commands can be used (even for the rasterizer disabled state). Spamming commands that do nothing seems awkward to me, and so should be made invalid? Bonus is this does not disturb the dynamic state; but that could be solved differently (e.g. by saying that pipeline with disabled rasterization by default preserves dynamic state).
- I am not sure to what degree a `renderPass` (and `subpass`) is relevant here. Except maybe preserve attachments, nothing else in it seems relevant. That means a pipeline with rasterization disabled could theoretically be compatible with any render pass?
- extensions, e.g. discard rectange can be ignored?
Contributor guide
Assessment
This issue has not been assessed yet.