vulkan-3.16.1: Bindings to the Vulkan graphics API.
Safe HaskellNone
LanguageHaskell2010

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 Vulkan 1.0
  • Requires VK_KHR_ray_tracing_pipeline
  • Requires 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
Contributors
  • Yunpeng Zhu, 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

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

Documentation

cmdBindInvocationMaskHUAWEI Source #

Arguments

:: forall io. MonadIO io 
=> CommandBuffer

commandBuffer is the command buffer into which the command will be recorded

-> ImageView

imageView is an image view handle specifying the invocation mask image imageView may be set to NULL_HANDLE, which is equivalent to specifying a view of an image filled with ones value.

-> ImageLayout

imageLayout is the layout that the image subresources accessible from imageView will be in when the invocation mask image is accessed

-> io () 

vkCmdBindInvocationMaskHUAWEI - Bind an invocation mask image on a command buffer

Valid Usage

Valid Usage (Implicit)

  • If imageView is not NULL_HANDLE, imageView must be a valid ImageView handle
  • imageLayout must be a valid ImageLayout value
  • commandBuffer must be in the recording state
  • The CommandPool that commandBuffer was allocated from must support compute operations
  • This command must only be called outside of a render pass instance
  • Both of commandBuffer, and imageView that are valid handles of non-ignored parameters must have been created, allocated, or retrieved from the same Device

Host Synchronization

  • Host access to commandBuffer must be externally synchronized
  • Host access to the CommandPool that commandBuffer was allocated from must be externally synchronized

Command Properties

'

Command Buffer LevelsRender Pass ScopeSupported Queue Types
Primary SecondaryOutside Compute

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 features:

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

VK_HUAWEI_invocation_mask, Bool32, StructureType

Constructors

PhysicalDeviceInvocationMaskFeaturesHUAWEI 

Fields

  • invocationMask :: Bool

    invocationMask indicates that the implementation supports the use of an invocation mask image to optimize the ray dispatch.

Instances

Instances details
Eq PhysicalDeviceInvocationMaskFeaturesHUAWEI Source # 
Instance details

Defined in Vulkan.Extensions.VK_HUAWEI_invocation_mask

Show PhysicalDeviceInvocationMaskFeaturesHUAWEI Source # 
Instance details

Defined in Vulkan.Extensions.VK_HUAWEI_invocation_mask

Storable PhysicalDeviceInvocationMaskFeaturesHUAWEI Source # 
Instance details

Defined in Vulkan.Extensions.VK_HUAWEI_invocation_mask

FromCStruct PhysicalDeviceInvocationMaskFeaturesHUAWEI Source # 
Instance details

Defined in Vulkan.Extensions.VK_HUAWEI_invocation_mask

ToCStruct PhysicalDeviceInvocationMaskFeaturesHUAWEI Source # 
Instance details

Defined in Vulkan.Extensions.VK_HUAWEI_invocation_mask

Zero PhysicalDeviceInvocationMaskFeaturesHUAWEI Source # 
Instance details

Defined in Vulkan.Extensions.VK_HUAWEI_invocation_mask

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 #