org.lwjgl.vulkan.EXTSampleLocations Maven / Gradle / Ivy
Show all versions of lwjgl-vulkan Show documentation
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.vulkan;
import org.lwjgl.system.*;
import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.JNI.*;
/**
* 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 {@link VkSampleLocationsInfoEXT} structure can be specified for each situation where an explicit or automatic layout transition has to take place. {@link VkSampleLocationsInfoEXT} can be chained from {@link VkImageMemoryBarrier} structures to provide sample locations for layout transitions performed by {@link VK10#vkCmdWaitEvents CmdWaitEvents} and flink:VkCmdPipelineBarrier calls, and {@link VkRenderPassSampleLocationsBeginInfoEXT} can be chained from {@link VkRenderPassBeginInfo} to provide sample locations for layout transitions performed implicitly by a render pass instance.
*
*
* - Name String
* - {@code VK_EXT_sample_locations}
* - Extension Type
* - Device extension
* - Registered Extension Number
* - 144
* - Revision
* - 1
* - Extension and Version Dependencies
*
* - Requires Vulkan 1.0
*
* - Contact
*
* - Daniel Rakos @aqnuep
*
* - 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
*
*
*/
public class EXTSampleLocations {
/** The extension specification version. */
public static final int VK_EXT_SAMPLE_LOCATIONS_SPEC_VERSION = 1;
/** The extension name. */
public static final String VK_EXT_SAMPLE_LOCATIONS_EXTENSION_NAME = "VK_EXT_sample_locations";
/** Extends {@code VkImageCreateFlagBits}. */
public static final int VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT = 0x1000;
/**
* Extends {@code VkStructureType}.
*
* Enum values:
*
*
* - {@link #VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT}
* - {@link #VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT}
* - {@link #VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT}
* - {@link #VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT}
* - {@link #VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT}
*
*/
public static final int
VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT = 1000143000,
VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT = 1000143001,
VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT = 1000143002,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT = 1000143003,
VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT = 1000143004;
/** Extends {@code VkDynamicState}. */
public static final int VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT = 1000143000;
protected EXTSampleLocations() {
throw new UnsupportedOperationException();
}
static boolean isAvailable(VKCapabilitiesInstance caps) {
return checkFunctions(
caps.vkGetPhysicalDeviceMultisamplePropertiesEXT
);
}
static boolean isAvailable(VKCapabilitiesInstance capsInstance, VKCapabilitiesDevice caps) {
return isAvailable(capsInstance) && checkFunctions(
caps.vkCmdSetSampleLocationsEXT
);
}
// --- [ vkCmdSetSampleLocationsEXT ] ---
/** Unsafe version of: {@link #vkCmdSetSampleLocationsEXT CmdSetSampleLocationsEXT} */
public static void nvkCmdSetSampleLocationsEXT(VkCommandBuffer commandBuffer, long pSampleLocationsInfo) {
long __functionAddress = commandBuffer.getCapabilities().vkCmdSetSampleLocationsEXT;
if (CHECKS) {
check(__functionAddress);
VkSampleLocationsInfoEXT.validate(pSampleLocationsInfo);
}
callPPV(__functionAddress, commandBuffer.address(), pSampleLocationsInfo);
}
/**
* Set the dynamic sample locations state.
*
* C Specification
*
* The custom sample locations used for rasterization when {@link VkPipelineSampleLocationsStateCreateInfoEXT}{@code ::sampleLocationsEnable} is {@link VK10#VK_TRUE TRUE} are specified by the {@link VkPipelineSampleLocationsStateCreateInfoEXT}{@code ::sampleLocationsInfo} property of the currently bound graphics pipeline, if the pipeline was not created with {@link #VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT} enabled.
*
* Otherwise, the sample locations used for rasterization are set by calling {@link #vkCmdSetSampleLocationsEXT CmdSetSampleLocationsEXT}:
*
*
* void vkCmdSetSampleLocationsEXT(
* VkCommandBuffer commandBuffer,
* const VkSampleLocationsInfoEXT* pSampleLocationsInfo);
*
* Valid Usage
*
*
* - The currently bound graphics pipeline must have been created with the {@link #VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT} dynamic state enabled
* - The {@code sampleLocationsPerPixel} member of {@code pSampleLocationsInfo} must equal the {@code rasterizationSamples} member of the {@link VkPipelineMultisampleStateCreateInfo} structure the currently bound graphics pipeline has been created with
* - If {@link VkPhysicalDeviceSampleLocationsPropertiesEXT}{@code ::variableSampleLocations} is {@link VK10#VK_FALSE FALSE} then the current render pass must have been begun by specifying a {@link VkRenderPassSampleLocationsBeginInfoEXT} structure whose {@code pPostSubpassSampleLocations} member contains an element with a {@code subpassIndex} matching the current subpass index and the {@code sampleLocationsInfo} member of that element must match the sample locations state pointed to by {@code pSampleLocationsInfo}
*
*
* Valid Usage (Implicit)
*
*
* - {@code commandBuffer} must be a valid {@code VkCommandBuffer} handle
* - {@code pSampleLocationsInfo} must be a pointer to a valid {@link VkSampleLocationsInfoEXT} structure
* - {@code commandBuffer} must be in the recording state
* - The {@code VkCommandPool} that {@code commandBuffer} was allocated from must support graphics operations
*
*
* Host Synchronization
*
*
* - Host access to {@code commandBuffer} must be externally synchronized
* - Host access to the {@code VkCommandPool} that {@code 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
*
* {@link VkSampleLocationsInfoEXT}
*
* @param commandBuffer the command buffer into which the command will be recorded.
* @param pSampleLocationsInfo the sample locations state to set.
*/
public static void vkCmdSetSampleLocationsEXT(VkCommandBuffer commandBuffer, @NativeType("const VkSampleLocationsInfoEXT *") VkSampleLocationsInfoEXT pSampleLocationsInfo) {
nvkCmdSetSampleLocationsEXT(commandBuffer, pSampleLocationsInfo.address());
}
// --- [ vkGetPhysicalDeviceMultisamplePropertiesEXT ] ---
/** Unsafe version of: {@link #vkGetPhysicalDeviceMultisamplePropertiesEXT GetPhysicalDeviceMultisamplePropertiesEXT} */
public static void nvkGetPhysicalDeviceMultisamplePropertiesEXT(VkPhysicalDevice physicalDevice, int samples, long pMultisampleProperties) {
long __functionAddress = physicalDevice.getCapabilities().vkGetPhysicalDeviceMultisamplePropertiesEXT;
if (CHECKS) {
check(__functionAddress);
}
callPPV(__functionAddress, physicalDevice.address(), samples, pMultisampleProperties);
}
/**
* Report sample count specific multisampling capabilities of a physical device.
*
* C Specification
*
* In addition to the minimum capabilities described in the previous section (Limits), implementations may support additional multisampling capabilities specific to a particular sample count.
*
* To query additional sample count specific multisampling capabilities, call:
*
*
* void vkGetPhysicalDeviceMultisamplePropertiesEXT(
* VkPhysicalDevice physicalDevice,
* VkSampleCountFlagBits samples,
* VkMultisamplePropertiesEXT* pMultisampleProperties);
*
* Valid Usage (Implicit)
*
*
* - {@code physicalDevice} must be a valid {@code VkPhysicalDevice} handle
* - {@code samples} must be a valid {@code VkSampleCountFlagBits} value
* - {@code pMultisampleProperties} must be a pointer to a {@link VkMultisamplePropertiesEXT} structure
*
*
* See Also
*
* {@link VkMultisamplePropertiesEXT}
*
* @param physicalDevice the physical device from which to query the additional multisampling capabilities.
* @param samples the sample count to query the capabilities for.
* @param pMultisampleProperties a pointer to a structure of type {@link VkMultisamplePropertiesEXT}, in which information about the additional multisampling capabilities specific to the sample count is returned.
*/
public static void vkGetPhysicalDeviceMultisamplePropertiesEXT(VkPhysicalDevice physicalDevice, @NativeType("VkSampleCountFlagBits") int samples, @NativeType("VkMultisamplePropertiesEXT *") VkMultisamplePropertiesEXT pMultisampleProperties) {
nvkGetPhysicalDeviceMultisamplePropertiesEXT(physicalDevice, samples, pMultisampleProperties.address());
}
}