// Copyright 2017-2024 The Khronos Group Inc.
//
// SPDX-License-Identifier: CC-BY-4.0

include::{generated}/meta/{refprefix}VK_KHR_fragment_shading_rate.adoc[]

=== Other Extension Metadata

*Last Modified Date*::
    2021-09-30
*Interactions and External Dependencies*::
  - This extension provides API support for
    {GLSLregistry}/ext/GLSL_EXT_fragment_shading_rate.txt[`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:

  - <<primsrast-fragment-shading-rate-pipeline>>, which allows the
    specification of a rate per-draw.
  - <<primsrast-fragment-shading-rate-primitive>>, which allows the
    specification of a rate per primitive, specified during shading.
  - <<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
<<primsrast-fragment-shading-rate-primitive, primitive fragment shading
rate>>, and allows querying the final shading rate from a fragment shader.

include::{generated}/interfaces/VK_KHR_fragment_shading_rate.adoc[]

=== Version History

  * Revision 1, 2020-05-06 (Tobias Hector)
  ** Initial revision
  * Revision 2, 2021-09-30 (Jon Leech)
  ** Add interaction with `apiext:VK_KHR_format_feature_flags2` to `vk.xml`
