Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Name
VK_EXT_discard_rectangles - device extension
VK_EXT_discard_rectangles
- Name String
VK_EXT_discard_rectangles
- Extension Type
- Device extension
- Registered Extension Number
- 100
- Revision
- 2
- Ratification Status
- Not ratified
- Extension and Version Dependencies
- VK_KHR_get_physical_device_properties2 or Version 1.1
- Contact
Other Extension Metadata
- Last Modified Date
- 2023-01-18
- Interactions and External Dependencies
- Interacts with
VK_KHR_device_group
- Interacts with Vulkan 1.1
- Interacts with
- Contributors
- Daniel Koch, NVIDIA
- Jeff Bolz, NVIDIA
Description
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.
Version 2 of this extension introduces new dynamic states
DYNAMIC_STATE_DISCARD_RECTANGLE_ENABLE_EXT
and
DYNAMIC_STATE_DISCARD_RECTANGLE_MODE_EXT
,
and the corresponding functions cmdSetDiscardRectangleEnableEXT
and
cmdSetDiscardRectangleModeEXT
. Applications that use these dynamic
states must ensure the implementation advertises at least specVersion
2
of this extension.
New Commands
New Structures
New Enums
New Bitmasks
New Enum Constants
EXT_DISCARD_RECTANGLES_SPEC_VERSION
Extending
DynamicState
:Extending
StructureType
:
Version History
Revision 2, 2023-01-18 (Piers Daniell)
- Add dynamic states for discard rectangle enable/disable and mode.
Revision 1, 2016-12-22 (Piers Daniell)
- Internal revisions
See Also
DiscardRectangleModeEXT
,
PhysicalDeviceDiscardRectanglePropertiesEXT
,
PipelineDiscardRectangleStateCreateFlagsEXT
,
PipelineDiscardRectangleStateCreateInfoEXT
,
cmdSetDiscardRectangleEXT
, cmdSetDiscardRectangleEnableEXT
,
cmdSetDiscardRectangleModeEXT
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.
Synopsis
- cmdSetDiscardRectangleEXT :: forall io. MonadIO io => CommandBuffer -> ("firstDiscardRectangle" ::: Word32) -> ("discardRectangles" ::: Vector Rect2D) -> io ()
- cmdSetDiscardRectangleEnableEXT :: forall io. MonadIO io => CommandBuffer -> ("discardRectangleEnable" ::: Bool) -> io ()
- cmdSetDiscardRectangleModeEXT :: forall io. MonadIO io => CommandBuffer -> DiscardRectangleModeEXT -> io ()
- data PhysicalDeviceDiscardRectanglePropertiesEXT = PhysicalDeviceDiscardRectanglePropertiesEXT {}
- data PipelineDiscardRectangleStateCreateInfoEXT = PipelineDiscardRectangleStateCreateInfoEXT {}
- newtype PipelineDiscardRectangleStateCreateFlagsEXT = PipelineDiscardRectangleStateCreateFlagsEXT Flags
- newtype DiscardRectangleModeEXT where
- type EXT_DISCARD_RECTANGLES_SPEC_VERSION = 2
- pattern EXT_DISCARD_RECTANGLES_SPEC_VERSION :: forall a. Integral a => a
- type EXT_DISCARD_RECTANGLES_EXTENSION_NAME = "VK_EXT_discard_rectangles"
- pattern EXT_DISCARD_RECTANGLES_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
Documentation
cmdSetDiscardRectangleEXT Source #
:: forall io. MonadIO io | |
=> CommandBuffer |
|
-> ("firstDiscardRectangle" ::: Word32) |
|
-> ("discardRectangles" ::: Vector Rect2D) |
|
-> io () |
vkCmdSetDiscardRectangleEXT - Set discard rectangles dynamically for a command buffer
Description
The discard rectangle taken from element i of pDiscardRectangles
replace the current state for the discard rectangle at index
firstDiscardRectangle
+ i, for i in [0, discardRectangleCount
).
This command sets the discard rectangles for subsequent drawing commands
when drawing using
shader objects,
or when the graphics pipeline is created with
DYNAMIC_STATE_DISCARD_RECTANGLE_EXT
set in
PipelineDynamicStateCreateInfo
::pDynamicStates
.
Otherwise, this state is specified by the
PipelineDiscardRectangleStateCreateInfoEXT
::pDiscardRectangles
values used to create the currently active pipeline.
Valid Usage
- The
sum of
firstDiscardRectangle
anddiscardRectangleCount
must be less than or equal toPhysicalDeviceDiscardRectanglePropertiesEXT
::maxDiscardRectangles
- The
x
andy
member ofoffset
in eachRect2D
element ofpDiscardRectangles
must be greater than or equal to0
- Evaluation of
(
offset.x
+extent.width
) in eachRect2D
element ofpDiscardRectangles
must not cause a signed integer addition overflow - Evaluation of
(
offset.y
+extent.height
) in eachRect2D
element ofpDiscardRectangles
must not cause a signed integer addition overflow - If this
command is recorded in a secondary command buffer with
CommandBufferInheritanceViewportScissorInfoNV
::viewportScissor2D
enabled, then this function must not be called
Valid Usage (Implicit)
-
commandBuffer
must be a validCommandBuffer
handle
-
pDiscardRectangles
must be a valid pointer to an array ofdiscardRectangleCount
Rect2D
structures -
commandBuffer
must be in the recording state - The
CommandPool
thatcommandBuffer
was allocated from must support graphics operations - This command must only be called outside of a video coding scope
-
discardRectangleCount
must be greater than0
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized
- Host access to the
CommandPool
thatcommandBuffer
was 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
cmdSetDiscardRectangleEnableEXT Source #
:: forall io. MonadIO io | |
=> CommandBuffer |
|
-> ("discardRectangleEnable" ::: Bool) |
|
-> io () |
vkCmdSetDiscardRectangleEnableEXT - Enable discard rectangles dynamically for a command buffer
Description
This command sets the discard rectangle enable for subsequent drawing
commands when drawing using
shader objects,
or when the graphics pipeline is created with
DYNAMIC_STATE_DISCARD_RECTANGLE_ENABLE_EXT
set in
PipelineDynamicStateCreateInfo
::pDynamicStates
.
Otherwise, this state is implied by the
PipelineDiscardRectangleStateCreateInfoEXT
::discardRectangleCount
value used to create the currently active pipeline, where a non-zero
discardRectangleCount
implicitly enables discard rectangles, otherwise
they are disabled.
Valid Usage
- The
VK_EXT_discard_rectangles
extension must be enabled, and the implementation must support at leastspecVersion
2
of this extension
Valid Usage (Implicit)
-
commandBuffer
must be a validCommandBuffer
handle
-
commandBuffer
must be in the recording state - The
CommandPool
thatcommandBuffer
was allocated from must support graphics operations - This command must only be called outside of a video coding scope
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized
- Host access to the
CommandPool
thatcommandBuffer
was 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
cmdSetDiscardRectangleModeEXT Source #
:: forall io. MonadIO io | |
=> CommandBuffer |
|
-> DiscardRectangleModeEXT |
|
-> io () |
vkCmdSetDiscardRectangleModeEXT - Sets the discard rectangle mode dynamically for a command buffer
Description
This command sets the discard rectangle mode for subsequent drawing
commands when drawing using
shader objects,
or when the graphics pipeline is created with
DYNAMIC_STATE_DISCARD_RECTANGLE_MODE_EXT
set in
PipelineDynamicStateCreateInfo
::pDynamicStates
.
Otherwise, this state is specified by the
PipelineDiscardRectangleStateCreateInfoEXT
::discardRectangleMode
value used to create the currently active pipeline.
Valid Usage
- The
VK_EXT_discard_rectangles
extension must be enabled, and the implementation must support at leastspecVersion
2
of this extension
Valid Usage (Implicit)
-
commandBuffer
must be a validCommandBuffer
handle
-
discardRectangleMode
must be a validDiscardRectangleModeEXT
value -
commandBuffer
must be in the recording state - The
CommandPool
thatcommandBuffer
was allocated from must support graphics operations - This command must only be called outside of a video coding scope
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized
- Host access to the
CommandPool
thatcommandBuffer
was 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
VK_EXT_discard_rectangles,
CommandBuffer
, DiscardRectangleModeEXT
data PhysicalDeviceDiscardRectanglePropertiesEXT Source #
VkPhysicalDeviceDiscardRectanglePropertiesEXT - Structure describing discard rectangle limits that can be supported by an implementation
Description
If the PhysicalDeviceDiscardRectanglePropertiesEXT
structure is
included in the pNext
chain of the
PhysicalDeviceProperties2
structure passed to
getPhysicalDeviceProperties2
,
it is filled in with each corresponding implementation-dependent
property.
Valid Usage (Implicit)
See Also
Instances
data PipelineDiscardRectangleStateCreateInfoEXT Source #
VkPipelineDiscardRectangleStateCreateInfoEXT - Structure specifying discard rectangle
Description
If the
DYNAMIC_STATE_DISCARD_RECTANGLE_EXT
dynamic state is enabled for a pipeline, the pDiscardRectangles
member
is ignored. If the
DYNAMIC_STATE_DISCARD_RECTANGLE_ENABLE_EXT
dynamic state is not enabled for the pipeline the presence of this
structure in the GraphicsPipelineCreateInfo
chain, and a discardRectangleCount
greater than zero, implicitly
enables discard rectangles in the pipeline, otherwise discard rectangles
must enabled or disabled by cmdSetDiscardRectangleEnableEXT
. If the
DYNAMIC_STATE_DISCARD_RECTANGLE_MODE_EXT
dynamic state is enabled for the pipeline, the discardRectangleMode
member is ignored, and the discard rectangle mode must be set by
cmdSetDiscardRectangleModeEXT
.
When this structure is included in the pNext
chain of
GraphicsPipelineCreateInfo
, it defines
parameters of the discard rectangle test. If the
DYNAMIC_STATE_DISCARD_RECTANGLE_EXT
dynamic state is not enabled, and this structure is not included in the
pNext
chain, it is equivalent to specifying this structure with a
discardRectangleCount
of 0
.
Valid Usage (Implicit)
See Also
VK_EXT_discard_rectangles,
DiscardRectangleModeEXT
,
PipelineDiscardRectangleStateCreateFlagsEXT
,
Rect2D
,
StructureType
PipelineDiscardRectangleStateCreateInfoEXT | |
|
Instances
newtype PipelineDiscardRectangleStateCreateFlagsEXT Source #
VkPipelineDiscardRectangleStateCreateFlagsEXT - Reserved for future use
Description
PipelineDiscardRectangleStateCreateFlagsEXT
is a bitmask type for
setting a mask, but is currently reserved for future use.
See Also
VK_EXT_discard_rectangles,
PipelineDiscardRectangleStateCreateInfoEXT
Instances
newtype DiscardRectangleModeEXT Source #
VkDiscardRectangleModeEXT - Specify the discard rectangle mode
See Also
VK_EXT_discard_rectangles,
PipelineDiscardRectangleStateCreateInfoEXT
,
cmdSetDiscardRectangleModeEXT
pattern DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT :: DiscardRectangleModeEXT |
|
pattern DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT :: DiscardRectangleModeEXT |
|
Instances
type EXT_DISCARD_RECTANGLES_SPEC_VERSION = 2 Source #
pattern EXT_DISCARD_RECTANGLES_SPEC_VERSION :: forall a. Integral a => a Source #
type EXT_DISCARD_RECTANGLES_EXTENSION_NAME = "VK_EXT_discard_rectangles" Source #
pattern EXT_DISCARD_RECTANGLES_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a Source #