HORIZON HASKELLDocslts/ghc-9.14.x45dd5372026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 45dd537 · 2026-10-11

Modulevulkan-3.27GHC2021

Vulkan.Extensions.VK_NV_fragment_shading_rate_enums

Name

VK_NV_fragment_shading_rate_enums - device extension

VK_NV_fragment_shading_rate_enums

Name String

VK_NV_fragment_shading_rate_enums

Extension Type

Device extension

Registered Extension Number

327

Revision

1

Ratification Status

Not ratified

Extension and Version Dependencies

VK_KHR_fragment_shading_rate

Contact

Other Extension Metadata

Last Modified Date

2020-09-02

Contributors
  • Pat Brown, NVIDIA

  • Jeff Bolz, NVIDIA

Description

This extension builds on the fragment shading rate functionality provided by the VK_KHR_fragment_shading_rate extension, adding support for “supersample” fragment shading rates that trigger multiple fragment shader invocations per pixel as well as a “no invocations” shading rate that discards any portions of a primitive that would use that shading rate.

New Commands

New Structures

New Enums

New Enum Constants

Issues

  1. Why was this extension created? How should it be named?

    RESOLVED: The primary goal of this extension was to expose support for supersample and “no invocations” shading rates, which are supported by the VK_NV_shading_rate_image extension but not by VK_KHR_fragment_shading_rate. Because VK_KHR_fragment_shading_rate specifies the primitive shading rate using a fragment size in pixels, it lacks a good way to specify supersample rates. To deal with this, we defined enums covering shading rates supported by the KHR extension as well as the new shading rates and added structures and APIs accepting shading rate enums instead of fragment sizes.

    Since this extension adds two different types of shading rates, both expressed using enums, we chose the extension name VK_NV_fragment_shading_rate_enums.

  1. Is this a standalone extension?

    RESOLVED: No, this extension requires VK_KHR_fragment_shading_rate. In order to use the features of this extension, applications must enable the relevant features of KHR extension.

  2. How are the shading rate enums used, and how were the enum values assigned?

    RESOLVED: The shading rates supported by the enums in this extension are accepted as pipeline, primitive, and attachment shading rates and behave identically. For the shading rates also supported by the KHR extension, the values assigned to the corresponding enums are identical to the values already used for the primitive and attachment shading rates in the KHR extension. For those enums, bits 0 and 1 specify the base two logarithm of the fragment height and bits 2 and 3 specify the base two logarithm of the fragment width. For the new shading rates added by this extension, we chose to use 11 through 14 (10 plus the base two logarithm of the invocation count) for the supersample rates and 15 for the “no invocations” rate. None of those values are supported as primitive or attachment shading rates by the KHR extension.

  3. Between this extension, VK_KHR_fragment_shading_rate, and VK_NV_shading_rate_image, there are three different ways to specify shading rate state in a pipeline. How should we handle this?

    RESOLVED: We do not allow the concurrent use of VK_NV_shading_rate_image and VK_KHR_fragment_shading_rate; it is an error to enable shading rate features from both extensions. But we do allow applications to enable this extension together with VK_KHR_fragment_shading_rate together. While we expect that applications will never attach pipeline CreateInfo structures for both this extension and the KHR extension concurrently, Vulkan does not have any precedent forbidding such behavior and instead typically treats a pipeline created without an extension-specific CreateInfo structure as equivalent to one containing default values specified by the extension. Rather than adding such a rule considering the presence or absence of our new CreateInfo structure, we instead included a shadingRateType member to PipelineFragmentShadingRateEnumStateCreateInfoNV that selects between using state specified by that structure and state specified by PipelineFragmentShadingRateStateCreateInfoKHR.

Version History

  • Revision 1, 2020-09-02 (pbrown)

    • Internal revisions

See Also

No cross-references are available

Document Notes

For more information, see the Vulkan Specification.

This page is a generated document. Fixes and changes should be made to the generator scripts, not directly.

  • 8 types
  • 1 value
  • Packagevulkan-3.27
  • Exports30
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceVK_NV_fragment_shading_rate_enums.hs
valuecmdSetFragmentShadingRateEnumNV
  1. :: MonadIO io
  2. => CommandBuffer

    commandBuffer is the command buffer into which the command will be recorded.

  3. -> FragmentShadingRateNV

    shadingRate specifies a FragmentShadingRateNV enum indicating the pipeline fragment shading rate for subsequent drawing commands.

  4. -> "combinerOps" ::: (FragmentShadingRateCombinerOpKHR, FragmentShadingRateCombinerOpKHR)

    combinerOps specifies a FragmentShadingRateCombinerOpKHR determining how the pipeline, primitive, and attachment shading rates are combined for fragments generated by subsequent drawing commands.

  5. -> io ()
#

vkCmdSetFragmentShadingRateEnumNV - Set pipeline fragment shading rate dynamically for a command buffer using enums

Description

