Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Name
VK_HUAWEI_invocation_mask - device extension
VK_HUAWEI_invocation_mask
- Name String
VK_HUAWEI_invocation_mask
- Extension Type
- Device extension
- Registered Extension Number
- 371
- Revision
- 1
- Ratification Status
- Not ratified
- Extension and Version Dependencies
- VK_KHR_ray_tracing_pipeline and VK_KHR_synchronization2
- Contact
- Extension Proposal
- VK_HUAWEI_invocation_mask
Other Extension Metadata
- Last Modified Date
- 2021-05-27
- Interactions and External Dependencies
- This extension requires
VK_KHR_ray_tracing_pipeline
, which allow to bind an invocation mask image before the ray tracing command - This extension requires
VK_KHR_synchronization2
, which allows new pipeline stage for the invocation mask image
- This extension requires
- Contributors
- Yunpeng Zhu
- Juntao Li, Huawei
- Liang Chen, Huawei
- Shaozhuang Shi, Huawei
- Hailong Chu, Huawei
Description
The rays to trace may be sparse in some use cases. For example, the scene only have a few regions to reflect. Providing an invocation mask image to the ray tracing commands could potentially give the hardware the hint to do certain optimization without invoking an additional pass to compact the ray buffer.
New Commands
New Structures
New Enum Constants
HUAWEI_INVOCATION_MASK_SPEC_VERSION
Extending
AccessFlagBits2
:Extending
ImageUsageFlagBits
:Extending
PipelineStageFlagBits2
:Extending
StructureType
:
Examples
RT mask is updated before each traceRay.
Step 1. Generate InvocationMask.
//the rt mask image bind as color attachment in the fragment shader Layout(location = 2) out vec4 outRTmask vec4 mask = vec4(x,x,x,x); outRTmask = mask;
Step 2. traceRay with InvocationMask
vkCmdBindPipeline( commandBuffers[imageIndex], VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR, m_rtPipeline); vkCmdBindDescriptorSets(commandBuffers[imageIndex], VK_PIPELINE_BIND_POINT_RAY_TRACING_NV, m_rtPipelineLayout, 0, 1, &m_rtDescriptorSet, 0, nullptr); vkCmdBindInvocationMaskHUAWEI( commandBuffers[imageIndex], InvocationMaskimageView, InvocationMaskimageLayout); vkCmdTraceRaysKHR(commandBuffers[imageIndex], pRaygenShaderBindingTable, pMissShaderBindingTable, swapChainExtent.width, swapChainExtent.height, 1);
Version History
Revision 1, 2021-05-27 (Yunpeng Zhu)
- Initial draft.
See Also
PhysicalDeviceInvocationMaskFeaturesHUAWEI
,
cmdBindInvocationMaskHUAWEI
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
- cmdBindInvocationMaskHUAWEI :: forall io. MonadIO io => CommandBuffer -> ImageView -> ImageLayout -> io ()
- data PhysicalDeviceInvocationMaskFeaturesHUAWEI = PhysicalDeviceInvocationMaskFeaturesHUAWEI {}
- type HUAWEI_INVOCATION_MASK_SPEC_VERSION = 1
- pattern HUAWEI_INVOCATION_MASK_SPEC_VERSION :: forall a. Integral a => a
- type HUAWEI_INVOCATION_MASK_EXTENSION_NAME = "VK_HUAWEI_invocation_mask"
- pattern HUAWEI_INVOCATION_MASK_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
Documentation
cmdBindInvocationMaskHUAWEI Source #
:: forall io. MonadIO io | |
=> CommandBuffer |
|
-> ImageView |
|
-> ImageLayout |
|
-> io () |
vkCmdBindInvocationMaskHUAWEI - Bind an invocation mask image on a command buffer
Valid Usage
- The invocationMask feature must be enabled
- If
imageView
is notNULL_HANDLE
, it must be a validImageView
handle of typeIMAGE_VIEW_TYPE_2D
- If
imageView
is notNULL_HANDLE
, it must have a format ofFORMAT_R8_UINT
- If
imageView
is notNULL_HANDLE
, it must have been created withIMAGE_USAGE_INVOCATION_MASK_BIT_HUAWEI
set - If
imageView
is notNULL_HANDLE
,imageLayout
must beIMAGE_LAYOUT_GENERAL
- Thread mask image
resolution must match the
width
andheight
incmdTraceRaysKHR
- Each element in the
invocation mask image must have the value
0
or1
. The value 1 means the invocation is active -
depth
incmdTraceRaysKHR
must be 1
Valid Usage (Implicit)
-
commandBuffer
must be a validCommandBuffer
handle
- If
imageView
is notNULL_HANDLE
,imageView
must be a validImageView
handle -
imageLayout
must be a validImageLayout
value -
commandBuffer
must be in the recording state - The
CommandPool
thatcommandBuffer
was allocated from must support compute operations - This command must only be called outside of a render pass instance
- This command must only be called outside of a video coding scope
- Both of
commandBuffer
, andimageView
that are valid handles of non-ignored parameters must have been created, allocated, or retrieved from the sameDevice
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 | Outside | Outside | Compute | State |
See Also
VK_HUAWEI_invocation_mask,
CommandBuffer
,
ImageLayout
,
ImageView
data PhysicalDeviceInvocationMaskFeaturesHUAWEI Source #
VkPhysicalDeviceInvocationMaskFeaturesHUAWEI - Structure describing invocation mask features that can be supported by an implementation
Members
This structure describes the following feature:
Description
If the PhysicalDeviceInvocationMaskFeaturesHUAWEI
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. PhysicalDeviceInvocationMaskFeaturesHUAWEI
can also be
used in the pNext
chain of DeviceCreateInfo
to
selectively enable these features.
Valid Usage (Implicit)
See Also
Instances
type HUAWEI_INVOCATION_MASK_SPEC_VERSION = 1 Source #
pattern HUAWEI_INVOCATION_MASK_SPEC_VERSION :: forall a. Integral a => a Source #
type HUAWEI_INVOCATION_MASK_EXTENSION_NAME = "VK_HUAWEI_invocation_mask" Source #
pattern HUAWEI_INVOCATION_MASK_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a Source #