# vkCmdSetFragmentShadingRateEnumNV(3) Manual Page

## Name

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

Loading… please wait.

## C Specification

To dynamically set the pipeline fragment shading rate and combiner operation, call:

    // Provided by VK_NV_fragment_shading_rate_enums
    void vkCmdSetFragmentShadingRateEnumNV(
        VkCommandBuffer                             commandBuffer,
        VkFragmentShadingRateNV                     shadingRate,
        const VkFragmentShadingRateCombinerOpKHR    combinerOps[2]);

## Parameters

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

- `shadingRate` specifies a VkFragmentShadingRateNV enum indicating the pipeline fragment shading rate for subsequent drawing commands.

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

## 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 `VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR` set in VkPipelineDynamicStateCreateInfo::`pDynamicStates`. Otherwise, this state is specified by the VkPipelineFragmentShadingRateEnumStateCreateInfoNV values used to create the currently active pipeline.

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

Valid Usage

- VUID-vkCmdSetFragmentShadingRateEnumNV-pipelineFragmentShadingRate-04576
  If the `pipelineFragmentShadingRate` feature is not enabled, `shadingRate` must be `VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV`

- VUID-vkCmdSetFragmentShadingRateEnumNV-supersampleFragmentShadingRates-04577
  If the `supersampleFragmentShadingRates` feature is not enabled, `shadingRate` must not be `VK_FRAGMENT_SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV`, `VK_FRAGMENT_SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV`, `VK_FRAGMENT_SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV`, or `VK_FRAGMENT_SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV`

- VUID-vkCmdSetFragmentShadingRateEnumNV-noInvocationFragmentShadingRates-04578
  If the `noInvocationFragmentShadingRates` feature is not enabled, `shadingRate` must not be `VK_FRAGMENT_SHADING_RATE_NO_INVOCATIONS_NV`

- VUID-vkCmdSetFragmentShadingRateEnumNV-fragmentShadingRateEnums-04579
  The `fragmentShadingRateEnums` feature must be enabled

- VUID-vkCmdSetFragmentShadingRateEnumNV-pipelineFragmentShadingRate-04580
  One of the `pipelineFragmentShadingRate`, `primitiveFragmentShadingRate`, or `attachmentFragmentShadingRate` features must be enabled

- VUID-vkCmdSetFragmentShadingRateEnumNV-primitiveFragmentShadingRate-04581
  If the `primitiveFragmentShadingRate` feature is not enabled, `combinerOps`[0] must be `VK_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR`

- VUID-vkCmdSetFragmentShadingRateEnumNV-attachmentFragmentShadingRate-04582
  If the `attachmentFragmentShadingRate` feature is not enabled, `combinerOps`[1] must be `VK_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR`

- VUID-vkCmdSetFragmentShadingRateEnumNV-fragmentSizeNonTrivialCombinerOps-04583
  If the `fragmentSizeNonTrivialCombinerOps` limit is not supported, elements of `combinerOps` must be either `VK_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR` or `VK_FRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_KHR`

Valid Usage (Implicit)

- VUID-vkCmdSetFragmentShadingRateEnumNV-commandBuffer-parameter
  `commandBuffer` must be a valid VkCommandBuffer handle

- VUID-vkCmdSetFragmentShadingRateEnumNV-shadingRate-parameter
  `shadingRate` must be a valid VkFragmentShadingRateNV value

- VUID-vkCmdSetFragmentShadingRateEnumNV-combinerOps-parameter
  Each element of `combinerOps` must be a valid VkFragmentShadingRateCombinerOpKHR value

- VUID-vkCmdSetFragmentShadingRateEnumNV-commandBuffer-recording
  `commandBuffer` must be in the recording state

- VUID-vkCmdSetFragmentShadingRateEnumNV-commandBuffer-cmdpool
  The `VkCommandPool` that `commandBuffer` was allocated from must support graphics operations

- VUID-vkCmdSetFragmentShadingRateEnumNV-videocoding
  This command must only be called outside of a video coding scope

Host Synchronization

- Host access to `commandBuffer` must be externally synchronized

- Host access to the `VkCommandPool` that `commandBuffer` was allocated from must be externally synchronized

Command Properties

Command Buffer Levels | Render Pass Scope | Video Coding Scope | Supported Queue Types | Command Type
--- | --- | --- | --- | ---
Primary Secondary | Both | Outside | Graphics | State

## See Also

VK_NV_fragment_shading_rate_enums, VkCommandBuffer, VkFragmentShadingRateCombinerOpKHR, VkFragmentShadingRateNV

## Document Notes

For more information, see the Vulkan Specification

This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.

## Copyright

Copyright 2014-2025 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0