Safe Haskell | None |
---|---|
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
- 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
- This extension requires
- 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
HUAWEI_INVOCATION_MASK_SPEC_VERSION
Extending
AccessFlagBits2KHR
:Extending
ImageUsageFlagBits
:Extending
PipelineStageFlagBits2KHR
: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
- newtype AccessFlagBits2KHR where
- AccessFlagBits2KHR Flags64
- pattern ACCESS_2_NONE_KHR :: AccessFlagBits2KHR
- pattern ACCESS_2_INDIRECT_COMMAND_READ_BIT_KHR :: AccessFlagBits2KHR
- pattern ACCESS_2_INDEX_READ_BIT_KHR :: AccessFlagBits2KHR
- pattern ACCESS_2_VERTEX_ATTRIBUTE_READ_BIT_KHR :: AccessFlagBits2KHR
- pattern ACCESS_2_UNIFORM_READ_BIT_KHR :: AccessFlagBits2KHR
- pattern ACCESS_2_INPUT_ATTACHMENT_READ_BIT_KHR :: AccessFlagBits2KHR
- pattern ACCESS_2_SHADER_READ_BIT_KHR :: AccessFlagBits2KHR
- pattern ACCESS_2_SHADER_WRITE_BIT_KHR :: AccessFlagBits2KHR
- pattern ACCESS_2_COLOR_ATTACHMENT_READ_BIT_KHR :: AccessFlagBits2KHR
- pattern ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT_KHR :: AccessFlagBits2KHR
- pattern ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT_KHR :: AccessFlagBits2KHR
- pattern ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT_KHR :: AccessFlagBits2KHR
- pattern ACCESS_2_TRANSFER_READ_BIT_KHR :: AccessFlagBits2KHR
- pattern ACCESS_2_TRANSFER_WRITE_BIT_KHR :: AccessFlagBits2KHR
- pattern ACCESS_2_HOST_READ_BIT_KHR :: AccessFlagBits2KHR
- pattern ACCESS_2_HOST_WRITE_BIT_KHR :: AccessFlagBits2KHR
- pattern ACCESS_2_MEMORY_READ_BIT_KHR :: AccessFlagBits2KHR
- pattern ACCESS_2_MEMORY_WRITE_BIT_KHR :: AccessFlagBits2KHR
- pattern ACCESS_2_SHADER_SAMPLED_READ_BIT_KHR :: AccessFlagBits2KHR
- pattern ACCESS_2_SHADER_STORAGE_READ_BIT_KHR :: AccessFlagBits2KHR
- pattern ACCESS_2_SHADER_STORAGE_WRITE_BIT_KHR :: AccessFlagBits2KHR
- pattern ACCESS_2_INVOCATION_MASK_READ_BIT_HUAWEI :: AccessFlagBits2KHR
- pattern ACCESS_2_COLOR_ATTACHMENT_READ_NONCOHERENT_BIT_EXT :: AccessFlagBits2KHR
- pattern ACCESS_2_FRAGMENT_DENSITY_MAP_READ_BIT_EXT :: AccessFlagBits2KHR
- pattern ACCESS_2_ACCELERATION_STRUCTURE_WRITE_BIT_KHR :: AccessFlagBits2KHR
- pattern ACCESS_2_ACCELERATION_STRUCTURE_READ_BIT_KHR :: AccessFlagBits2KHR
- pattern ACCESS_2_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR :: AccessFlagBits2KHR
- pattern ACCESS_2_COMMAND_PREPROCESS_WRITE_BIT_NV :: AccessFlagBits2KHR
- pattern ACCESS_2_COMMAND_PREPROCESS_READ_BIT_NV :: AccessFlagBits2KHR
- pattern ACCESS_2_CONDITIONAL_RENDERING_READ_BIT_EXT :: AccessFlagBits2KHR
- pattern ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT :: AccessFlagBits2KHR
- pattern ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT :: AccessFlagBits2KHR
- pattern ACCESS_2_TRANSFORM_FEEDBACK_WRITE_BIT_EXT :: AccessFlagBits2KHR
- type AccessFlags2KHR = AccessFlagBits2KHR
- newtype PipelineStageFlagBits2KHR where
- PipelineStageFlagBits2KHR Flags64
- pattern PIPELINE_STAGE_2_NONE_KHR :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_TOP_OF_PIPE_BIT_KHR :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_DRAW_INDIRECT_BIT_KHR :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_VERTEX_INPUT_BIT_KHR :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_VERTEX_SHADER_BIT_KHR :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_TESSELLATION_CONTROL_SHADER_BIT_KHR :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_TESSELLATION_EVALUATION_SHADER_BIT_KHR :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_GEOMETRY_SHADER_BIT_KHR :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT_KHR :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT_KHR :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT_KHR :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT_KHR :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_COMPUTE_SHADER_BIT_KHR :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_ALL_TRANSFER_BIT_KHR :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_BOTTOM_OF_PIPE_BIT_KHR :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_HOST_BIT_KHR :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_ALL_GRAPHICS_BIT_KHR :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_ALL_COMMANDS_BIT_KHR :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_COPY_BIT_KHR :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_RESOLVE_BIT_KHR :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_BLIT_BIT_KHR :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_CLEAR_BIT_KHR :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_INDEX_INPUT_BIT_KHR :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_VERTEX_ATTRIBUTE_INPUT_BIT_KHR :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_PRE_RASTERIZATION_SHADERS_BIT_KHR :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_INVOCATION_MASK_BIT_HUAWEI :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_SUBPASS_SHADING_BIT_HUAWEI :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_MESH_SHADER_BIT_NV :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_TASK_SHADER_BIT_NV :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_FRAGMENT_DENSITY_PROCESS_BIT_EXT :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_RAY_TRACING_SHADER_BIT_KHR :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_BUILD_BIT_KHR :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_COMMAND_PREPROCESS_BIT_NV :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_CONDITIONAL_RENDERING_BIT_EXT :: PipelineStageFlagBits2KHR
- pattern PIPELINE_STAGE_2_TRANSFORM_FEEDBACK_BIT_EXT :: PipelineStageFlagBits2KHR
- type PipelineStageFlags2KHR = PipelineStageFlagBits2KHR
- type Flags64 = Word64
Documentation
cmdBindInvocationMaskHUAWEI Source #
:: forall io. MonadIO io | |
=> CommandBuffer |
|
-> ImageView |
|
-> ImageLayout |
|
-> io () |
vkCmdBindInvocationMaskHUAWEI - Bind an invocation mask image on a command buffer
Valid Usage
- The invocation mask image 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 -
width
incmdTraceRaysKHR
should 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
- 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 | Supported Queue Types |
---|---|---|
Primary Secondary | Outside | 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
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 #
newtype AccessFlagBits2KHR Source #
VkAccessFlagBits2KHR - Access flags for VkAccessFlags2KHR
Description
Note
In situations where an application wishes to select all access types for
a given set of pipeline stages, ACCESS_2_MEMORY_READ_BIT_KHR
or
ACCESS_2_MEMORY_WRITE_BIT_KHR
can be used. This is particularly useful
when specifying stages that only have a single access type.
Note
The AccessFlags2KHR
bitmask goes beyond the 31 individual bit flags
allowable within a C99 enum, which is how
AccessFlagBits
is defined. The
first 31 values are common to both, and are interchangeable.
See Also
Instances
type AccessFlags2KHR = AccessFlagBits2KHR Source #
newtype PipelineStageFlagBits2KHR Source #
VkPipelineStageFlagBits2KHR - Pipeline stage flags for VkPipelineStageFlags2KHR
Description
Note
The TOP
and BOTTOM
pipeline stages are deprecated, and applications
should prefer PIPELINE_STAGE_2_ALL_COMMANDS_BIT_KHR
and
PIPELINE_STAGE_2_NONE_KHR
.
Note
The PipelineStageFlags2KHR
bitmask goes beyond the 31 individual bit
flags allowable within a C99 enum, which is how
PipelineStageFlagBits
is
defined. The first 31 values are common to both, and are
interchangeable.
See Also
Instances
type Flags64 = Word64 Source #
VkFlags64 - Vulkan 64-bit bitmasks
Description
When the 31 bits available in Flags
are insufficient, the Flags64
type can be passed to commands and structures to represent up to 64
options. Flags64
is not used directly in the API. Instead, a
Vk*Flags2
type which is an alias of Flags64
, and whose name matches
the corresponding Vk*FlagBits2
that are valid for that type, is used.
Any Vk*Flags2
member or parameter used in the API as an input must
be a valid combination of bit flags. A valid combination is either zero
or the bitwise OR of valid bit flags. A bit flag is valid if:
- The bit flag is defined as part of the
Vk*FlagBits2
type, where the bits type is obtained by taking the flag type and replacing the trailingFlags2
withFlagBits2
. For example, a flag value of typeAccessFlags2KHR
must contain only bit flags defined byAccessFlagBits2KHR
. - The flag is allowed in the context in which it is being used. For example, in some cases, certain bit flags or combinations of bit flags are mutually exclusive.
Any Vk*Flags2
member or parameter returned from a query command or
otherwise output from Vulkan to the application may contain bit flags
undefined in its corresponding Vk*FlagBits2
type. An application
cannot rely on the state of these unspecified bits.
Note
Both the Vk*FlagBits2
type, and the individual bits defined for that
type, are defined as uint64_t
integers in the C API. This is in
contrast to the 32-bit types, where the Vk*FlagBits
type is defined as
a C enum
and the individual bits as enumerants belonging to that
enum
. As a result, there is less compile-time type checking possible
for the 64-bit types. This is unavoidable since there is no sufficiently
portable way to define a 64-bit enum
type in C99.