Top Description Fields Constructors Methods
org.lwjgl.vulkan

public Class HUAWEIInvocationMask

extends Object
Class Inheritance
Imports
org.lwjgl.system.*

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.
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);
VK_HUAWEI_invocation_mask
Name String
VK_HUAWEI_invocation_mask
Extension Type
Device extension
Registered Extension Number
371
Revision
1
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
Contributors
  • Yunpeng Zhu
  • Juntao Li, Huawei
  • Liang Chen, Huawei
  • Shaozhuang Shi, Huawei
  • Hailong Chu, Huawei

Field Summary

Modifier and TypeField and Description
public static final long
public static final String
public static final int
VK_HUAWEI_INVOCATION_MASK_SPEC_VERSION

The extension specification version.

public static final int
VK_IMAGE_USAGE_INVOCATION_MASK_BIT_HUAWEI

Extends VkImageUsageFlagBits.

public static final long
VK_PIPELINE_STAGE_2_INVOCATION_MASK_BIT_HUAWEI

Extends VkPipelineStageFlagBits2.

public static final int

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static void
vkCmdBindInvocationMaskHUAWEI(VkCommandBuffer
the command buffer into which the command will be recorded
commandBuffer
,
long
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.
imageView
,
int
the layout that the image subresources accessible from imageView will be in when the invocation mask image is accessed
imageLayout
)

Bind an invocation mask image on a command buffer.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

VK_ACCESS_2_INVOCATION_MASK_READ_BIT_HUAWEIback to summary
public static final long VK_ACCESS_2_INVOCATION_MASK_READ_BIT_HUAWEI

Extends VkAccessFlagBits2.

VK_HUAWEI_INVOCATION_MASK_EXTENSION_NAMEback to summary
public static final String VK_HUAWEI_INVOCATION_MASK_EXTENSION_NAME

The extension name.

VK_HUAWEI_INVOCATION_MASK_SPEC_VERSIONback to summary
public static final int VK_HUAWEI_INVOCATION_MASK_SPEC_VERSION

The extension specification version.

VK_IMAGE_USAGE_INVOCATION_MASK_BIT_HUAWEIback to summary
public static final int VK_IMAGE_USAGE_INVOCATION_MASK_BIT_HUAWEI

Extends VkImageUsageFlagBits.

VK_PIPELINE_STAGE_2_INVOCATION_MASK_BIT_HUAWEIback to summary
public static final long VK_PIPELINE_STAGE_2_INVOCATION_MASK_BIT_HUAWEI

Extends VkPipelineStageFlagBits2.

VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEIback to summary
public static final int VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI

Extends VkStructureType.

Constructor Detail

HUAWEIInvocationMaskback to summary
protected HUAWEIInvocationMask()

Method Detail

vkCmdBindInvocationMaskHUAWEIback to summary
public static void vkCmdBindInvocationMaskHUAWEI(VkCommandBuffer commandBuffer, long imageView, int imageLayout)

Bind an invocation mask image on a command buffer.

C Specification

When invocation mask image usage is enabled in the bound ray tracing pipeline, the pipeline uses an invocation mask image specified by the command:


void vkCmdBindInvocationMaskHUAWEI(
    VkCommandBuffer                             commandBuffer,
    VkImageView                                 imageView,
    VkImageLayout                               imageLayout);
Valid Usage
Valid Usage (Implicit)
  • commandBuffer must be a valid VkCommandBuffer handle
  • If imageView is not NULL_HANDLE, imageView must be a valid VkImageView handle
  • imageLayout must be a valid VkImageLayout value
  • commandBuffer must be in the recording state
  • The VkCommandPool that commandBuffer 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, and imageView that are valid handles of non-ignored parameters must have been created, allocated, or retrieved from the same VkDevice
Host Synchronization
  • Host access to commandBuffer must be externally synchronized
  • Host access to the VkCommandPool that commandBuffer was allocated from must be externally synchronized
Command Properties
Command Buffer LevelsRender Pass ScopeVideo Coding ScopeSupported Queue TypesCommand Type
Primary SecondaryOutsideOutsideComputeState
Parameters
commandBuffer:VkCommandBuffer

the command buffer into which the command will be recorded

imageView:long

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

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