vkCmdSetSampleLocationsEXT(3)

# vkCmdSetSampleLocationsEXT(3) Manual Page

## Name

vkCmdSetSampleLocationsEXT - Set the dynamic sample locations state

## C Specification

The custom sample locations used for rasterization when `VkPipelineSampleLocationsStateCreateInfoEXT`::`sampleLocationsEnable` is `VK_TRUE` are specified by the `VkPipelineSampleLocationsStateCreateInfoEXT`::`sampleLocationsInfo` property of the bound graphics pipeline, if the pipeline was not created with `VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT` enabled.

Otherwise, the sample locations used for rasterization are set by calling `vkCmdSetSampleLocationsEXT`:

    void vkCmdSetSampleLocationsEXT(
        VkCommandBuffer                             commandBuffer,
        const VkSampleLocationsInfoEXT*             pSampleLocationsInfo);

## Parameters

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

- `pSampleLocationsInfo` is the sample locations state to set.

## Description

Valid Usage

- The `sampleLocationsPerPixel` member of `pSampleLocationsInfo` must equal the `rasterizationSamples` member of the VkPipelineMultisampleStateCreateInfo structure the bound graphics pipeline has been created with

- If VkPhysicalDeviceSampleLocationsPropertiesEXT::`variableSampleLocations` is `VK_FALSE` then the current render pass must have been begun by specifying a VkRenderPassSampleLocationsBeginInfoEXT structure whose `pPostSubpassSampleLocations` member contains an element with a `subpassIndex` matching the current subpass index and the `sampleLocationsInfo` member of that element must match the sample locations state pointed to by `pSampleLocationsInfo`

Valid Usage (Implicit)

- `commandBuffer` must be a valid VkCommandBuffer handle

- `pSampleLocationsInfo` must be a valid pointer to a valid VkSampleLocationsInfoEXT structure

- `commandBuffer` must be in the recording state

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

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 | Supported Queue Types | Pipeline Type
--- | --- | --- | ---
Primary Secondary | Both | Graphics |

## See Also

VkCommandBuffer, VkSampleLocationsInfoEXT

## 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 (c) 2014-2020 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.