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

GHC 9.14.1 · lts/ghc-9.14.x · 3e2d568 · 2026-10-11

Modulevulkan-3.27GHC2021

Vulkan.Extensions.VK_EXT_sample_locations

Name

VK_EXT_sample_locations - device extension

VK_EXT_sample_locations

Name String

VK_EXT_sample_locations

Extension Type

Device extension

Registered Extension Number

144

Revision

1

Ratification Status

Ratified

Extension and Version Dependencies

VK_KHR_get_physical_device_properties2

or

Vulkan Version 1.1

Contact

Other Extension Metadata

Last Modified Date

2017-08-02

Contributors
  • Mais Alnasser, AMD

  • Matthaeus G. Chajdas, AMD

  • Maciej Jesionowski, AMD

  • Daniel Rakos, AMD

  • Slawomir Grajewski, Intel

  • Jeff Bolz, NVIDIA

  • Bill Licea-Kane, Qualcomm

Description

This extension allows an application to modify the locations of samples within a pixel used in rasterization. Additionally, it allows applications to specify different sample locations for each pixel in a group of adjacent pixels, which can increase antialiasing quality (particularly if a custom resolve shader is used that takes advantage of these different locations).

It is common for implementations to optimize the storage of depth values by storing values that can be used to reconstruct depth at each sample location, rather than storing separate depth values for each sample. For example, the depth values from a single triangle may be represented using plane equations. When the depth value for a sample is needed, it is automatically evaluated at the sample location. Modifying the sample locations causes the reconstruction to no longer evaluate the same depth values as when the samples were originally generated, thus the depth aspect of a depth/stencil attachment must be cleared before rendering to it using different sample locations.

Some implementations may need to evaluate depth image values while performing image layout transitions. To accommodate this, instances of the SampleLocationsInfoEXT structure can be specified for each situation where an explicit or automatic layout transition has to take place. SampleLocationsInfoEXT can be chained from ImageMemoryBarrier structures to provide sample locations for layout transitions performed by cmdWaitEvents and cmdPipelineBarrier calls, and RenderPassSampleLocationsBeginInfoEXT can be chained from RenderPassBeginInfo to provide sample locations for layout transitions performed implicitly by a render pass instance.

New Commands

New Structures

New Enum Constants

Issues

1) When using with Dynamic Rendering, is there a VkRenderPassSampleLocationsBeginInfoEXT equivalent struct

RESOLVED: No, there are no subpasses that need to have a sample location set.

Version History

  • Revision 1, 2017-08-02 (Daniel Rakos)

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

  • 10 types
  • 2 values
  • Packagevulkan-3.27
  • Exports14
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceVK_EXT_sample_locations.hs
valuecmdSetSampleLocationsEXT
  1. :: MonadIO io
  2. => CommandBuffer

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

  3. -> SampleLocationsInfoEXT

    pSampleLocationsInfo is the sample locations state to set.

  4. -> io ()
#

vkCmdSetSampleLocationsEXT - Set sample locations dynamically for a command buffer

Description

This command sets the custom sample locations for subsequent drawing commands when drawing using shader objects, or when the graphics pipeline is created with DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT set in PipelineDynamicStateCreateInfo::pDynamicStates, and when the PipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnable property of the bound graphics pipeline is TRUE. Otherwise, this state is specified by the PipelineSampleLocationsStateCreateInfoEXT::sampleLocationsInfo values used to create the currently active pipeline.

Valid Usage

  • If PhysicalDeviceSampleLocationsPropertiesEXT::variableSampleLocations is FALSE then the current render pass must have been begun by specifying a RenderPassSampleLocationsBeginInfoEXT 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)

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

vkCmdSetSampleLocationsEXT is not affected by conditional rendering

See Also

VK_EXT_sample_locations, CommandBuffer, SampleLocationsInfoEXT

valuegetPhysicalDeviceMultisamplePropertiesEXT
  1. :: MonadIO io
  2. => PhysicalDevice

    physicalDevice is the physical device from which to query the additional multisampling capabilities.

    physicalDevice must be a valid PhysicalDevice handle

  3. -> "samples" ::: SampleCountFlagBits

    samples is a SampleCountFlagBits value specifying the sample count to query capabilities for.

    samples must be a valid SampleCountFlagBits value

  4. -> io MultisamplePropertiesEXT
#

vkGetPhysicalDeviceMultisamplePropertiesEXT - Report sample count specific multisampling capabilities of a physical device

Valid Usage (Implicit)

See Also

VK_EXT_sample_locations, MultisamplePropertiesEXT, PhysicalDevice, SampleCountFlagBits

datadata SampleLocationEXT
#

VkSampleLocationEXT - Structure specifying the coordinates of a sample location

Description

The domain space of the sample location coordinates has an upper-left origin within the pixel in framebuffer space.

The values specified in a SampleLocationEXT structure are always clamped to the implementation-dependent sample location coordinate range [sampleLocationCoordinateRange[0],sampleLocationCoordinateRange[1]] that can be queried using PhysicalDeviceSampleLocationsPropertiesEXT.

See Also

VK_EXT_sample_locations, SampleLocationsInfoEXT

Constructors

  • SampleLocationEXT
    • x :: Float

      x is the horizontal coordinate of the sample’s location.

    • y :: Float

      y is the vertical coordinate of the sample’s location.

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero

VkSampleLocationsInfoEXT - Structure specifying a set of sample locations

Description

This structure can be used either to specify the sample locations to be used for rendering or to specify the set of sample locations an image subresource has been last rendered with for the purposes of layout transitions of depth/stencil images created with IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT.

