# VK_KHR_fragment_shading_rate(3) Manual Page

## Name

VK_KHR_fragment_shading_rate - device extension

Loading… please wait.

## Registered Extension Number

227

## Revision

2

## Ratification Status

Ratified

## Extension and Version Dependencies

VK_KHR_get_physical_device_properties2
or
Vulkan Version 1.1
and
VK_KHR_create_renderpass2
or
Vulkan Version 1.2

## API Interactions

- Interacts with VK_VERSION_1_3

- Interacts with VK_KHR_dynamic_rendering

- Interacts with VK_KHR_format_feature_flags2

## SPIR-V Dependencies

- SPV_KHR_fragment_shading_rate

## Contact

- Tobias Hector [GitHub]tobski

## Extension Proposal

VK_KHR_fragment_shading_rate

## Other Extension Metadata

Last Modified Date

  2021-09-30

Interactions and External Dependencies

  - This extension provides API support for `GL_EXT_fragment_shading_rate`

Contributors

  - Tobias Hector, AMD

  - Guennadi Riguer, AMD

  - Matthaeus Chajdas, AMD

  - Pat Brown, Nvidia

  - Matthew Netsch, Qualcomm

  - Slawomir Grajewski, Intel

  - Jan-Harald Fredriksen, Arm

  - Jeff Bolz, Nvidia

  - Arseny Kapoulkine, Roblox

  - Contributors to the VK_NV_shading_rate_image specification

  - Contributors to the VK_EXT_fragment_density_map specification

## Description

This extension adds the ability to change the rate at which fragments are shaded. Rather than the usual single fragment invocation for each pixel covered by a primitive, multiple pixels can be shaded by a single fragment shader invocation.

Up to three methods are available to the application to change the fragment shading rate:

- https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#primsrast-fragment-shading-rate-pipeline, which allows the specification of a rate per-draw.

- https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#primsrast-fragment-shading-rate-primitive, which allows the specification of a rate per primitive, specified during shading.

- https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#primsrast-fragment-shading-rate-attachment, which allows the specification of a rate per-region of the framebuffer, specified in a specialized image attachment.

Additionally, these rates can all be specified and combined in order to adjust the overall detail in the image at each point.

This functionality can be used to focus shading efforts where higher levels of detail are needed in some parts of a scene compared to others. This can be particularly useful in high resolution rendering, or for XR contexts.

This extension also adds support for the `SPV_KHR_fragment_shading_rate` extension which enables setting the primitive fragment shading rate, and allows querying the final shading rate from a fragment shader.

## New Commands

- vkCmdSetFragmentShadingRateKHR

- vkGetPhysicalDeviceFragmentShadingRatesKHR

## New Structures

- VkPhysicalDeviceFragmentShadingRateKHR

- Extending VkGraphicsPipelineCreateInfo:

  - VkPipelineFragmentShadingRateStateCreateInfoKHR

- Extending VkPhysicalDeviceFeatures2, VkDeviceCreateInfo:

  - VkPhysicalDeviceFragmentShadingRateFeaturesKHR

- Extending VkPhysicalDeviceProperties2:

  - VkPhysicalDeviceFragmentShadingRatePropertiesKHR

- Extending VkSubpassDescription2:

  - VkFragmentShadingRateAttachmentInfoKHR

If Vulkan Version 1.3 or VK_KHR_dynamic_rendering is supported:

- Extending VkRenderingInfo:

  - VkRenderingFragmentShadingRateAttachmentInfoKHR

## New Enums

- VkFragmentShadingRateCombinerOpKHR

## New Enum Constants

- `VK_KHR_FRAGMENT_SHADING_RATE_EXTENSION_NAME`

- `VK_KHR_FRAGMENT_SHADING_RATE_SPEC_VERSION`

- Extending VkAccessFlagBits:

  - `VK_ACCESS_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR`

- Extending VkDynamicState:

  - `VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR`

- Extending VkFormatFeatureFlagBits:

  - `VK_FORMAT_FEATURE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR`

- Extending VkImageLayout:

  - `VK_IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR`

- Extending VkImageUsageFlagBits:

  - `VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR`

- Extending VkPipelineStageFlagBits:

  - `VK_PIPELINE_STAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR`

- Extending VkStructureType:

  - `VK_STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR`

  - `VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR`

  - `VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_KHR`

  - `VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR`

  - `VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR`

If VK_KHR_format_feature_flags2 or Vulkan Version 1.3 is supported:

- Extending VkFormatFeatureFlagBits2:

  - `VK_FORMAT_FEATURE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR`

If Vulkan Version 1.3 or VK_KHR_dynamic_rendering is supported:

- Extending VkPipelineCreateFlagBits:

  - `VK_PIPELINE_CREATE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR`

  - `VK_PIPELINE_RASTERIZATION_STATE_CREATE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR`

- Extending VkStructureType:

  - `VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR`

## Version History

- Revision 1, 2020-05-06 (Tobias Hector)

  - Initial revision

- Revision 2, 2021-09-30 (Jon Leech)

  - Add interaction with `VK_KHR_format_feature_flags2` to `vk.xml`

## 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.

## Copyright

Copyright 2014-2025 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0