Class EXTSampleLocations
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 VkSampleLocationsInfoEXT structure can be specified for each situation where an explicit or automatic layout transition has to take place. VkSampleLocationsInfoEXT can be chained from VkImageMemoryBarrier structures to provide sample locations for layout transitions performed by CmdWaitEvents and CmdPipelineBarrier calls, and VkRenderPassSampleLocationsBeginInfoEXT can be chained from VkRenderPassBeginInfo to provide sample locations for layout transitions performed implicitly by a render pass instance.
- Name String
VK_EXT_sample_locations- Extension Type
- Device extension
- Registered Extension Number
- 144
- Revision
- 1
- Extension and Version Dependencies
VK_KHR_get_physical_device_properties2or Version 1.1- Contact
- Daniel Rakos drakos-amd
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
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intExtendsVkDynamicState.static final StringThe extension name.static final intThe extension specification version.static final intExtendsVkImageCreateFlagBits.static final intExtendsVkStructureType.static final intExtendsVkStructureType.static final intExtendsVkStructureType.static final intExtendsVkStructureType.static final intExtendsVkStructureType. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidnvkCmdSetSampleLocationsEXT(org.lwjgl.vulkan.VkCommandBuffer commandBuffer, long pSampleLocationsInfo) Unsafe version of:CmdSetSampleLocationsEXTstatic voidnvkGetPhysicalDeviceMultisamplePropertiesEXT(org.lwjgl.vulkan.VkPhysicalDevice physicalDevice, int samples, long pMultisampleProperties) Unsafe version of:GetPhysicalDeviceMultisamplePropertiesEXTstatic voidvkCmdSetSampleLocationsEXT(org.lwjgl.vulkan.VkCommandBuffer commandBuffer, VkSampleLocationsInfoEXT pSampleLocationsInfo) Set sample locations dynamically for a command buffer.static voidvkGetPhysicalDeviceMultisamplePropertiesEXT(org.lwjgl.vulkan.VkPhysicalDevice physicalDevice, int samples, VkMultisamplePropertiesEXT pMultisampleProperties) Report sample count specific multisampling capabilities of a physical device.
-
Field Details
-
VK_EXT_SAMPLE_LOCATIONS_SPEC_VERSION
public static final int VK_EXT_SAMPLE_LOCATIONS_SPEC_VERSIONThe extension specification version.- See Also:
-
VK_EXT_SAMPLE_LOCATIONS_EXTENSION_NAME
The extension name.- See Also:
-
VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT
public static final int VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXTExtendsVkImageCreateFlagBits.- See Also:
-
VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT
public static final int VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXTExtendsVkStructureType.Enum values:
- See Also:
-
VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT
public static final int VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXTExtendsVkStructureType.Enum values:
- See Also:
-
VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT
public static final int VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXTExtendsVkStructureType.Enum values:
- See Also:
-
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT
public static final int VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXTExtendsVkStructureType.Enum values:
- See Also:
-
VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT
public static final int VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXTExtendsVkStructureType.Enum values:
- See Also:
-
VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT
public static final int VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXTExtendsVkDynamicState.- See Also:
-
-
Method Details
-
nvkCmdSetSampleLocationsEXT
public static void nvkCmdSetSampleLocationsEXT(org.lwjgl.vulkan.VkCommandBuffer commandBuffer, long pSampleLocationsInfo) Unsafe version of:CmdSetSampleLocationsEXT -
vkCmdSetSampleLocationsEXT
public static void vkCmdSetSampleLocationsEXT(org.lwjgl.vulkan.VkCommandBuffer commandBuffer, VkSampleLocationsInfoEXT pSampleLocationsInfo) Set sample locations dynamically for a command buffer.C Specification
To dynamically set the sample locations used for rasterization, call:
void vkCmdSetSampleLocationsEXT( VkCommandBuffer commandBuffer, const VkSampleLocationsInfoEXT* pSampleLocationsInfo);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_EXTset inVkPipelineDynamicStateCreateInfo::pDynamicStates, and when theVkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnableproperty of the bound graphics pipeline isTRUE. Otherwise, this state is specified by theVkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsInfovalues used to create the currently active pipeline.Valid Usage
- If
VkPhysicalDeviceSampleLocationsPropertiesEXT::variableSampleLocationsisFALSEthen the current render pass must have been begun by specifying aVkRenderPassSampleLocationsBeginInfoEXTstructure whosepPostSubpassSampleLocationsmember contains an element with asubpassIndexmatching the current subpass index and thesampleLocationsInfomember of that element must match the sample locations state pointed to bypSampleLocationsInfo
Valid Usage (Implicit)
commandBuffermust be a validVkCommandBufferhandlepSampleLocationsInfomust be a valid pointer to a validVkSampleLocationsInfoEXTstructurecommandBuffermust be in the recording state- The
VkCommandPoolthatcommandBufferwas allocated from must support graphics operations - This command must only be called outside of a video coding scope
Host Synchronization
- Host access to
commandBuffermust be externally synchronized - Host access to the
VkCommandPoolthatcommandBufferwas 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
- Parameters:
commandBuffer- the command buffer into which the command will be recorded.pSampleLocationsInfo- the sample locations state to set.
- If
-
nvkGetPhysicalDeviceMultisamplePropertiesEXT
public static void nvkGetPhysicalDeviceMultisamplePropertiesEXT(org.lwjgl.vulkan.VkPhysicalDevice physicalDevice, int samples, long pMultisampleProperties) Unsafe version of:GetPhysicalDeviceMultisamplePropertiesEXT -
vkGetPhysicalDeviceMultisamplePropertiesEXT
public static void vkGetPhysicalDeviceMultisamplePropertiesEXT(org.lwjgl.vulkan.VkPhysicalDevice physicalDevice, int samples, VkMultisamplePropertiesEXT pMultisampleProperties) Report sample count specific multisampling capabilities of a physical device.C Specification
To query additional multisampling capabilities which may be supported for a specific sample count, beyond the minimum capabilities described for Limits above, call:
void vkGetPhysicalDeviceMultisamplePropertiesEXT( VkPhysicalDevice physicalDevice, VkSampleCountFlagBits samples, VkMultisamplePropertiesEXT* pMultisampleProperties);Valid Usage (Implicit)
physicalDevicemust be a validVkPhysicalDevicehandlesamplesmust be a validVkSampleCountFlagBitsvaluepMultisamplePropertiesmust be a valid pointer to aVkMultisamplePropertiesEXTstructure
See Also
- Parameters:
physicalDevice- the physical device from which to query the additional multisampling capabilities.samples- aVkSampleCountFlagBitsvalue specifying the sample count to query capabilities for.pMultisampleProperties- a pointer to aVkMultisamplePropertiesEXTstructure in which information about additional multisampling capabilities specific to the sample count is returned.
-