Safe Haskell | None |
---|---|
Language | Haskell2010 |
Name
VK_NV_fragment_shading_rate_enums - device extension
VK_NV_fragment_shading_rate_enums
- Name String
VK_NV_fragment_shading_rate_enums
- Extension Type
- Device extension
- Registered Extension Number
- 327
- Revision
- 1
- Extension and Version Dependencies
- Requires Vulkan 1.0
- Requires
VK_KHR_fragment_shading_rate
- Contact
Other Extension Metadata
- Last Modified Date
- 2020-09-02
- Contributors
- Pat Brown, NVIDIA
- Jeff Bolz, NVIDIA
Description
This extension builds on the fragment shading rate functionality provided by the VK_KHR_fragment_shading_rate extension, adding support for "supersample" fragment shading rates that trigger multiple fragment shader invocations per pixel as well as a "no invocations" shading rate that discards any portions of a primitive that would use that shading rate.
New Commands
New Structures
Extending
PhysicalDeviceFeatures2
,DeviceCreateInfo
:Extending
PhysicalDeviceProperties2
:
New Enums
New Enum Constants
Issues
Why was this extension created? How should it be named?
RESOLVED: The primary goal of this extension was to expose support for supersample and "no invocations" shading rates, which are supported by the VK_NV_shading_rate_image extension but not by VK_KHR_fragment_shading_rate. Because VK_KHR_fragment_shading_rate specifies the primitive shading rate using a fragment size in pixels, it lacks a good way to specify supersample rates. To deal with this, we defined enums covering shading rates supported by the KHR extension as well as the new shading rates and added structures and APIs accepting shading rate enums instead of fragment sizes.
Since this extension adds two different types of shading rates, both expressed using enums, we chose the extension name VK_NV_fragment_shading_rate_enums.
Is this a standalone extension?
RESOLVED: No, this extension requires VK_KHR_fragment_shading_rate. In order to use the features of this extension, applications must enable the relevant features of KHR extension.
How are the shading rate enums used, and how were the enum values assigned?
RESOLVED: The shading rates supported by the enums in this extension are accepted as pipeline, primitive, and attachment shading rates and behave identically. For the shading rates also supported by the KHR extension, the values assigned to the corresponding enums are identical to the values already used for the primitive and attachment shading rates in the KHR extension. For those enums, bits 0 and 1 specify the base two logarithm of the fragment height and bits 2 and 3 specify the base two logarithm of the fragment width. For the new shading rates added by this extension, we chose to use 11 through 14 (10 plus the base two logarithm of the invocation count) for the supersample rates and 15 for the "no invocations" rate. None of those values are supported as primitive or attachment shading rates by the KHR extension.
Between this extension, VK_KHR_fragment_shading_rate, and VK_NV_shading_rate_image, there are three different ways to specify shading rate state in a pipeline. How should we handle this?
RESOLVED: We don’t allow the concurrent use of VK_NV_shading_rate_image and VK_KHR_fragment_shading_rate; it is an error to enable shading rate features from both extensions. But we do allow applications to enable this extension together with VK_KHR_fragment_shading_rate together. While we expect that applications will never attach pipeline CreateInfo structures for both this extension and the KHR extension concurrently, Vulkan doesn’t have any precedent forbidding such behavior and instead typically treats a pipeline created without an extension-specific CreateInfo structure as equivalent to one containing default values specified by the extension. Rather than adding such a rule considering the presence or absence of our new CreateInfo structure, we instead included a
shadingRateType
member toPipelineFragmentShadingRateEnumStateCreateInfoNV
that selects between using state specified by that structure and state specified byPipelineFragmentShadingRateStateCreateInfoKHR
.
Version History
Revision 1, 2020-09-02 (pbrown)
- Internal revisions
See Also
FragmentShadingRateNV
, FragmentShadingRateTypeNV
,
PhysicalDeviceFragmentShadingRateEnumsFeaturesNV
,
PhysicalDeviceFragmentShadingRateEnumsPropertiesNV
,
PipelineFragmentShadingRateEnumStateCreateInfoNV
,
cmdSetFragmentShadingRateEnumNV
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
- cmdSetFragmentShadingRateEnumNV :: forall io. MonadIO io => CommandBuffer -> FragmentShadingRateNV -> ("combinerOps" ::: (FragmentShadingRateCombinerOpKHR, FragmentShadingRateCombinerOpKHR)) -> io ()
- data PhysicalDeviceFragmentShadingRateEnumsFeaturesNV = PhysicalDeviceFragmentShadingRateEnumsFeaturesNV {}
- data PhysicalDeviceFragmentShadingRateEnumsPropertiesNV = PhysicalDeviceFragmentShadingRateEnumsPropertiesNV {}
- data PipelineFragmentShadingRateEnumStateCreateInfoNV = PipelineFragmentShadingRateEnumStateCreateInfoNV {}
- newtype FragmentShadingRateNV where
- FragmentShadingRateNV Int32
- pattern FRAGMENT_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV :: FragmentShadingRateNV
- pattern FRAGMENT_SHADING_RATE_1_INVOCATION_PER_1X2_PIXELS_NV :: FragmentShadingRateNV
- pattern FRAGMENT_SHADING_RATE_1_INVOCATION_PER_2X1_PIXELS_NV :: FragmentShadingRateNV
- pattern FRAGMENT_SHADING_RATE_1_INVOCATION_PER_2X2_PIXELS_NV :: FragmentShadingRateNV
- pattern FRAGMENT_SHADING_RATE_1_INVOCATION_PER_2X4_PIXELS_NV :: FragmentShadingRateNV
- pattern FRAGMENT_SHADING_RATE_1_INVOCATION_PER_4X2_PIXELS_NV :: FragmentShadingRateNV
- pattern FRAGMENT_SHADING_RATE_1_INVOCATION_PER_4X4_PIXELS_NV :: FragmentShadingRateNV
- pattern FRAGMENT_SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV :: FragmentShadingRateNV
- pattern FRAGMENT_SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV :: FragmentShadingRateNV
- pattern FRAGMENT_SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV :: FragmentShadingRateNV
- pattern FRAGMENT_SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV :: FragmentShadingRateNV
- pattern FRAGMENT_SHADING_RATE_NO_INVOCATIONS_NV :: FragmentShadingRateNV
- newtype FragmentShadingRateTypeNV where
- type NV_FRAGMENT_SHADING_RATE_ENUMS_SPEC_VERSION = 1
- pattern NV_FRAGMENT_SHADING_RATE_ENUMS_SPEC_VERSION :: forall a. Integral a => a
- type NV_FRAGMENT_SHADING_RATE_ENUMS_EXTENSION_NAME = "VK_NV_fragment_shading_rate_enums"
- pattern NV_FRAGMENT_SHADING_RATE_ENUMS_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
- 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
Documentation
cmdSetFragmentShadingRateEnumNV Source #
:: forall io. MonadIO io | |
=> CommandBuffer |
|
-> FragmentShadingRateNV |
|
-> ("combinerOps" ::: (FragmentShadingRateCombinerOpKHR, FragmentShadingRateCombinerOpKHR)) |
|
-> io () |
vkCmdSetFragmentShadingRateEnumNV - Set pipeline fragment shading rate dynamically using enums
Valid Usage
-
If
pipelineFragmentShadingRate
is not enabled,
shadingRate
must beFRAGMENT_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV
-
If
supersampleFragmentShadingRates
is not enabled,
shadingRate
must not beFRAGMENT_SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV
,FRAGMENT_SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV
,FRAGMENT_SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV
, orFRAGMENT_SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV
-
If
noInvocationFragmentShadingRates
is not enabled,
shadingRate
must not beFRAGMENT_SHADING_RATE_NO_INVOCATIONS_NV
- fragmentShadingRateEnums must be enabled
- 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
combinerOps
must be eitherFRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR
orFRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_KHR
Valid Usage (Implicit)
-
commandBuffer
must be a validCommandBuffer
handle
-
shadingRate
must be a validFragmentShadingRateNV
value - Any
given element of
combinerOps
must be a validFragmentShadingRateCombinerOpKHR
value -
commandBuffer
must be in the recording state - The
CommandPool
thatcommandBuffer
was allocated from must support graphics operations
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 | Supported Queue Types | Pipeline Type |
---|---|---|---|
Primary Secondary | Both | Graphics |
See Also
CommandBuffer
,
FragmentShadingRateCombinerOpKHR
,
FragmentShadingRateNV
data PhysicalDeviceFragmentShadingRateEnumsFeaturesNV Source #
VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV - Structure indicating support for fragment shading rate enums
Members
The members of the PhysicalDeviceFragmentShadingRateEnumsFeaturesNV
structure describe the following features:
Description
If the PhysicalDeviceFragmentShadingRateEnumsFeaturesNV
structure is
included in the pNext
chain of
PhysicalDeviceFeatures2
,
it is filled with values indicating whether each feature is supported.
PhysicalDeviceFragmentShadingRateEnumsFeaturesNV
can also be used in
the pNext
chain of DeviceCreateInfo
to enable
these features.
Valid Usage (Implicit)
See Also
PhysicalDeviceFragmentShadingRateEnumsFeaturesNV | |
|
Instances
data PhysicalDeviceFragmentShadingRateEnumsPropertiesNV Source #
VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV - Structure describing fragment shading rate limits that can be supported by an implementation
Members
The members of the PhysicalDeviceFragmentShadingRateEnumsPropertiesNV
structure describe the following implementation-dependent properties
related to
fragment shading rates:
Description
If the PhysicalDeviceFragmentShadingRateEnumsPropertiesNV
structure is
included in the pNext
chain of
PhysicalDeviceProperties2
,
it is filled with the implementation-dependent limits.
Valid Usage (Implicit)
See Also
PhysicalDeviceFragmentShadingRateEnumsPropertiesNV | |
|
Instances
data PipelineFragmentShadingRateEnumStateCreateInfoNV Source #
VkPipelineFragmentShadingRateEnumStateCreateInfoNV - Structure specifying parameters controlling the fragment shading rate using rate enums
Description
If the pNext
chain of
GraphicsPipelineCreateInfo
includes a
PipelineFragmentShadingRateEnumStateCreateInfoNV
structure, then that
structure includes parameters that control the pipeline fragment shading
rate.
If this structure is not present, shadingRateType
is considered to be
equal to FRAGMENT_SHADING_RATE_TYPE_FRAGMENT_SIZE_NV
, shadingRate
is
considered to be equal to
FRAGMENT_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV
, and both elements of
combinerOps
are considered to be equal to
FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR
.
Valid Usage (Implicit)
-
shadingRateType
must be a validFragmentShadingRateTypeNV
value -
shadingRate
must be a validFragmentShadingRateNV
value -
Any given element of
combinerOps
must be a validFragmentShadingRateCombinerOpKHR
value
See Also
FragmentShadingRateCombinerOpKHR
,
FragmentShadingRateNV
, FragmentShadingRateTypeNV
,
StructureType
PipelineFragmentShadingRateEnumStateCreateInfoNV | |
|
Instances
newtype FragmentShadingRateNV Source #
VkFragmentShadingRateNV - Enumeration with fragment shading rates
Description
To use the shading rates
FRAGMENT_SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV
,
FRAGMENT_SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV
,
FRAGMENT_SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV
, and
FRAGMENT_SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV
as a pipeline,
primitive, or attachment shading rate, the
supersampleFragmentShadingRates
feature must be enabled. To use the
shading rate FRAGMENT_SHADING_RATE_NO_INVOCATIONS_NV
as a pipeline,
primitive, or attachment shading rate, the
noInvocationFragmentShadingRates
feature must be enabled.
See Also
PipelineFragmentShadingRateEnumStateCreateInfoNV
,
cmdSetFragmentShadingRateEnumNV
Instances
newtype FragmentShadingRateTypeNV Source #
VkFragmentShadingRateTypeNV - Enumeration with fragment shading rate types
See Also
pattern FRAGMENT_SHADING_RATE_TYPE_FRAGMENT_SIZE_NV :: FragmentShadingRateTypeNV |
|
pattern FRAGMENT_SHADING_RATE_TYPE_ENUMS_NV :: FragmentShadingRateTypeNV |
|
Instances
pattern NV_FRAGMENT_SHADING_RATE_ENUMS_SPEC_VERSION :: forall a. Integral a => a Source #
type NV_FRAGMENT_SHADING_RATE_ENUMS_EXTENSION_NAME = "VK_NV_fragment_shading_rate_enums" Source #
pattern NV_FRAGMENT_SHADING_RATE_ENUMS_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a Source #
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
PipelineFragmentShadingRateEnumStateCreateInfoNV
,
PipelineFragmentShadingRateStateCreateInfoKHR
,
cmdSetFragmentShadingRateEnumNV
,
cmdSetFragmentShadingRateKHR
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 |
|