Class EXTDiscardRectangles
- java.lang.Object
-
- org.lwjgl.vulkan.EXTDiscardRectangles
-
public class EXTDiscardRectangles extends java.lang.ObjectThis extension provides additional orthogonally aligned “discard rectangles” specified in framebuffer-space coordinates that restrict rasterization of all points, lines and triangles.From zero to an implementation-dependent limit (specified by
maxDiscardRectangles) number of discard rectangles can be operational at once. When one or more discard rectangles are active, rasterized fragments can either survive if the fragment is within any of the operational discard rectangles (DISCARD_RECTANGLE_MODE_INCLUSIVE_EXTmode) or be rejected if the fragment is within any of the operational discard rectangles (DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXTmode).These discard rectangles operate orthogonally to the existing scissor test functionality. The discard rectangles can be different for each physical device in a device group by specifying the device mask and setting discard rectangle dynamic state.
VK_EXT_discard_rectangles
- Name String
VK_EXT_discard_rectangles- Extension Type
- Device extension
- Registered Extension Number
- 100
- Revision
- 1
- Extension and Version Dependencies
- Requires Vulkan 1.0
- Requires
VK_KHR_get_physical_device_properties2
- Contact
- Piers Daniell pdaniell-nv
Other Extension Metadata
- Last Modified Date
- 2016-12-22
- Interactions and External Dependencies
- Interacts with
VK_KHR_device_group - Interacts with Vulkan 1.1
- Interacts with
- Contributors
- Daniel Koch, NVIDIA
- Jeff Bolz, NVIDIA
-
-
Field Summary
Fields Modifier and Type Field Description static intVK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT
VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXTVkDiscardRectangleModeEXT - Specify the discard rectangle modestatic intVK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXTExtendsVkDynamicState.static java.lang.StringVK_EXT_DISCARD_RECTANGLES_EXTENSION_NAMEThe extension name.static intVK_EXT_DISCARD_RECTANGLES_SPEC_VERSIONThe extension specification version.static intVK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT
VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXTExtendsVkStructureType.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidnvkCmdSetDiscardRectangleEXT(org.lwjgl.vulkan.VkCommandBuffer commandBuffer, int firstDiscardRectangle, int discardRectangleCount, long pDiscardRectangles)Unsafe version of:CmdSetDiscardRectangleEXTstatic voidvkCmdSetDiscardRectangleEXT(org.lwjgl.vulkan.VkCommandBuffer commandBuffer, int firstDiscardRectangle, VkRect2D.Buffer pDiscardRectangles)Set discard rectangles dynamically for a command buffer.
-
-
-
Field Detail
-
VK_EXT_DISCARD_RECTANGLES_SPEC_VERSION
The extension specification version.
-
VK_EXT_DISCARD_RECTANGLES_EXTENSION_NAME
The extension name.
-
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT, VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT
ExtendsVkStructureType.Enum values:
-
VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT
ExtendsVkDynamicState.
-
VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT, VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT
VkDiscardRectangleModeEXT - Specify the discard rectangle modeDescription
DISCARD_RECTANGLE_MODE_INCLUSIVE_EXTspecifies that the discard rectangle test is inclusive.DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXTspecifies that the discard rectangle test is exclusive.
See Also
-
-
Method Detail
-
nvkCmdSetDiscardRectangleEXT
public static void nvkCmdSetDiscardRectangleEXT(org.lwjgl.vulkan.VkCommandBuffer commandBuffer, int firstDiscardRectangle, int discardRectangleCount, long pDiscardRectangles)Unsafe version of:CmdSetDiscardRectangleEXT- Parameters:
discardRectangleCount- the number of discard rectangles whose state are updated by the command.
-
vkCmdSetDiscardRectangleEXT
public static void vkCmdSetDiscardRectangleEXT(org.lwjgl.vulkan.VkCommandBuffer commandBuffer, int firstDiscardRectangle, VkRect2D.Buffer pDiscardRectangles)Set discard rectangles dynamically for a command buffer.C Specification
To dynamically set the discard rectangles, call:
void vkCmdSetDiscardRectangleEXT( VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const VkRect2D* pDiscardRectangles);Description
The discard rectangle taken from element
iofpDiscardRectanglesreplace the current state for the discard rectangle at indexfirstDiscardRectangle + i, foriin[0, discardRectangleCount).This command sets the discard rectangles for subsequent drawing commands when the graphics pipeline is created with
DYNAMIC_STATE_DISCARD_RECTANGLE_EXTset inVkPipelineDynamicStateCreateInfo::pDynamicStates. Otherwise, this state is specified by theVkPipelineDiscardRectangleStateCreateInfoEXT::pDiscardRectanglesvalues used to create the currently active pipeline.Valid Usage
- The sum of
firstDiscardRectangleanddiscardRectangleCountmust be less than or equal toVkPhysicalDeviceDiscardRectanglePropertiesEXT::maxDiscardRectangles - The
xandymember ofoffsetin eachVkRect2Delement ofpDiscardRectanglesmust be greater than or equal to 0 - Evaluation of
(offset.x + extent.width)in eachVkRect2Delement ofpDiscardRectanglesmust not cause a signed integer addition overflow - Evaluation of
(offset.y + extent.height)in eachVkRect2Delement ofpDiscardRectanglesmust not cause a signed integer addition overflow - If this command is recorded in a secondary command buffer with
VkCommandBufferInheritanceViewportScissorInfoNV::viewportScissor2Denabled, then this function must not be called
Valid Usage (Implicit)
commandBuffermust be a validVkCommandBufferhandlepDiscardRectanglesmust be a valid pointer to an array ofdiscardRectangleCountVkRect2DstructurescommandBuffermust be in the recording state- The
VkCommandPoolthatcommandBufferwas allocated from must support graphics operations discardRectangleCountmust be greater than 0
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 Supported Queue Types Primary Secondary Both Graphics See Also
- Parameters:
commandBuffer- the command buffer into which the command will be recorded.firstDiscardRectangle- the index of the first discard rectangle whose state is updated by the command.pDiscardRectangles- a pointer to an array ofVkRect2Dstructures specifying discard rectangles.
- The sum of
-
-