Class EXTDiscardRectangles
- java.lang.Object
-
- org.lwjgl.vulkan.EXTDiscardRectangles
-
public class EXTDiscardRectangles extends java.lang.Object
This 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_EXT
mode) or be rejected if the fragment is within any of the operational discard rectangles (DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT
mode).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.
- 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
- Last Modified Date
- 2016-12-22
- Interactions and External Dependencies
- Interacts with VK_KHR_device_group
- Interacts with Vulkan 1.1
- Contributors
- Daniel Koch, NVIDIA
- Jeff Bolz, NVIDIA
-
-
Field Summary
Fields Modifier and Type Field Description static int
VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT
VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXTVkDiscardRectangleModeEXT - Specify the discard rectangle modestatic int
VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT
ExtendsVkDynamicState
.static java.lang.String
VK_EXT_DISCARD_RECTANGLES_EXTENSION_NAME
The extension name.static int
VK_EXT_DISCARD_RECTANGLES_SPEC_VERSION
The extension specification version.static int
VK_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 void
nvkCmdSetDiscardRectangleEXT(VkCommandBuffer commandBuffer, int firstDiscardRectangle, int discardRectangleCount, long pDiscardRectangles)
Unsafe version of:CmdSetDiscardRectangleEXT
static void
vkCmdSetDiscardRectangleEXT(VkCommandBuffer commandBuffer, int firstDiscardRectangle, VkRect2D.Buffer pDiscardRectangles)
Set discard rectangles dynamically.
-
-
-
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_EXT
specifies that a fragment within any discard rectangle satisfies the test.DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT
specifies that a fragment not within any of the discard rectangles satisfies the test.
See Also
-
-
Method Detail
-
nvkCmdSetDiscardRectangleEXT
public static void nvkCmdSetDiscardRectangleEXT(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(VkCommandBuffer commandBuffer, int firstDiscardRectangle, VkRect2D.Buffer pDiscardRectangles)
Set discard rectangles dynamically.C Specification
If the pipeline state object was created with the
DYNAMIC_STATE_DISCARD_RECTANGLE_EXT
dynamic state enabled, the discard rectangles are dynamically set and changed with the command:void vkCmdSetDiscardRectangleEXT( VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const VkRect2D* pDiscardRectangles);
Description
The discard rectangle taken from element
i
ofpDiscardRectangles
replace the current state for the discard rectangle indexfirstDiscardRectangle + i
, fori
in[0, discardRectangleCount)
.Valid Usage
- The bound graphics pipeline must have been created with the
DYNAMIC_STATE_DISCARD_RECTANGLE_EXT
dynamic state enabled - The sum of
firstDiscardRectangle
anddiscardRectangleCount
must be less than or equal toVkPhysicalDeviceDiscardRectanglePropertiesEXT
::maxDiscardRectangles
- The
x
andy
member ofoffset
in eachVkRect2D
element ofpDiscardRectangles
must be greater than or equal to 0 - Evaluation of
(offset.x + extent.width)
in eachVkRect2D
element ofpDiscardRectangles
must not cause a signed integer addition overflow - Evaluation of
(offset.y + extent.height)
in eachVkRect2D
element ofpDiscardRectangles
must not cause a signed integer addition overflow
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlepDiscardRectangles
must be a valid pointer to an array ofdiscardRectangleCount
VkRect2D
structurescommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics operations discardRectangleCount
must be greater than 0
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized - Host access to the
VkCommandPool
thatcommandBuffer
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
- 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 ofVkRect2D
structures specifying discard rectangles.
- The bound graphics pipeline must have been created with the
-
-