| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Vulkan.Extensions.VK_KHR_fragment_shading_rate
Description
Name
VK_KHR_fragment_shading_rate - device extension
VK_KHR_fragment_shading_rate
- Name String
VK_KHR_fragment_shading_rate
- Extension Type
- Device extension
- Registered Extension Number
- 227
- Revision
- 2
- Extension and Version Dependencies
- Requires Vulkan 1.0
- Requires
VK_KHR_create_renderpass2 - Requires
VK_KHR_get_physical_device_properties2
- Contact
Other Extension Metadata
- Last Modified Date
- 2021-09-30
- Interactions and External Dependencies
- This extension requires SPV_KHR_fragment_shading_rate.
- Contributors
- Tobias Hector, AMD
- Guennadi Riguer, AMD
- Matthaeus Chajdas, AMD
- Pat Brown, Nvidia
- Matthew Netsch, Qualcomm
- Slawomir Grajewski, Intel
- Jan-Harald Fredriksen, Arm
- Jeff Bolz, Nvidia
- Contributors to the VK_NV_shading_rate_image specification
- Contributors to the VK_EXT_fragment_density_map specification
Description
This extension adds the ability to change the rate at which fragments are shaded. Rather than the usual single fragment invocation for each pixel covered by a primitive, multiple pixels can be shaded by a single fragment shader invocation.
Up to three methods are available to the application to change the fragment shading rate:
- https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#primsrast-fragment-shading-rate-pipeline, which allows the specification of a rate per-draw.
- https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#primsrast-fragment-shading-rate-primitive, which allows the specification of a rate per primitive, specified during shading.
- https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#primsrast-fragment-shading-rate-attachment, which allows the specification of a rate per-region of the framebuffer, specified in a specialized image attachment.
Additionally, these rates can all be specified and combined in order to adjust the overall detail in the image at each point.
This functionality can be used to focus shading efforts where higher levels of detail are needed in some parts of a scene compared to others. This can be particularly useful in high resolution rendering, or for XR contexts.
This extension also adds support for the SPV_KHR_fragment_shading_rate
extension which enables setting the
primitive fragment shading rate,
and allows querying the final shading rate from a fragment shader.
New Commands
New Structures
Extending
GraphicsPipelineCreateInfo:Extending
PhysicalDeviceFeatures2,DeviceCreateInfo:Extending
PhysicalDeviceProperties2:Extending
SubpassDescription2:
New Enums
New Enum Constants
KHR_FRAGMENT_SHADING_RATE_SPEC_VERSIONExtending
AccessFlagBits:Extending
DynamicState:Extending
FormatFeatureFlagBits:Extending
ImageLayout:Extending
ImageUsageFlagBits:Extending
PipelineStageFlagBits:Extending
StructureType:STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHRSTRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHRSTRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_KHRSTRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHRSTRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR
If VK_KHR_format_feature_flags2 is supported:
Version History
Revision 1, 2020-05-06 (Tobias Hector)
- Initial revision
Revision 2, 2021-09-30 (Jon Leech)
- Add interaction with
VK_KHR_format_feature_flags2tovk.xml
- Add interaction with
See Also
FragmentShadingRateAttachmentInfoKHR,
FragmentShadingRateCombinerOpKHR,
PhysicalDeviceFragmentShadingRateFeaturesKHR,
PhysicalDeviceFragmentShadingRateKHR,
PhysicalDeviceFragmentShadingRatePropertiesKHR,
PipelineFragmentShadingRateStateCreateInfoKHR,
cmdSetFragmentShadingRateKHR,
getPhysicalDeviceFragmentShadingRatesKHR
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
- cmdSetFragmentShadingRateKHR :: forall io. MonadIO io => CommandBuffer -> ("fragmentSize" ::: Extent2D) -> ("combinerOps" ::: (FragmentShadingRateCombinerOpKHR, FragmentShadingRateCombinerOpKHR)) -> io ()
- getPhysicalDeviceFragmentShadingRatesKHR :: forall io. MonadIO io => PhysicalDevice -> io (Result, "fragmentShadingRates" ::: Vector PhysicalDeviceFragmentShadingRateKHR)
- data FragmentShadingRateAttachmentInfoKHR = FragmentShadingRateAttachmentInfoKHR {}
- data PipelineFragmentShadingRateStateCreateInfoKHR = PipelineFragmentShadingRateStateCreateInfoKHR {}
- data PhysicalDeviceFragmentShadingRateFeaturesKHR = PhysicalDeviceFragmentShadingRateFeaturesKHR {}
- data PhysicalDeviceFragmentShadingRatePropertiesKHR = PhysicalDeviceFragmentShadingRatePropertiesKHR {
- minFragmentShadingRateAttachmentTexelSize :: Extent2D
- maxFragmentShadingRateAttachmentTexelSize :: Extent2D
- maxFragmentShadingRateAttachmentTexelSizeAspectRatio :: Word32
- primitiveFragmentShadingRateWithMultipleViewports :: Bool
- layeredShadingRateAttachments :: Bool
- fragmentShadingRateNonTrivialCombinerOps :: Bool
- maxFragmentSize :: Extent2D
- maxFragmentSizeAspectRatio :: Word32
- maxFragmentShadingRateCoverageSamples :: Word32
- maxFragmentShadingRateRasterizationSamples :: SampleCountFlagBits
- fragmentShadingRateWithShaderDepthStencilWrites :: Bool
- fragmentShadingRateWithSampleMask :: Bool
- fragmentShadingRateWithShaderSampleMask :: Bool
- fragmentShadingRateWithConservativeRasterization :: Bool
- fragmentShadingRateWithFragmentShaderInterlock :: Bool
- fragmentShadingRateWithCustomSampleLocations :: Bool
- fragmentShadingRateStrictMultiplyCombiner :: Bool
- data PhysicalDeviceFragmentShadingRateKHR = PhysicalDeviceFragmentShadingRateKHR {}
- newtype FragmentShadingRateCombinerOpKHR where
- FragmentShadingRateCombinerOpKHR Int32
- pattern FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR :: FragmentShadingRateCombinerOpKHR
- pattern FRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_KHR :: FragmentShadingRateCombinerOpKHR
- pattern FRAGMENT_SHADING_RATE_COMBINER_OP_MIN_KHR :: FragmentShadingRateCombinerOpKHR
- pattern FRAGMENT_SHADING_RATE_COMBINER_OP_MAX_KHR :: FragmentShadingRateCombinerOpKHR
- pattern FRAGMENT_SHADING_RATE_COMBINER_OP_MUL_KHR :: FragmentShadingRateCombinerOpKHR
- type KHR_FRAGMENT_SHADING_RATE_SPEC_VERSION = 2
- pattern KHR_FRAGMENT_SHADING_RATE_SPEC_VERSION :: forall a. Integral a => a
- type KHR_FRAGMENT_SHADING_RATE_EXTENSION_NAME = "VK_KHR_fragment_shading_rate"
- pattern KHR_FRAGMENT_SHADING_RATE_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
- newtype FormatFeatureFlagBits2KHR where
- FormatFeatureFlagBits2KHR Flags64
- pattern FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT_KHR :: FormatFeatureFlagBits2KHR
- pattern FORMAT_FEATURE_2_STORAGE_IMAGE_BIT_KHR :: FormatFeatureFlagBits2KHR
- pattern FORMAT_FEATURE_2_STORAGE_IMAGE_ATOMIC_BIT_KHR :: FormatFeatureFlagBits2KHR
- pattern FORMAT_FEATURE_2_UNIFORM_TEXEL_BUFFER_BIT_KHR :: FormatFeatureFlagBits2KHR
- pattern FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_BIT_KHR :: FormatFeatureFlagBits2KHR
- pattern FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_ATOMIC_BIT_KHR :: FormatFeatureFlagBits2KHR
- pattern FORMAT_FEATURE_2_VERTEX_BUFFER_BIT_KHR :: FormatFeatureFlagBits2KHR
- pattern FORMAT_FEATURE_2_COLOR_ATTACHMENT_BIT_KHR :: FormatFeatureFlagBits2KHR
- pattern FORMAT_FEATURE_2_COLOR_ATTACHMENT_BLEND_BIT_KHR :: FormatFeatureFlagBits2KHR
- pattern FORMAT_FEATURE_2_DEPTH_STENCIL_ATTACHMENT_BIT_KHR :: FormatFeatureFlagBits2KHR
- pattern FORMAT_FEATURE_2_BLIT_SRC_BIT_KHR :: FormatFeatureFlagBits2KHR
- pattern FORMAT_FEATURE_2_BLIT_DST_BIT_KHR :: FormatFeatureFlagBits2KHR
- pattern FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_LINEAR_BIT_KHR :: FormatFeatureFlagBits2KHR
- pattern FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT :: FormatFeatureFlagBits2KHR
- pattern FORMAT_FEATURE_2_TRANSFER_SRC_BIT_KHR :: FormatFeatureFlagBits2KHR
- pattern FORMAT_FEATURE_2_TRANSFER_DST_BIT_KHR :: FormatFeatureFlagBits2KHR
- pattern FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_MINMAX_BIT_KHR :: FormatFeatureFlagBits2KHR
- pattern FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT_KHR :: FormatFeatureFlagBits2KHR
- pattern FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT_KHR :: FormatFeatureFlagBits2KHR
- pattern FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT_KHR :: FormatFeatureFlagBits2KHR
- pattern FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT_KHR :: FormatFeatureFlagBits2KHR
- pattern FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT_KHR :: FormatFeatureFlagBits2KHR
- pattern FORMAT_FEATURE_2_DISJOINT_BIT_KHR :: FormatFeatureFlagBits2KHR
- pattern FORMAT_FEATURE_2_COSITED_CHROMA_SAMPLES_BIT_KHR :: FormatFeatureFlagBits2KHR
- pattern FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT_KHR :: FormatFeatureFlagBits2KHR
- pattern FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT_KHR :: FormatFeatureFlagBits2KHR
- pattern FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT_KHR :: FormatFeatureFlagBits2KHR
- pattern FORMAT_FEATURE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR :: FormatFeatureFlagBits2KHR
- pattern FORMAT_FEATURE_2_FRAGMENT_DENSITY_MAP_BIT_EXT :: FormatFeatureFlagBits2KHR
- pattern FORMAT_FEATURE_2_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR :: FormatFeatureFlagBits2KHR
- type FormatFeatureFlags2KHR = FormatFeatureFlagBits2KHR
- type Flags64 = Word64
Documentation
cmdSetFragmentShadingRateKHR Source #
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer |
|
| -> ("fragmentSize" ::: Extent2D) |
|
| -> ("combinerOps" ::: (FragmentShadingRateCombinerOpKHR, FragmentShadingRateCombinerOpKHR)) |
|
| -> io () |
vkCmdSetFragmentShadingRateKHR - Set pipeline fragment shading rate and combiner operation dynamically for a command buffer
Description
This command sets the pipeline fragment shading rate and combiner
operation for subsequent drawing commands when the graphics pipeline is
created with
DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR
set in
PipelineDynamicStateCreateInfo::pDynamicStates.
Otherwise, this state is specified by the
PipelineFragmentShadingRateStateCreateInfoKHR values used to create
the currently active pipeline.
Valid Usage
-
If
pipelineFragmentShadingRate
is not enabled,
pFragmentSize->widthmust be1
-
If
pipelineFragmentShadingRate
is not enabled,
pFragmentSize->heightmust be1 - One of pipelineFragmentShadingRate, primitiveFragmentShadingRate, or attachmentFragmentShadingRate must be enabled
-
If the
primitiveFragmentShadingRate feature
is not enabled,
combinerOps[0] must beFRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR -
If the
attachmentFragmentShadingRate feature
is not enabled,
combinerOps[1] must beFRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR -
If the
fragmentSizeNonTrivialCombinerOps
limit is not supported, elements of
combinerOpsmust be eitherFRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHRorFRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_KHR -
pFragmentSize->widthmust be greater than or equal to1 -
pFragmentSize->heightmust be greater than or equal to1 -
pFragmentSize->widthmust be a power-of-two value -
pFragmentSize->heightmust be a power-of-two value -
pFragmentSize->widthmust be less than or equal to4 -
pFragmentSize->heightmust be less than or equal to4
Valid Usage (Implicit)
-
commandBuffermust be a validCommandBufferhandle
-
pFragmentSizemust be a valid pointer to a validExtent2Dstructure - Any
given element of
combinerOpsmust be a validFragmentShadingRateCombinerOpKHRvalue -
commandBuffermust be in the recording state - The
CommandPoolthatcommandBufferwas allocated from must support graphics operations
Host Synchronization
- Host access to
commandBuffermust be externally synchronized
- Host access to the
CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types |
|---|---|---|
| Primary Secondary | Both | Graphics |
See Also
VK_KHR_fragment_shading_rate,
CommandBuffer,
Extent2D,
FragmentShadingRateCombinerOpKHR
getPhysicalDeviceFragmentShadingRatesKHR Source #
Arguments
| :: forall io. MonadIO io | |
| => PhysicalDevice |
|
| -> io (Result, "fragmentShadingRates" ::: Vector PhysicalDeviceFragmentShadingRateKHR) |
vkGetPhysicalDeviceFragmentShadingRatesKHR - Get available shading rates for a physical device
Description
If pFragmentShadingRates is NULL, then the number of fragment
shading rates available is returned in pFragmentShadingRateCount.
Otherwise, pFragmentShadingRateCount must point to a variable set by
the user to the number of elements in the pFragmentShadingRates array,
and on return the variable is overwritten with the number of structures
actually written to pFragmentShadingRates. If
pFragmentShadingRateCount is less than the number of fragment shading
rates available, at most pFragmentShadingRateCount structures will be
written, and INCOMPLETE will be returned
instead of SUCCESS, to indicate that not
all the available fragment shading rates were returned.
The returned array of fragment shading rates must be ordered from
largest fragmentSize.width value to smallest, and each set of fragment
shading rates with the same fragmentSize.width value must be ordered
from largest fragmentSize.height to smallest. Any two entries in the
array must not have the same fragmentSize values.
For any entry in the array, the following rules also apply:
- The value of
fragmentSize.widthmust be less than or equal to maxFragmentSize.width. - The value of
fragmentSize.widthmust be greater than or equal to1. - The value of
fragmentSize.widthmust be a power-of-two. - The value of
fragmentSize.heightmust be less than or equal to maxFragmentSize.height. - The value of
fragmentSize.heightmust be greater than or equal to1. - The value of
fragmentSize.heightmust be a power-of-two. - The highest sample count in
sampleCountsmust be less than or equal to maxFragmentShadingRateRasterizationSamples. - The product of
fragmentSize.width,fragmentSize.height, and the highest sample count insampleCountsmust be less than or equal to maxFragmentShadingRateCoverageSamples.
Implementations must support at least the following shading rates:
sampleCounts | fragmentSize |
|---|---|
SAMPLE_COUNT_1_BIT
|
SAMPLE_COUNT_4_BIT | {2,2} |
SAMPLE_COUNT_1_BIT
|
SAMPLE_COUNT_4_BIT | {2,1} |
| ~0 | {1,1} |
If
framebufferColorSampleCounts,
includes SAMPLE_COUNT_2_BIT,
the required rates must also include
SAMPLE_COUNT_2_BIT.
Note
Including the {1,1} fragment size is done for completeness; it has no actual effect on the support of rendering without setting the fragment size. All sample counts and render pass transforms are supported for this rate.
The returned set of fragment shading rates must be returned in the
native (rotated) coordinate system. For rasterization using render pass
transform not equal to
SURFACE_TRANSFORM_IDENTITY_BIT_KHR,
the application must transform the returned fragment shading rates
into the current (unrotated) coordinate system to get the supported
rates for that transform.
Note
For example, consider an implementation returning support for 4x2, but
not 2x4 in the set of supported fragment shading rates. This means that
for transforms
SURFACE_TRANSFORM_ROTATE_90_BIT_KHR
and
SURFACE_TRANSFORM_ROTATE_270_BIT_KHR,
2x4 is a supported rate, but 4x2 is an unsupported rate.
Valid Usage (Implicit)
-
physicalDevicemust be a validPhysicalDevicehandle
-
pFragmentShadingRateCountmust be a valid pointer to auint32_tvalue -
If the value referenced by
pFragmentShadingRateCountis not0, andpFragmentShadingRatesis notNULL,pFragmentShadingRatesmust be a valid pointer to an array ofpFragmentShadingRateCountPhysicalDeviceFragmentShadingRateKHRstructures
Return Codes
See Also
VK_KHR_fragment_shading_rate,
PhysicalDevice,
PhysicalDeviceFragmentShadingRateKHR
data FragmentShadingRateAttachmentInfoKHR Source #
VkFragmentShadingRateAttachmentInfoKHR - Structure specifying a fragment shading rate attachment for a subpass
Description
If no shading rate attachment is specified, or if this structure is not specified, the implementation behaves as if a valid shading rate attachment was specified with all texels specifying a single pixel per fragment.
Valid Usage
-
If
pFragmentShadingRateAttachmentis notNULLand itsattachmentmember is notATTACHMENT_UNUSED, itslayoutmember must be equal toIMAGE_LAYOUT_GENERALorIMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR
-
If
pFragmentShadingRateAttachmentis notNULLand itsattachmentmember is notATTACHMENT_UNUSED,shadingRateAttachmentTexelSize.widthmust be a power of two value -
If
pFragmentShadingRateAttachmentis notNULLand itsattachmentmember is notATTACHMENT_UNUSED,shadingRateAttachmentTexelSize.widthmust be less than or equal to maxFragmentShadingRateAttachmentTexelSize.width -
If
pFragmentShadingRateAttachmentis notNULLand itsattachmentmember is notATTACHMENT_UNUSED,shadingRateAttachmentTexelSize.widthmust be greater than or equal to minFragmentShadingRateAttachmentTexelSize.width -
If
pFragmentShadingRateAttachmentis notNULLand itsattachmentmember is notATTACHMENT_UNUSED,shadingRateAttachmentTexelSize.heightmust be a power of two value -
If
pFragmentShadingRateAttachmentis notNULLand itsattachmentmember is notATTACHMENT_UNUSED,shadingRateAttachmentTexelSize.heightmust be less than or equal to maxFragmentShadingRateAttachmentTexelSize.height -
If
pFragmentShadingRateAttachmentis notNULLand itsattachmentmember is notATTACHMENT_UNUSED,shadingRateAttachmentTexelSize.heightmust be greater than or equal to minFragmentShadingRateAttachmentTexelSize.height -
If
pFragmentShadingRateAttachmentis notNULLand itsattachmentmember is notATTACHMENT_UNUSED, the quotient ofshadingRateAttachmentTexelSize.widthandshadingRateAttachmentTexelSize.heightmust be less than or equal to maxFragmentShadingRateAttachmentTexelSizeAspectRatio -
If
pFragmentShadingRateAttachmentis notNULLand itsattachmentmember is notATTACHMENT_UNUSED, the quotient ofshadingRateAttachmentTexelSize.heightandshadingRateAttachmentTexelSize.widthmust be less than or equal to maxFragmentShadingRateAttachmentTexelSizeAspectRatio
Valid Usage (Implicit)
-
sTypemust beSTRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR
-
If
pFragmentShadingRateAttachmentis notNULL,pFragmentShadingRateAttachmentmust be a valid pointer to a validAttachmentReference2structure
See Also
VK_KHR_fragment_shading_rate,
AttachmentReference2,
Extent2D,
StructureType
Constructors
| FragmentShadingRateAttachmentInfoKHR | |
Fields
| |
Instances
data PipelineFragmentShadingRateStateCreateInfoKHR Source #
VkPipelineFragmentShadingRateStateCreateInfoKHR - Structure specifying parameters controlling the fragment shading rate
Description
If the pNext chain of
GraphicsPipelineCreateInfo includes a
PipelineFragmentShadingRateStateCreateInfoKHR structure, then that
structure includes parameters controlling the pipeline fragment shading
rate.
If this structure is not present, fragmentSize is considered to be
equal to (1,1), and both elements of combinerOps are considered to be
equal to FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR.
Valid Usage (Implicit)
-
Any given element of
combinerOpsmust be a validFragmentShadingRateCombinerOpKHRvalue
See Also
VK_KHR_fragment_shading_rate,
Extent2D,
FragmentShadingRateCombinerOpKHR,
StructureType
Constructors
| PipelineFragmentShadingRateStateCreateInfoKHR | |
Fields
| |
Instances
data PhysicalDeviceFragmentShadingRateFeaturesKHR Source #
VkPhysicalDeviceFragmentShadingRateFeaturesKHR - Structure indicating support for variable rate fragment shading
Members
This structure describes the following features:
Description
If the PhysicalDeviceFragmentShadingRateFeaturesKHR 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. PhysicalDeviceFragmentShadingRateFeaturesKHR can also be
used in the pNext chain of DeviceCreateInfo to
selectively enable these features.
Valid Usage (Implicit)
See Also
Constructors
| PhysicalDeviceFragmentShadingRateFeaturesKHR | |
Fields
| |
Instances
data PhysicalDeviceFragmentShadingRatePropertiesKHR Source #
VkPhysicalDeviceFragmentShadingRatePropertiesKHR - Structure describing variable fragment shading rate limits that can be supported by an implementation
Description
Note
Multiplication of the combiner rates using the fragment width/height in linear space is equivalent to an addition of those values in log2 space. Some implementations inadvertently implemented an addition in linear space due to unclear requirements originating outside of this specification. This resulted in fragmentShadingRateStrictMultiplyCombiner being added. Fortunately, this only affects situations where a rate of 1 in either dimension is combined with another rate of 1. All other combinations result in the exact same result as if multiplication was performed in linear space due to the clamping logic, and the fact that both the sum and product of 2 and 2 are equal. In many cases, this limit will not affect the correct operation of applications.
If the PhysicalDeviceFragmentShadingRatePropertiesKHR structure is
included in the pNext chain of the
PhysicalDeviceProperties2
structure passed to
getPhysicalDeviceProperties2,
it is filled in with each corresponding implementation-dependent
property.
These properties are related to fragment shading rates.
Valid Usage (Implicit)
See Also
VK_KHR_fragment_shading_rate,
Bool32,
Extent2D,
SampleCountFlagBits,
StructureType
Constructors
| PhysicalDeviceFragmentShadingRatePropertiesKHR | |
Fields
| |
Instances
data PhysicalDeviceFragmentShadingRateKHR Source #
VkPhysicalDeviceFragmentShadingRateKHR - Structure returning information about sample count specific additional multisampling capabilities
Valid Usage (Implicit)
See Also
VK_KHR_fragment_shading_rate,
Extent2D,
SampleCountFlags,
StructureType,
getPhysicalDeviceFragmentShadingRatesKHR
Constructors
| PhysicalDeviceFragmentShadingRateKHR | |
Fields
| |
Instances
newtype FragmentShadingRateCombinerOpKHR Source #
VkFragmentShadingRateCombinerOpKHR - Control how fragment shading rates are combined
Description
where combine(Axy,Bxy) is the combine operation, and Axy and Bxy are the inputs to the operation.
If
fragmentShadingRateStrictMultiplyCombiner
is FALSE, using
FRAGMENT_SHADING_RATE_COMBINER_OP_MUL_KHR with values of 1 for both A
and B in the same dimension results in the value 2 being produced for
that dimension. See the definition of
fragmentShadingRateStrictMultiplyCombiner
for more information.
These operations are performed in a component-wise fashion.
See Also
VK_KHR_fragment_shading_rate,
PipelineFragmentShadingRateEnumStateCreateInfoNV,
PipelineFragmentShadingRateStateCreateInfoKHR,
cmdSetFragmentShadingRateEnumNV,
cmdSetFragmentShadingRateKHR
Constructors
| FragmentShadingRateCombinerOpKHR Int32 |
Bundled Patterns
| pattern FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR :: FragmentShadingRateCombinerOpKHR |
|
| pattern FRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_KHR :: FragmentShadingRateCombinerOpKHR |
|
| pattern FRAGMENT_SHADING_RATE_COMBINER_OP_MIN_KHR :: FragmentShadingRateCombinerOpKHR |
|
| pattern FRAGMENT_SHADING_RATE_COMBINER_OP_MAX_KHR :: FragmentShadingRateCombinerOpKHR |
|
| pattern FRAGMENT_SHADING_RATE_COMBINER_OP_MUL_KHR :: FragmentShadingRateCombinerOpKHR |
|
Instances
pattern KHR_FRAGMENT_SHADING_RATE_SPEC_VERSION :: forall a. Integral a => a Source #
type KHR_FRAGMENT_SHADING_RATE_EXTENSION_NAME = "VK_KHR_fragment_shading_rate" Source #
pattern KHR_FRAGMENT_SHADING_RATE_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a Source #
newtype FormatFeatureFlagBits2KHR Source #
VkFormatFeatureFlagBits2KHR - Bitmask specifying features supported by a buffer
Description
The following bits may be set in linearTilingFeatures and
optimalTilingFeatures, specifying that the features are supported by
images or image views or
sampler Y′CBCR conversion objects
created with the queried
getPhysicalDeviceFormatProperties2::format:
FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT_KHRspecifies that an image view can be sampled from.FORMAT_FEATURE_2_STORAGE_IMAGE_BIT_KHRspecifies that an image view can be used as a storage image.FORMAT_FEATURE_2_STORAGE_IMAGE_ATOMIC_BIT_KHRspecifies that an image view can be used as storage image that supports atomic operations.FORMAT_FEATURE_2_COLOR_ATTACHMENT_BIT_KHRspecifies that an image view can be used as a framebuffer color attachment and as an input attachment.FORMAT_FEATURE_2_COLOR_ATTACHMENT_BLEND_BIT_KHRspecifies that an image view can be used as a framebuffer color attachment that supports blending and as an input attachment.FORMAT_FEATURE_2_DEPTH_STENCIL_ATTACHMENT_BIT_KHRspecifies that an image view can be used as a framebuffer depth/stencil attachment and as an input attachment.FORMAT_FEATURE_2_BLIT_SRC_BIT_KHRspecifies that an image can be used assrcImagefor thecmdBlitImage2KHRandcmdBlitImagecommands.FORMAT_FEATURE_2_BLIT_DST_BIT_KHRspecifies that an image can be used asdstImagefor thecmdBlitImage2KHRandcmdBlitImagecommands.FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_LINEAR_BIT_KHRspecifies that ifFORMAT_FEATURE_2_SAMPLED_IMAGE_BIT_KHRis also set, an image view can be used with a sampler that has either ofmagFilterorminFilterset toFILTER_LINEAR, ormipmapModeset toSAMPLER_MIPMAP_MODE_LINEAR. IfFORMAT_FEATURE_2_BLIT_SRC_BIT_KHRis also set, an image can be used as thesrcImagetocmdBlitImage2KHRandcmdBlitImagewith afilterofFILTER_LINEAR. This bit must only be exposed for formats that also support theFORMAT_FEATURE_2_SAMPLED_IMAGE_BIT_KHRorFORMAT_FEATURE_2_BLIT_SRC_BIT_KHR.If the format being queried is a depth/stencil format, this bit only specifies that the depth aspect (not the stencil aspect) of an image of this format supports linear filtering. Where depth comparison is supported it may be linear filtered whether this bit is present or not, but where this bit is not present the filtered value may be computed in an implementation-dependent manner which differs from the normal rules of linear filtering. The resulting value must be in the range [0,1] and should be proportional to, or a weighted average of, the number of comparison passes or failures.
FORMAT_FEATURE_2_TRANSFER_SRC_BIT_KHRspecifies that an image can be used as a source image for copy commands.FORMAT_FEATURE_2_TRANSFER_DST_BIT_KHRspecifies that an image can be used as a destination image for copy commands and clear commands.FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_MINMAX_BIT_KHRspecifiesImagecan be used as a sampled image with a min or maxSamplerReductionMode. This bit must only be exposed for formats that also support theFORMAT_FEATURE_2_SAMPLED_IMAGE_BIT_KHR.FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXTspecifies thatImagecan be used with a sampler that has either ofmagFilterorminFilterset toFILTER_CUBIC_EXT, or be the source image for a blit withfilterset toFILTER_CUBIC_EXT. This bit must only be exposed for formats that also support theFORMAT_FEATURE_2_SAMPLED_IMAGE_BIT_KHR. If the format being queried is a depth/stencil format, this only specifies that the depth aspect is cubic filterable.FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT_KHRspecifies that an application can define a sampler Y′CBCR conversion using this format as a source, and that an image of this format can be used with aSamplerYcbcrConversionCreateInfoxChromaOffsetand/oryChromaOffsetofCHROMA_LOCATION_MIDPOINT. Otherwise bothxChromaOffsetandyChromaOffsetmust beCHROMA_LOCATION_COSITED_EVEN. If a format does not incorporate chroma downsampling (it is not a “422” or “420” format) but the implementation supports sampler Y′CBCR conversion for this format, the implementation must setFORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT_KHR.FORMAT_FEATURE_2_COSITED_CHROMA_SAMPLES_BIT_KHRspecifies that an application can define a sampler Y′CBCR conversion using this format as a source, and that an image of this format can be used with aSamplerYcbcrConversionCreateInfoxChromaOffsetand/oryChromaOffsetofCHROMA_LOCATION_COSITED_EVEN. Otherwise bothxChromaOffsetandyChromaOffsetmust beCHROMA_LOCATION_MIDPOINT. If neitherFORMAT_FEATURE_2_COSITED_CHROMA_SAMPLES_BIT_KHRnorFORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT_KHRis set, the application must not define a sampler Y′CBCR conversion using this format as a source.FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT_KHRspecifies that an application can define a sampler Y′CBCR conversion using this format as a source withchromaFilterset toFILTER_LINEAR.FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT_KHRspecifies that the format can have different chroma, min, and mag filters.FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT_KHRspecifies that reconstruction is explicit, as described in https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#textures-chroma-reconstruction. If this bit is not present, reconstruction is implicit by default.FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT_KHRspecifies that reconstruction can be forcibly made explicit by settingSamplerYcbcrConversionCreateInfo::forceExplicitReconstructiontoTRUE. If the format being queried supportsFORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT_KHRit must also supportFORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT_KHR.FORMAT_FEATURE_2_DISJOINT_BIT_KHRspecifies that a multi-planar image can have theIMAGE_CREATE_DISJOINT_BITset during image creation. An implementation must not setFORMAT_FEATURE_2_DISJOINT_BIT_KHRfor single-plane formats.FORMAT_FEATURE_2_FRAGMENT_DENSITY_MAP_BIT_EXTspecifies that an image view can be used as a fragment density map attachment.FORMAT_FEATURE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHRspecifies that an image view can be used as a fragment shading rate attachment. An implementation must not set this feature for formats with numeric type other than*UINT, or set it as a buffer feature.FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT_KHRspecifies that image views created with this format can be used as storage images for read operations without specifying a format.FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT_KHRspecifies that image views created with this format can be used as storage images for write operations without specifying a format.FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT_KHRspecifies that image views created with this format can be used for depth comparison performed byOpImage*Drefinstructions.
The following bits may be set in bufferFeatures, specifying that the
features are supported by buffers or
buffer views created with the queried
getPhysicalDeviceFormatProperties2::format:
FORMAT_FEATURE_2_UNIFORM_TEXEL_BUFFER_BIT_KHRspecifies that the format can be used to create a buffer view that can be bound to aDESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFERdescriptor.FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_BIT_KHRspecifies that the format can be used to create a buffer view that can be bound to aDESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFERdescriptor.FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_ATOMIC_BIT_KHRspecifies that atomic operations are supported onDESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFERwith this format.FORMAT_FEATURE_2_VERTEX_BUFFER_BIT_KHRspecifies that the format can be used as a vertex attribute format (VertexInputAttributeDescription::format).FORMAT_FEATURE_2_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHRspecifies that the format can be used as the vertex format when creating an acceleration structure (AccelerationStructureGeometryTrianglesDataKHR::vertexFormat). This format can also be used as the vertex format in host memory when doing host acceleration structure builds.
See Also
Constructors
| FormatFeatureFlagBits2KHR Flags64 |
Bundled Patterns
Instances
type Flags64 = Word64 Source #
VkFlags64 - Vulkan 64-bit bitmasks
Description
When the 31 bits available in Flags are insufficient, the Flags64
type can be passed to commands and structures to represent up to 64
options. Flags64 is not used directly in the API. Instead, a
Vk*Flags2 type which is an alias of Flags64, and whose name matches
the corresponding Vk*FlagBits2 that are valid for that type, is used.
Any Vk*Flags2 member or parameter used in the API as an input must
be a valid combination of bit flags. A valid combination is either zero
or the bitwise OR of valid bit flags. A bit flag is valid if:
- The bit flag is defined as part of the
Vk*FlagBits2type, where the bits type is obtained by taking the flag type and replacing the trailingFlags2withFlagBits2. For example, a flag value of typeAccessFlags2KHRmust contain only bit flags defined byAccessFlagBits2KHR. - The flag is allowed in the context in which it is being used. For example, in some cases, certain bit flags or combinations of bit flags are mutually exclusive.
Any Vk*Flags2 member or parameter returned from a query command or
otherwise output from Vulkan to the application may contain bit flags
undefined in its corresponding Vk*FlagBits2 type. An application
cannot rely on the state of these unspecified bits.
Note
Both the Vk*FlagBits2 type, and the individual bits defined for that
type, are defined as uint64_t integers in the C API. This is in
contrast to the 32-bit types, where the Vk*FlagBits type is defined as
a C enum and the individual bits as enumerants belonging to that
enum. As a result, there is less compile-time type checking possible
for the 64-bit types. This is unavoidable since there is no sufficiently
portable way to define a 64-bit enum type in C99.