| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Vulkan.Extensions.VK_HUAWEI_invocation_mask
Description
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
- Extension and Version Dependencies
- Requires support for Vulkan 1.0
- Requires
VK_KHR_ray_tracing_pipelineto be enabled for any device-level functionality - Requires
VK_KHR_synchronization2to be enabled for any device-level functionality
- 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_VERSIONExtending
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 #
Arguments
| :: 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
imageViewis notNULL_HANDLE, it must be a validImageViewhandle of typeIMAGE_VIEW_TYPE_2D - If
imageViewis notNULL_HANDLE, it must have a format ofFORMAT_R8_UINT - If
imageViewis notNULL_HANDLE, it must have been created withIMAGE_USAGE_INVOCATION_MASK_BIT_HUAWEIset - If
imageViewis notNULL_HANDLE,imageLayoutmust beIMAGE_LAYOUT_GENERAL - Thread mask image
resolution must match the
widthandheightincmdTraceRaysKHR - Each element in the
invocation mask image must have the value
0or1. The value 1 means the invocation is active -
widthincmdTraceRaysKHRshould be 1
Valid Usage (Implicit)
-
commandBuffermust be a validCommandBufferhandle
- If
imageViewis notNULL_HANDLE,imageViewmust be a validImageViewhandle -
imageLayoutmust be a validImageLayoutvalue -
commandBuffermust be in the recording state - The
CommandPoolthatcommandBufferwas 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, andimageViewthat are valid handles of non-ignored parameters must have been created, allocated, or retrieved from the sameDevice
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 | 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
Constructors
| PhysicalDeviceInvocationMaskFeaturesHUAWEI | |
Fields | |
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 #