| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Vulkan.Extensions.VK_EXT_blend_operation_advanced
Description
Name
VK_EXT_blend_operation_advanced - device extension
VK_EXT_blend_operation_advanced
- Name String
VK_EXT_blend_operation_advanced
- Extension Type
- Device extension
- Registered Extension Number
- 149
- 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
- 2017-06-12
- Contributors
- Jeff Bolz, NVIDIA
Description
This extension adds a number of “advanced” blending operations that can be used to perform new color blending operations, many of which are more complex than the standard blend modes provided by unextended Vulkan. This extension requires different styles of usage, depending on the level of hardware support and the enabled features:
- If
PhysicalDeviceBlendOperationAdvancedFeaturesEXT::advancedBlendCoherentOperationsisFALSE, the new blending operations are supported, but a memory dependency must separate each advanced blend operation on a given sample.ACCESS_COLOR_ATTACHMENT_READ_NONCOHERENT_BIT_EXTis used to synchronize reads using advanced blend operations. - If
PhysicalDeviceBlendOperationAdvancedFeaturesEXT::advancedBlendCoherentOperationsisTRUE, advanced blend operations obey primitive order just like basic blend operations.
In unextended Vulkan, the set of blending operations is limited, and
can be expressed very simply. The
BLEND_OP_MIN and
BLEND_OP_MAX blend operations simply
compute component-wise minimums or maximums of source and destination
color components. The BLEND_OP_ADD,
BLEND_OP_SUBTRACT, and
BLEND_OP_REVERSE_SUBTRACT modes multiply
the source and destination colors by source and destination factors and
either add the two products together or subtract one from the other.
This limited set of operations supports many common blending operations
but precludes the use of more sophisticated transparency and blending
operations commonly available in many dedicated imaging APIs.
This extension provides a number of new “advanced” blending operations.
Unlike traditional blending operations using
BLEND_OP_ADD, these blending equations do
not use source and destination factors specified by
BlendFactor. Instead, each blend
operation specifies a complete equation based on the source and
destination colors. These new blend operations are used for both RGB and
alpha components; they must not be used to perform separate RGB and
alpha blending (via different values of color and alpha
BlendOp).
These blending operations are performed using premultiplied colors,
where RGB colors can be considered premultiplied or non-premultiplied
by alpha, according to the srcPremultiplied and dstPremultiplied
members of PipelineColorBlendAdvancedStateCreateInfoEXT. If a color is
considered non-premultiplied, the (R,G,B) color components are
multiplied by the alpha component prior to blending. For
non-premultiplied color components in the range [0,1], the corresponding
premultiplied color component would have values in the range [0 × A, 1 ×
A].
Many of these advanced blending equations are formulated where the
result of blending source and destination colors with partial coverage
have three separate contributions: from the portions covered by both the
source and the destination, from the portion covered only by the source,
and from the portion covered only by the destination. The blend
parameter PipelineColorBlendAdvancedStateCreateInfoEXT::blendOverlap
can be used to specify a correlation between source and destination
pixel coverage. If set to BLEND_OVERLAP_CONJOINT_EXT, the source and
destination are considered to have maximal overlap, as would be the case
if drawing two objects on top of each other. If set to
BLEND_OVERLAP_DISJOINT_EXT, the source and destination are considered
to have minimal overlap, as would be the case when rendering a complex
polygon tessellated into individual non-intersecting triangles. If set
to BLEND_OVERLAP_UNCORRELATED_EXT, the source and destination coverage
are assumed to have no spatial correlation within the pixel.
In addition to the coherency issues on implementations not supporting
advancedBlendCoherentOperations, this extension has several
limitations worth noting. First, the new blend operations have a limit
on the number of color attachments they can be used with, as indicated
by
PhysicalDeviceBlendOperationAdvancedPropertiesEXT::advancedBlendMaxColorAttachments.
Additionally, blending precision may be limited to 16-bit
floating-point, which may result in a loss of precision and dynamic
range for framebuffer formats with 32-bit floating-point components, and
in a loss of precision for formats with 12- and 16-bit signed or
unsigned normalized integer components.
New Structures
Extending
PhysicalDeviceProperties2:Extending
PipelineColorBlendStateCreateInfo:
New Enums
New Enum Constants
EXT_BLEND_OPERATION_ADVANCED_SPEC_VERSIONExtending
AccessFlagBits:Extending
BlendOp:BLEND_OP_BLUE_EXTBLEND_OP_COLORBURN_EXTBLEND_OP_COLORDODGE_EXTBLEND_OP_CONTRAST_EXTBLEND_OP_DARKEN_EXTBLEND_OP_DIFFERENCE_EXTBLEND_OP_DST_ATOP_EXTBLEND_OP_DST_EXTBLEND_OP_DST_IN_EXTBLEND_OP_DST_OUT_EXTBLEND_OP_DST_OVER_EXTBLEND_OP_EXCLUSION_EXTBLEND_OP_GREEN_EXTBLEND_OP_HARDLIGHT_EXTBLEND_OP_HARDMIX_EXTBLEND_OP_HSL_COLOR_EXTBLEND_OP_HSL_HUE_EXTBLEND_OP_HSL_LUMINOSITY_EXTBLEND_OP_HSL_SATURATION_EXTBLEND_OP_INVERT_EXTBLEND_OP_INVERT_OVG_EXTBLEND_OP_INVERT_RGB_EXTBLEND_OP_LIGHTEN_EXTBLEND_OP_LINEARBURN_EXTBLEND_OP_LINEARDODGE_EXTBLEND_OP_LINEARLIGHT_EXTBLEND_OP_MINUS_CLAMPED_EXTBLEND_OP_MINUS_EXTBLEND_OP_MULTIPLY_EXTBLEND_OP_OVERLAY_EXTBLEND_OP_PINLIGHT_EXTBLEND_OP_PLUS_CLAMPED_ALPHA_EXTBLEND_OP_PLUS_CLAMPED_EXTBLEND_OP_PLUS_DARKER_EXTBLEND_OP_PLUS_EXTBLEND_OP_RED_EXTBLEND_OP_SCREEN_EXTBLEND_OP_SOFTLIGHT_EXTBLEND_OP_SRC_ATOP_EXTBLEND_OP_SRC_EXTBLEND_OP_SRC_IN_EXTBLEND_OP_SRC_OUT_EXTBLEND_OP_SRC_OVER_EXTBLEND_OP_VIVIDLIGHT_EXTBLEND_OP_XOR_EXTBLEND_OP_ZERO_EXT
Extending
StructureType:
Issues
None.
Version History
Revision 1, 2017-06-12 (Jeff Bolz)
- Internal revisions
Revision 2, 2017-06-12 (Jeff Bolz)
- Internal revisions
See Also
BlendOverlapEXT, PhysicalDeviceBlendOperationAdvancedFeaturesEXT,
PhysicalDeviceBlendOperationAdvancedPropertiesEXT,
PipelineColorBlendAdvancedStateCreateInfoEXT
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
- data PhysicalDeviceBlendOperationAdvancedFeaturesEXT = PhysicalDeviceBlendOperationAdvancedFeaturesEXT {}
- data PhysicalDeviceBlendOperationAdvancedPropertiesEXT = PhysicalDeviceBlendOperationAdvancedPropertiesEXT {}
- data PipelineColorBlendAdvancedStateCreateInfoEXT = PipelineColorBlendAdvancedStateCreateInfoEXT {}
- newtype BlendOverlapEXT where
- BlendOverlapEXT Int32
- pattern BLEND_OVERLAP_UNCORRELATED_EXT :: BlendOverlapEXT
- pattern BLEND_OVERLAP_DISJOINT_EXT :: BlendOverlapEXT
- pattern BLEND_OVERLAP_CONJOINT_EXT :: BlendOverlapEXT
- type EXT_BLEND_OPERATION_ADVANCED_SPEC_VERSION = 2
- pattern EXT_BLEND_OPERATION_ADVANCED_SPEC_VERSION :: forall a. Integral a => a
- type EXT_BLEND_OPERATION_ADVANCED_EXTENSION_NAME = "VK_EXT_blend_operation_advanced"
- pattern EXT_BLEND_OPERATION_ADVANCED_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
Documentation
data PhysicalDeviceBlendOperationAdvancedFeaturesEXT Source #
VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT - Structure describing advanced blending features that can be supported by an implementation
Members
This structure describes the following feature:
Description
If the PhysicalDeviceBlendOperationAdvancedFeaturesEXT structure is
included in the pNext chain of the
PhysicalDeviceFeatures2
structure passed to
getPhysicalDeviceFeatures2,
it is filled in to indicate whether each corresponding feature is
supported. PhysicalDeviceBlendOperationAdvancedFeaturesEXT can also
be used in the pNext chain of DeviceCreateInfo
to selectively enable these features.
Valid Usage (Implicit)
See Also
Constructors
| PhysicalDeviceBlendOperationAdvancedFeaturesEXT | |
Fields
| |
Instances
data PhysicalDeviceBlendOperationAdvancedPropertiesEXT Source #
VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT - Structure describing advanced blending limits that can be supported by an implementation
Description
If the PhysicalDeviceBlendOperationAdvancedPropertiesEXT 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
Constructors
| PhysicalDeviceBlendOperationAdvancedPropertiesEXT | |
Fields
| |
Instances
data PipelineColorBlendAdvancedStateCreateInfoEXT Source #
VkPipelineColorBlendAdvancedStateCreateInfoEXT - Structure specifying parameters that affect advanced blend operations
Description
If this structure is not present, srcPremultiplied and
dstPremultiplied are both considered to be
TRUE, and blendOverlap is considered
to be BLEND_OVERLAP_UNCORRELATED_EXT.
Valid Usage
-
If the
non-premultiplied source color
property is not supported,
srcPremultipliedmust beTRUE
-
If the
non-premultiplied destination color
property is not supported,
dstPremultipliedmust beTRUE -
If the
correlated overlap
property is not supported,
blendOverlapmust beBLEND_OVERLAP_UNCORRELATED_EXT
Valid Usage (Implicit)
-
blendOverlapmust be a validBlendOverlapEXTvalue
See Also
VK_EXT_blend_operation_advanced,
BlendOverlapEXT, Bool32,
StructureType
Constructors
| PipelineColorBlendAdvancedStateCreateInfoEXT | |
Fields
| |
Instances
newtype BlendOverlapEXT Source #
VkBlendOverlapEXT - Enumerant specifying the blend overlap parameter
Description
'
| Overlap Mode | Weighting Equations |
|---|---|
BLEND_OVERLAP_UNCORRELATED_EXT
| \[ \begin{aligned} p_0(A_s,A_d) & = A_sA_d \\ p_1(A_s,A_d) & = A_s(1-A_d) \\ p_2(A_s,A_d) & = A_d(1-A_s) \\ \end{aligned}\] |
BLEND_OVERLAP_CONJOINT_EXT
| \[ \begin{aligned} p_0(A_s,A_d) & = min(A_s,A_d) \\ p_1(A_s,A_d) & = max(A_s-A_d,0) \\ p_2(A_s,A_d) & = max(A_d-A_s,0) \\ \end{aligned}\] |
BLEND_OVERLAP_DISJOINT_EXT
| \[ \begin{aligned} p_0(A_s,A_d) & = max(A_s+A_d-1,0) \\ p_1(A_s,A_d) & = min(A_s,1-A_d) \\ p_2(A_s,A_d) & = min(A_d,1-A_s) \\ \end{aligned}\] |
Advanced Blend Overlap Modes
See Also
VK_EXT_blend_operation_advanced,
ColorBlendAdvancedEXT,
PipelineColorBlendAdvancedStateCreateInfoEXT
Constructors
| BlendOverlapEXT Int32 |
Bundled Patterns
| pattern BLEND_OVERLAP_UNCORRELATED_EXT :: BlendOverlapEXT |
|
| pattern BLEND_OVERLAP_DISJOINT_EXT :: BlendOverlapEXT |
|
| pattern BLEND_OVERLAP_CONJOINT_EXT :: BlendOverlapEXT |
|
Instances
pattern EXT_BLEND_OPERATION_ADVANCED_SPEC_VERSION :: forall a. Integral a => a Source #
type EXT_BLEND_OPERATION_ADVANCED_EXTENSION_NAME = "VK_EXT_blend_operation_advanced" Source #
pattern EXT_BLEND_OPERATION_ADVANCED_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a Source #