The sample locations in pSampleLocations specify sampleLocationsPerPixel number of sample locations for each pixel in the grid of the size specified in sampleLocationGridSize. The sample location for sample i at the pixel grid location (x,y) is taken from pSampleLocations[(x + y × sampleLocationGridSize.width) × sampleLocationsPerPixel + i].

If the render pass has a fragment density map, the implementation will choose the sample locations for the fragment and the contents of pSampleLocations may be ignored.

Valid Usage

  • sampleLocationsCount must equal sampleLocationsPerPixel × sampleLocationGridSize.width × sampleLocationGridSize.height

Valid Usage (Implicit)

  • If sampleLocationsCount is not 0, pSampleLocations must be a valid pointer to an array of sampleLocationsCount SampleLocationEXT structures

Structure Chaining

Extends the structures

See Also

VK_EXT_sample_locations, AttachmentSampleLocationsEXT, Extent2D, PipelineSampleLocationsStateCreateInfoEXT, SampleCountFlagBits, SampleLocationEXT, StructureType, SubpassSampleLocationsEXT, cmdSetSampleLocationsEXT

Constructors

Instances4Show, FromCStruct, ToCStruct, Zero

VkAttachmentSampleLocationsEXT - Structure specifying the sample locations state to use in the initial layout transition of attachments

Description

If the image referenced by the framebuffer attachment at index attachmentIndex was not created with IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT then the values specified in sampleLocationsInfo are ignored.

Valid Usage (Implicit)

See Also

VK_EXT_sample_locations, RenderPassSampleLocationsBeginInfoEXT, SampleLocationsInfoEXT

Constructors

Instances4Show, FromCStruct, ToCStruct, Zero

VkSubpassSampleLocationsEXT - Structure specifying the sample locations state to use for layout transitions of attachments performed after a given subpass

Description

If the image referenced by the depth/stencil attachment used in the subpass identified by subpassIndex was not created with IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT or if the subpass does not use a depth/stencil attachment, and PhysicalDeviceSampleLocationsPropertiesEXT::variableSampleLocations is TRUE then the values specified in sampleLocationsInfo are ignored.

Valid Usage (Implicit)

See Also

VK_EXT_sample_locations, RenderPassSampleLocationsBeginInfoEXT, SampleLocationsInfoEXT

Constructors

Instances4Show, FromCStruct, ToCStruct, Zero

VkRenderPassSampleLocationsBeginInfoEXT - Structure specifying sample locations to use for the layout transition of custom sample locations compatible depth/stencil attachments

Valid Usage (Implicit)

  • If attachmentInitialSampleLocationsCount is not 0, pAttachmentInitialSampleLocations must be a valid pointer to an array of attachmentInitialSampleLocationsCount valid AttachmentSampleLocationsEXT structures

  • If postSubpassSampleLocationsCount is not 0, pPostSubpassSampleLocations must be a valid pointer to an array of postSubpassSampleLocationsCount valid SubpassSampleLocationsEXT structures

Structure Chaining

Extends the structure

See Also

VK_EXT_sample_locations, AttachmentSampleLocationsEXT, StructureType, SubpassSampleLocationsEXT

Constructors

  • RenderPassSampleLocationsBeginInfoEXT
    • attachmentInitialSampleLocations :: Vector AttachmentSampleLocationsEXT

      pAttachmentInitialSampleLocations is a pointer to an array of attachmentInitialSampleLocationsCount AttachmentSampleLocationsEXT structures specifying the attachment indices and their corresponding sample location state. Each element of pAttachmentInitialSampleLocations can specify the sample location state to use in the automatic layout transition performed to transition a depth/stencil attachment from the initial layout of the attachment to the image layout specified for the attachment in the first subpass using it.

    • postSubpassSampleLocations :: Vector SubpassSampleLocationsEXT

      pPostSubpassSampleLocations is a pointer to an array of postSubpassSampleLocationsCount SubpassSampleLocationsEXT structures specifying the subpass indices and their corresponding sample location state. Each element of pPostSubpassSampleLocations can specify the sample location state to use in the automatic layout transition performed to transition the depth/stencil attachment used by the specified subpass to the image layout specified in a dependent subpass or to the final layout of the attachment in case the specified subpass is the last subpass using that attachment. In addition, if PhysicalDeviceSampleLocationsPropertiesEXT::variableSampleLocations is FALSE, each element of pPostSubpassSampleLocations must specify the sample location state that matches the sample locations used by all pipelines that will be bound to a command buffer during the specified subpass. If variableSampleLocations is TRUE, the sample locations used for rasterization do not depend on pPostSubpassSampleLocations.

Instances4Show, FromCStruct, ToCStruct, Zero

VkPipelineSampleLocationsStateCreateInfoEXT - Structure specifying sample locations for a pipeline

Structure Chaining

Extends the structure

See Also

VK_EXT_sample_locations, Bool32, SampleLocationsInfoEXT, StructureType

Constructors

Instances4Show, FromCStruct, ToCStruct, Zero

VkPhysicalDeviceSampleLocationsPropertiesEXT - Structure describing sample location limits that can be supported by an implementation

Description

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

Structure Chaining

Extends the structure

See Also

VK_EXT_sample_locations, Bool32, Extent2D, SampleCountFlags, StructureType

Constructors

Instances5Show, Storable, FromCStruct, ToCStruct, Zero

VkMultisamplePropertiesEXT - Structure returning information about sample count specific additional multisampling capabilities

Valid Usage (Implicit)

See Also

VK_EXT_sample_locations, Extent2D, StructureType, getPhysicalDeviceMultisamplePropertiesEXT

Constructors

Instances5Show, Storable, FromCStruct, ToCStruct, Zero