This command sets the pipeline fragment shading rate and combiner operation for subsequent drawing commands when drawing using shader objects, or when the graphics pipeline is created with DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR set in PipelineDynamicStateCreateInfo::pDynamicStates. Otherwise, this state is specified by the PipelineFragmentShadingRateEnumStateCreateInfoNV values used to create the currently active pipeline.

This command allows specifying additional shading rates beyond those supported by cmdSetFragmentShadingRateKHR. For more information, refer to the VK_NV_fragment_shading_rate_enums appendix.

Valid Usage

Valid Usage (Implicit)

Host Synchronization

  • Host access to commandBuffer must be externally synchronized

  • Host access to the CommandPool that commandBuffer was allocated from must be externally synchronized

Command Properties

'

Conditional Rendering

vkCmdSetFragmentShadingRateEnumNV is not affected by conditional rendering

See Also

VK_NV_fragment_shading_rate_enums, CommandBuffer, FragmentShadingRateCombinerOpKHR, FragmentShadingRateNV

VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV - Structure indicating support for fragment shading rate enums

Members

This structure describes the following features:

Description

If the PhysicalDeviceFragmentShadingRateEnumsFeaturesNV structure is included in the pNext chain of the PhysicalDeviceFeatures2 structure passed to getPhysicalDeviceFeatures2, it is filled in to indicate whether each corresponding feature is supported. If the application wishes to use a Device with any features described by PhysicalDeviceFragmentShadingRateEnumsFeaturesNV, it must add an instance of the structure, with the desired feature members set to TRUE, to the pNext chain of DeviceCreateInfo when creating the Device.

Structure Chaining

Extends the structures

See Also

VK_NV_fragment_shading_rate_enums, Bool32, StructureType

Constructors

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero

VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV - Structure describing fragment shading rate limits that can be supported by an implementation

Description

If the PhysicalDeviceFragmentShadingRateEnumsPropertiesNV structure is included in the pNext chain of the PhysicalDeviceProperties2 structure passed to getPhysicalDeviceProperties2, it is filled in with each corresponding implementation-dependent property.

These properties are related to fragment shading rates.

Structure Chaining

Extends the structure

See Also

VK_NV_fragment_shading_rate_enums, SampleCountFlagBits, StructureType

Constructors

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero

VkPipelineFragmentShadingRateEnumStateCreateInfoNV - Structure specifying parameters controlling the fragment shading rate using rate enums

Description

If the pNext chain of GraphicsPipelineCreateInfo includes a PipelineFragmentShadingRateEnumStateCreateInfoNV structure, then that structure includes parameters controlling the pipeline fragment shading rate.

If this structure is not present, shadingRateType is considered to be equal to FRAGMENT_SHADING_RATE_TYPE_FRAGMENT_SIZE_NV, shadingRate is considered to be equal to FRAGMENT_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV, and both elements of combinerOps are considered to be equal to FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR.

Structure Chaining

Extends the structure

See Also

VK_NV_fragment_shading_rate_enums, FragmentShadingRateCombinerOpKHR, FragmentShadingRateNV, FragmentShadingRateTypeNV, StructureType

Constructors

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero
newtypenewtype FragmentShadingRateNV
#

VkFragmentShadingRateNV - Enumeration with fragment shading rates

Description

To use the shading rates FRAGMENT_SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV, FRAGMENT_SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV, FRAGMENT_SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV, and FRAGMENT_SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV as a pipeline, primitive, or attachment shading rate, the supersampleFragmentShadingRates feature must be enabled. To use the shading rate FRAGMENT_SHADING_RATE_NO_INVOCATIONS_NV as a pipeline, primitive, or attachment shading rate, the noInvocationFragmentShadingRates feature must be enabled.

See Also

VK_NV_fragment_shading_rate_enums, PipelineFragmentShadingRateEnumStateCreateInfoNV, cmdSetFragmentShadingRateEnumNV

Instances6Eq, Ord, Read, Show, Storable, Zero
newtypenewtype FragmentShadingRateTypeNV
#

VkFragmentShadingRateTypeNV - Enumeration with fragment shading rate types

Description

See Also

VK_NV_fragment_shading_rate_enums, PipelineFragmentShadingRateEnumStateCreateInfoNV

Instances6Eq, Ord, Read, Show, Storable, Zero

VkFragmentShadingRateCombinerOpKHR - Control how fragment shading rates are combined

Description

where combine(Axy,Bxy) is the combine operation, and Axy and Bxy are the inputs to the operation.

If fragmentShadingRateStrictMultiplyCombiner is FALSE, using FRAGMENT_SHADING_RATE_COMBINER_OP_MUL_KHR with values of 1 for both A and B in the same dimension results in the value 2 being produced for that dimension. See the definition of fragmentShadingRateStrictMultiplyCombiner for more information.

These operations are performed in a component-wise fashion.

See Also

VK_KHR_fragment_shading_rate, PipelineFragmentShadingRateEnumStateCreateInfoNV, PipelineFragmentShadingRateStateCreateInfoKHR, cmdSetFragmentShadingRateEnumNV, cmdSetFragmentShadingRateKHR

Instances6Eq, Ord, Read, Show, Storable, Zero