HORIZON HASKELLDocslts/ghc-9.14.x3e2d5682026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 3e2d568 · 2026-10-11

Modulevulkan-3.27GHC2021

Vulkan.Extensions.VK_HUAWEI_invocation_mask

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      or

Vulkan Version 1.3

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

  • 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

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

No cross-references are available

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.

  • 3 types
  • 1 value
  • Packagevulkan-3.27
  • Exports6
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceVK_HUAWEI_invocation_mask.hs
valuecmdBindInvocationMaskHUAWEI
  1. :: MonadIO io
  2. => CommandBuffer

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

  3. -> ImageView

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

  4. -> ImageLayout

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

  5. -> 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 QUEUE_COMPUTE_BIT 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, 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 Levels

Render Pass Scope

Video Coding Scope

Supported Queue Types

Command Type

Primary Secondary

Outside

Outside

VK_QUEUE_COMPUTE_BIT

State

Conditional Rendering

vkCmdBindInvocationMaskHUAWEI is not affected by conditional rendering

See Also

VK_HUAWEI_invocation_mask, CommandBuffer, ImageLayout, ImageView

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. If the application wishes to use a Device with any features described by PhysicalDeviceInvocationMaskFeaturesHUAWEI, it must add an instance of the structure, with the desired feature members set to TRUE, to the pNext chain of DeviceCreateInfo when creating the Device.

Structure Chaining

Extends the structures

See Also

VK_HUAWEI_invocation_mask, Bool32, StructureType

Constructors

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero