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_NV_ray_tracing

Name

VK_NV_ray_tracing - device extension

VK_NV_ray_tracing

Name String

VK_NV_ray_tracing

Extension Type

Device extension

Registered Extension Number

166

Revision

3

Ratification Status

Not ratified

Extension and Version Dependencies

VK_KHR_get_physical_device_properties2      and

VK_KHR_get_memory_requirements2 or Vulkan Version 1.1

API Interactions
  • Interacts with VK_VERSION_1_1

  • Interacts with VK_EXT_debug_report

  • Interacts with VK_KHR_get_memory_requirements2

SPIR-V Dependencies
Deprecation State
Contact

Other Extension Metadata

Last Modified Date

2018-11-20

Interactions and External Dependencies
Contributors
  • Eric Werness, NVIDIA

  • Ashwin Lele, NVIDIA

  • Robert Stepinski, NVIDIA

  • Nuno Subtil, NVIDIA

  • Christoph Kubisch, NVIDIA

  • Martin Stich, NVIDIA

  • Daniel Koch, NVIDIA

  • Jeff Bolz, NVIDIA

  • Joshua Barczak, Intel

  • Tobias Hector, AMD

  • Henrik Rydgard, NVIDIA

  • Pascal Gautron, NVIDIA

Description

Rasterization has been the dominant method to produce interactive graphics, but increasing performance of graphics hardware has made ray tracing a viable option for interactive rendering. Being able to integrate ray tracing with traditional rasterization makes it easier for applications to incrementally add ray traced effects to existing applications or to do hybrid approaches with rasterization for primary visibility and ray tracing for secondary queries.

To enable ray tracing, this extension adds a few different categories of new functionality:

  • Acceleration structure objects and build commands

  • A new pipeline type with new shader domains

  • An indirection table to link shader groups with acceleration structure items

This extension adds support for the following SPIR-V extension in Vulkan:

  • SPV_NV_ray_tracing

New Object Types

New Commands

New Structures

If VK_KHR_get_memory_requirements2 or Vulkan Version 1.1 is supported:

New Enums

New Bitmasks

New Enum Constants

If VK_EXT_debug_report is supported:

New or Modified Built-In Variables

New SPIR-V Capabilities

Issues

1) Are there issues?

RESOLVED: Yes.

Sample Code

Example ray generation GLSL shader

#version 450 core
#extension GL_NV_ray_tracing : require
layout(set = 0, binding = 0, rgba8) uniform image2D image;
layout(set = 0, binding = 1) uniform accelerationStructureNV as;
layout(location = 0) rayPayloadNV float payload;

void main()
{
   vec4 col = vec4(0, 0, 0, 1);

   vec3 origin = vec3(float(gl_LaunchIDNV.x)/float(gl_LaunchSizeNV.x), float(gl_LaunchIDNV.y)/float(gl_LaunchSizeNV.y), 1.0);
   vec3 dir = vec3(0.0, 0.0, -1.0);

   traceNV(as, 0, 0xff, 0, 1, 0, origin, 0.0, dir, 1000.0, 0);

   col.y = payload;

   imageStore(image, ivec2(gl_LaunchIDNV.xy), col);
}

Version History

  • Revision 1, 2018-09-11 (Robert Stepinski, Nuno Subtil, Eric Werness)

    • Internal revisions

  • Revision 2, 2018-10-19 (Eric Werness)

    • rename to VK_NV_ray_tracing, add support for callables.

    • too many updates to list

  • Revision 3, 2018-11-20 (Daniel Koch)

    • update to use InstanceId instead of InstanceIndex as implemented.

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.

  • 45 types
  • 15 values
  • Packagevulkan-3.27
  • Exports180
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceVK_NV_ray_tracing.hs
valuecompileDeferredNV
  1. :: MonadIO io
  2. => Device

    device is the logical device containing the ray tracing pipeline.

    device must be a valid Device handle

  3. -> Pipeline

    pipeline is the ray tracing pipeline object containing the shaders.

    pipeline must be a ray tracing pipeline

    pipeline must have been created with PIPELINE_CREATE_DEFER_COMPILE_BIT_NV

    pipeline must be a valid Pipeline handle

    pipeline must have been created, allocated, or retrieved from device

  4. -> "shader" ::: Word32

    shader is the index of the shader to compile.

    shader must not have been called as a deferred compile before

  5. -> io ()
#
valuecreateAccelerationStructureNV
  1. :: (Extendss AccelerationStructureCreateInfoNV a, PokeChain a, MonadIO io)
  2. => Device

    device is the logical device that creates the buffer object.

  3. -> AccelerationStructureCreateInfoNV a

    pCreateInfo is a pointer to a AccelerationStructureCreateInfoNV structure containing parameters affecting creation of the acceleration structure.

  4. -> "allocator" ::: Maybe AllocationCallbacks

    pAllocator controls host memory allocation as described in the Memory Allocation chapter.

  5. -> io AccelerationStructureNV
#

vkCreateAccelerationStructureNV - Create a new acceleration structure object

Description

Similarly to other objects in Vulkan, the acceleration structure creation merely creates an object with a specific “shape” as specified by the information in AccelerationStructureInfoNV and compactedSize in pCreateInfo.

Once memory has been bound to the acceleration structure using bindAccelerationStructureMemoryNV, that memory is populated by calls to cmdBuildAccelerationStructureNV and cmdCopyAccelerationStructureNV.

Acceleration structure creation uses the count and type information from the geometries, but does not use the data references in the structures.

Valid Usage (Implicit)

  • device must be a valid Device handle

Return Codes

Success
Failure

See Also

VK_NV_ray_tracing, AccelerationStructureCreateInfoNV, AccelerationStructureNV, AllocationCallbacks, Device

A convenience wrapper to make a compatible pair of calls to createAccelerationStructureNV and destroyAccelerationStructureNV

To ensure that destroyAccelerationStructureNV is always called: pass bracket (or the allocate function from your favourite resource management library) as the last argument. To just extract the pair pass (,) as the last argument.

valuedestroyAccelerationStructureNV
  1. :: MonadIO io
  2. => Device

    device is the logical device that destroys the buffer.

  3. -> AccelerationStructureNV

    accelerationStructure is the acceleration structure to destroy.

  4. -> "allocator" ::: Maybe AllocationCallbacks

    pAllocator controls host memory allocation as described in the Memory Allocation chapter.

  5. -> io ()
#

vkDestroyAccelerationStructureNV - Destroy an acceleration structure object

Valid Usage

  • All submitted commands that refer to accelerationStructure must have completed execution

  • If AllocationCallbacks were provided when accelerationStructure was created, a compatible set of callbacks must be provided here

  • If no AllocationCallbacks were provided when accelerationStructure was created, pAllocator must be NULL

Valid Usage (Implicit)

  • device must be a valid Device handle

  • If accelerationStructure is not NULL_HANDLE, accelerationStructure must be a valid AccelerationStructureNV handle

  • If pAllocator is not NULL, pAllocator must be a valid pointer to a valid AllocationCallbacks structure

  • If accelerationStructure is a valid handle, it must have been created, allocated, or retrieved from device

Host Synchronization

  • Host access to accelerationStructure must be externally synchronized

See Also

VK_NV_ray_tracing, AccelerationStructureNV, AllocationCallbacks, Device

valuegetAccelerationStructureMemoryRequirementsNV
  1. :: (Extendss MemoryRequirements2 a, PokeChain a, PeekChain a, MonadIO io)
  2. => Device

    device is the logical device on which the acceleration structure was created.

    device must be a valid Device handle

  3. -> AccelerationStructureMemoryRequirementsInfoNV

    pInfo is a pointer to a AccelerationStructureMemoryRequirementsInfoNV structure specifying the acceleration structure to get memory requirements for.

    pInfo must be a valid pointer to a valid AccelerationStructureMemoryRequirementsInfoNV structure

  4. -> io (MemoryRequirements2 a)
#

vkGetAccelerationStructureMemoryRequirementsNV - Get acceleration structure memory requirements

Valid Usage (Implicit)

See Also

VK_NV_ray_tracing, AccelerationStructureMemoryRequirementsInfoNV, Device, MemoryRequirements2

valuebindAccelerationStructureMemoryNV
  1. :: MonadIO io
  2. => Device

    device is the logical device that owns the acceleration structures and memory.

    device must be a valid Device handle

  3. -> "bindInfos" ::: Vector BindAccelerationStructureMemoryInfoNV

    pBindInfos is a pointer to an array of BindAccelerationStructureMemoryInfoNV structures describing acceleration structures and memory to bind.

    pBindInfos must be a valid pointer to an array of bindInfoCount valid BindAccelerationStructureMemoryInfoNV structures

  4. -> io ()
#
valuecmdCopyAccelerationStructureNV
  1. :: MonadIO io
  2. => CommandBuffer

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

  3. -> "dst" ::: AccelerationStructureNV

    dst is the target acceleration structure for the copy.

  4. -> "src" ::: AccelerationStructureNV

    src is the source acceleration structure for the copy.

  5. -> CopyAccelerationStructureModeKHR

    mode is a CopyAccelerationStructureModeKHR value specifying additional operations to perform during the copy.

  6. -> io ()
#

vkCmdCopyAccelerationStructureNV - Copy an acceleration structure

Description

Accesses to src and dst must be synchronized with the PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_COPY_BIT_KHR pipeline stage or the PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR pipeline stage, and an access type of ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR or ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR as appropriate.

Valid Usage

Valid Usage (Implicit)

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

Action

Conditional Rendering

vkCmdCopyAccelerationStructureNV is not affected by conditional rendering

See Also

VK_NV_ray_tracing, AccelerationStructureNV, CommandBuffer, CopyAccelerationStructureModeKHR

valuecmdWriteAccelerationStructuresPropertiesNV
  1. :: MonadIO io
  2. => CommandBuffer

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

  3. -> "accelerationStructures" ::: Vector AccelerationStructureNV

    pAccelerationStructures is a pointer to an array of existing previously built acceleration structures.

  4. -> QueryType

    queryType is a QueryType value specifying the type of queries managed by the pool.

  5. -> QueryPool

    queryPool is the query pool that will manage the results of the query.

  6. -> "firstQuery" ::: Word32

    firstQuery is the first query index within the query pool that will contain the accelerationStructureCount number of results.

  7. -> io ()
#

vkCmdWriteAccelerationStructuresPropertiesNV - Write acceleration structure result parameters to query results.

Description

Accesses to any of the acceleration structures listed in pAccelerationStructures must be synchronized with the PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR pipeline stage and an access type of ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR.

Valid Usage

  • queryPool must have been created with a queryType matching queryType

Valid Usage (Implicit)

  • pAccelerationStructures must be a valid pointer to an array of accelerationStructureCount valid AccelerationStructureNV handles

  • queryType must be a valid QueryType value

  • queryPool must be a valid QueryPool handle

  • 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 not be called between suspended render pass instances

  • This command must only be called outside of a video coding scope

  • accelerationStructureCount must be greater than 0

  • Each of commandBuffer, queryPool, and the elements of pAccelerationStructures 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

Action

Conditional Rendering

vkCmdWriteAccelerationStructuresPropertiesNV is not affected by conditional rendering

See Also

VK_NV_ray_tracing, AccelerationStructureNV, CommandBuffer, QueryPool, QueryType

valuecmdBuildAccelerationStructureNV
  1. :: MonadIO io
  2. => CommandBuffer

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

  3. -> AccelerationStructureInfoNV

    pInfo contains the shared information for the acceleration structure’s structure.

  4. -> "instanceData" ::: Buffer

    instanceData is the buffer containing an array of AccelerationStructureInstanceKHR structures defining acceleration structures. This parameter must be NULL for bottom level acceleration structures.

  5. -> "instanceOffset" ::: DeviceSize

    instanceOffset is the offset in bytes (relative to the start of instanceData) at which the instance data is located.

  6. -> "update" ::: Bool

    update specifies whether to update the dst acceleration structure with the data in src.

  7. -> "dst" ::: AccelerationStructureNV

    dst is a pointer to the target acceleration structure for the build.

  8. -> "src" ::: AccelerationStructureNV

    src is a pointer to an existing acceleration structure that is to be used to update the dst acceleration structure.

  9. -> "scratch" ::: Buffer

    scratch is the Buffer that will be used as scratch memory for the build.

  10. -> "scratchOffset" ::: DeviceSize

    scratchOffset is the offset in bytes relative to the start of scratch that will be used as a scratch memory.

  11. -> io ()
#

vkCmdBuildAccelerationStructureNV - Build an acceleration structure

Description

Accesses to dst, src, and scratch must be synchronized with the PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR pipeline stage and an access type of ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR or ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR.

Valid Usage

Valid Usage (Implicit)

  • pInfo must be a valid pointer to a valid AccelerationStructureInfoNV structure

  • If instanceData is not NULL_HANDLE, instanceData must be a valid Buffer handle

  • dst must be a valid AccelerationStructureNV handle

  • If src is not NULL_HANDLE, src must be a valid AccelerationStructureNV handle

  • scratch must be a valid Buffer handle

  • 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 not be called between suspended render pass instances

  • This command must only be called outside of a video coding scope

  • Each of commandBuffer, dst, instanceData, scratch, and src 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

Action

Conditional Rendering

vkCmdBuildAccelerationStructureNV is not affected by conditional rendering

See Also

VK_NV_ray_tracing, AccelerationStructureInfoNV, AccelerationStructureNV, Bool32, Buffer, CommandBuffer, DeviceSize

valuecmdTraceRaysNV
  1. :: MonadIO io
  2. => CommandBuffer

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

  3. -> "raygenShaderBindingTableBuffer" ::: Buffer

    raygenShaderBindingTableBuffer is the buffer object that holds the shader binding table data for the ray generation shader stage.

  4. -> "raygenShaderBindingOffset" ::: DeviceSize

    raygenShaderBindingOffset is the offset in bytes (relative to raygenShaderBindingTableBuffer) of the ray generation shader being used for the trace.

  5. -> "missShaderBindingTableBuffer" ::: Buffer

    missShaderBindingTableBuffer is the buffer object that holds the shader binding table data for the miss shader stage.

  6. -> "missShaderBindingOffset" ::: DeviceSize

    missShaderBindingOffset is the offset in bytes (relative to missShaderBindingTableBuffer) of the miss shader being used for the trace.

  7. -> "missShaderBindingStride" ::: DeviceSize

    missShaderBindingStride is the size in bytes of each shader binding table record in missShaderBindingTableBuffer.

  8. -> "hitShaderBindingTableBuffer" ::: Buffer

    hitShaderBindingTableBuffer is the buffer object that holds the shader binding table data for the hit shader stages.

  9. -> "hitShaderBindingOffset" ::: DeviceSize

    hitShaderBindingOffset is the offset in bytes (relative to hitShaderBindingTableBuffer) of the hit shader group being used for the trace.

  10. -> "hitShaderBindingStride" ::: DeviceSize

    hitShaderBindingStride is the size in bytes of each shader binding table record in hitShaderBindingTableBuffer.

  11. -> "callableShaderBindingTableBuffer" ::: Buffer

    callableShaderBindingTableBuffer is the buffer object that holds the shader binding table data for the callable shader stage.

  12. -> "callableShaderBindingOffset" ::: DeviceSize

    callableShaderBindingOffset is the offset in bytes (relative to callableShaderBindingTableBuffer) of the callable shader being used for the trace.

  13. -> "callableShaderBindingStride" ::: DeviceSize

    callableShaderBindingStride is the size in bytes of each shader binding table record in callableShaderBindingTableBuffer.

  14. -> "width" ::: Word32

    width is the width of the ray trace query dimensions.

  15. -> "height" ::: Word32

    height is height of the ray trace query dimensions.

  16. -> "depth" ::: Word32

    depth is depth of the ray trace query dimensions.

  17. -> io ()
#

vkCmdTraceRaysNV - Initialize a ray tracing dispatch

Description

When the command is executed, a ray generation group of width × height × depth rays is assembled.

Valid Usage

Valid Usage (Implicit)

  • raygenShaderBindingTableBuffer must be a valid Buffer handle

  • If missShaderBindingTableBuffer is not NULL_HANDLE, missShaderBindingTableBuffer must be a valid Buffer handle

  • If hitShaderBindingTableBuffer is not NULL_HANDLE, hitShaderBindingTableBuffer must be a valid Buffer handle

  • If callableShaderBindingTableBuffer is not NULL_HANDLE, callableShaderBindingTableBuffer must be a valid Buffer handle

  • 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 not be called between suspended render pass instances

  • This command must only be called outside of a video coding scope

  • Each of callableShaderBindingTableBuffer, commandBuffer, hitShaderBindingTableBuffer, missShaderBindingTableBuffer, and raygenShaderBindingTableBuffer 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

Action

Conditional Rendering

vkCmdTraceRaysNV is not affected by conditional rendering

See Also

VK_NV_ray_tracing, Buffer, CommandBuffer, DeviceSize

valuegetAccelerationStructureHandleNV
  1. :: MonadIO io
  2. => Device

    device is the logical device that owns the acceleration structures.

    device must be a valid Device handle

  3. -> AccelerationStructureNV

    accelerationStructure is the acceleration structure.

    accelerationStructure must be bound completely and contiguously to a single DeviceMemory object via bindAccelerationStructureMemoryNV

    accelerationStructure must be a valid AccelerationStructureNV handle

    accelerationStructure must have been created, allocated, or retrieved from device

  4. -> "dataSize" ::: Word64

    dataSize is the size in bytes of the buffer pointed to by pData.

    dataSize must be large enough to contain the result of the query, as described above

    dataSize must be greater than 0

  5. -> "data" ::: Ptr ()

    pData is a pointer to an application-allocated buffer where the results will be written.

    pData must be a valid pointer to an array of dataSize bytes

  6. -> io ()
#
valuecreateRayTracingPipelinesNV
  1. :: MonadIO io
  2. => Device

    device is the logical device that creates the ray tracing pipelines.

  3. -> PipelineCache

    pipelineCache is either NULL_HANDLE, indicating that pipeline caching is disabled, or to enable caching, the handle of a valid PipelineCache object. The implementation must not access this object outside of the duration of this command.

  4. -> "createInfos" ::: Vector (SomeStruct RayTracingPipelineCreateInfoNV)

    pCreateInfos is a pointer to an array of RayTracingPipelineCreateInfoNV structures.

  5. -> "allocator" ::: Maybe AllocationCallbacks

    pAllocator controls host memory allocation as described in the Memory Allocation chapter.

  6. -> io (Result, "pipelines" ::: Vector Pipeline)
#

vkCreateRayTracingPipelinesNV - Creates a new ray tracing pipeline object

Description

Pipelines are created and returned as described for Multiple Pipeline Creation.

Valid Usage

Valid Usage (Implicit)

  • device must be a valid Device handle

  • If pipelineCache is not NULL_HANDLE, pipelineCache must be a valid PipelineCache handle

  • pCreateInfos must be a valid pointer to an array of createInfoCount valid RayTracingPipelineCreateInfoNV structures

  • If pAllocator is not NULL, pAllocator must be a valid pointer to a valid AllocationCallbacks structure

  • pPipelines must be a valid pointer to an array of createInfoCount Pipeline handles

  • createInfoCount must be greater than 0

  • If pipelineCache is a valid handle, it must have been created, allocated, or retrieved from device

Return Codes

Success
Failure

See Also

VK_NV_ray_tracing, AllocationCallbacks, Device, Pipeline, PipelineCache, RayTracingPipelineCreateInfoNV

A convenience wrapper to make a compatible pair of calls to createRayTracingPipelinesNV and destroyPipeline

To ensure that destroyPipeline is always called: pass bracket (or the allocate function from your favourite resource management library) as the last argument. To just extract the pair pass (,) as the last argument.

VkRayTracingShaderGroupCreateInfoNV - Structure specifying shaders in a shader group

Valid Usage

Valid Usage (Implicit)

See Also

VK_NV_ray_tracing, RayTracingPipelineCreateInfoNV, RayTracingShaderGroupTypeKHR, StructureType

Constructors

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero
datadata RayTracingPipelineCreateInfoNV (es :: [Type])
#

VkRayTracingPipelineCreateInfoNV - Structure specifying parameters of a newly created ray tracing pipeline

Description

The parameters basePipelineHandle and basePipelineIndex are described in more detail in Pipeline Derivatives.

If the pNext chain includes a PipelineCreateFlags2CreateInfo structure, PipelineCreateFlags2CreateInfo::flags from that structure is used instead of flags from this structure.

Valid Usage

Valid Usage (Implicit)

See Also

VK_NV_ray_tracing, Pipeline, PipelineCreateFlags, PipelineLayout, PipelineShaderStageCreateInfo, RayTracingShaderGroupCreateInfoNV, StructureType, createRayTracingPipelinesNV

Constructors

Instances5Extensible, Show, FromCStruct, ToCStruct, Zero
datadata GeometryTrianglesNV
#

VkGeometryTrianglesNV - Structure specifying a triangle geometry in a bottom-level acceleration structure

Description

If indexType is INDEX_TYPE_NONE_NV, then this structure describes a set of triangles determined by vertexCount. Otherwise, this structure describes a set of indexed triangles determined by indexCount.

Valid Usage

  • vertexOffset must be less than the size of vertexData

Valid Usage (Implicit)

  • pNext must be NULL

  • If vertexData is not NULL_HANDLE, vertexData must be a valid Buffer handle

  • vertexFormat must be a valid Format value

  • If indexData is not NULL_HANDLE, indexData must be a valid Buffer handle

  • indexType must be a valid IndexType value

  • If transformData is not NULL_HANDLE, transformData must be a valid Buffer handle

  • Each of indexData, transformData, and vertexData that are valid handles of non-ignored parameters must have been created, allocated, or retrieved from the same Device

See Also

VK_NV_ray_tracing, Buffer, DeviceSize, Format, GeometryDataNV, IndexType, StructureType

Constructors

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero
datadata GeometryAABBNV
#

VkGeometryAABBNV - Structure specifying axis-aligned bounding box geometry in a bottom-level acceleration structure

Description

The AABB data in memory is six 32-bit floats consisting of the minimum x, y, and z values followed by the maximum x, y, and z values.

Valid Usage

  • offset must be less than the size of aabbData

  • offset must be a multiple of 8

  • stride must be a multiple of 8

Valid Usage (Implicit)

  • pNext must be NULL

  • If aabbData is not NULL_HANDLE, aabbData must be a valid Buffer handle

See Also

VK_NV_ray_tracing, Buffer, DeviceSize, GeometryDataNV, StructureType

Constructors

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero
datadata GeometryDataNV
#

VkGeometryDataNV - Structure specifying geometry in a bottom-level acceleration structure

Valid Usage (Implicit)

See Also

VK_NV_ray_tracing, GeometryAABBNV, GeometryNV, GeometryTrianglesNV

Constructors

Instances5Show, Storable, FromCStruct, ToCStruct, Zero
datadata GeometryNV
#

VkGeometryNV - Structure specifying a geometry in a bottom-level acceleration structure

Valid Usage (Implicit)

See Also

VK_NV_ray_tracing, AccelerationStructureInfoNV, GeometryDataNV, GeometryFlagsKHR, GeometryTypeKHR, StructureType

Constructors

Instances5Show, Storable, FromCStruct, ToCStruct, Zero

VkAccelerationStructureInfoNV - Structure specifying the parameters of acceleration structure object

Description

AccelerationStructureInfoNV contains information that is used both for acceleration structure creation with createAccelerationStructureNV and in combination with the actual geometric data to build the acceleration structure with cmdBuildAccelerationStructureNV.

Valid Usage

Valid Usage (Implicit)

See Also

VK_NV_ray_tracing, AccelerationStructureCreateInfoNV, AccelerationStructureTypeKHR, BuildAccelerationStructureFlagsKHR, GeometryNV, StructureType, cmdBuildAccelerationStructureNV

Constructors

Instances4Show, FromCStruct, ToCStruct, Zero

VkAccelerationStructureCreateInfoNV - Structure specifying the parameters of a newly created acceleration structure object

Valid Usage

  • If compactedSize is not 0 then both info.geometryCount and info.instanceCount must be 0

Valid Usage (Implicit)

See Also

VK_NV_ray_tracing, AccelerationStructureInfoNV, DeviceSize, StructureType, createAccelerationStructureNV

Constructors

Instances5Extensible, Show, FromCStruct, ToCStruct, Zero

VkBindAccelerationStructureMemoryInfoNV - Structure specifying acceleration structure memory binding

Valid Usage

  • accelerationStructure must not already be backed by a memory object

Valid Usage (Implicit)

  • pNext must be NULL

  • accelerationStructure must be a valid AccelerationStructureNV handle

  • memory must be a valid DeviceMemory handle

  • If deviceIndexCount is not 0, pDeviceIndices must be a valid pointer to an array of deviceIndexCount uint32_t values

  • Both of accelerationStructure, and memory must have been created, allocated, or retrieved from the same Device

See Also

VK_NV_ray_tracing, AccelerationStructureNV, DeviceMemory, DeviceSize, StructureType, bindAccelerationStructureMemoryNV

Constructors

Instances4Show, FromCStruct, ToCStruct, Zero

VkWriteDescriptorSetAccelerationStructureNV - Structure specifying acceleration structure descriptor information

Valid Usage

Valid Usage (Implicit)

  • pAccelerationStructures must be a valid pointer to an array of accelerationStructureCount valid or NULL_HANDLE AccelerationStructureNV handles

  • accelerationStructureCount must be greater than 0

Structure Chaining

Extends the structure

See Also

VK_NV_ray_tracing, AccelerationStructureNV, StructureType

Constructors

Instances4Show, FromCStruct, ToCStruct, Zero

VkAccelerationStructureMemoryRequirementsInfoNV - Structure specifying acceleration to query for memory requirements

Valid Usage (Implicit)

See Also

VK_NV_ray_tracing, AccelerationStructureMemoryRequirementsTypeNV, AccelerationStructureNV, StructureType, getAccelerationStructureMemoryRequirementsNV

Constructors

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero

VkPhysicalDeviceRayTracingPropertiesNV - Properties of the physical device for ray tracing

Description

Due to the fact that the geometry, instance, and triangle counts are specified at acceleration structure creation as 32-bit values, maxGeometryCount, maxInstanceCount, and maxTriangleCount must not exceed 232-1.

If the PhysicalDeviceRayTracingPropertiesNV structure is included in the pNext chain of the PhysicalDeviceProperties2 structure passed to getPhysicalDeviceProperties2, it is filled in with each corresponding implementation-dependent property.

Limits specified by this structure must match those specified with the same name in PhysicalDeviceAccelerationStructurePropertiesKHR and PhysicalDeviceRayTracingPipelinePropertiesKHR.

Structure Chaining

Extends the structure

See Also

VK_NV_ray_tracing, StructureType

Constructors

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero

VkAccelerationStructureMemoryRequirementsTypeNV - Acceleration structure memory requirement type

Description

See Also

VK_NV_ray_tracing, AccelerationStructureMemoryRequirementsInfoNV

Instances6Eq, Ord, Read, Show, Storable, Zero
newtypenewtype AccelerationStructureNV
#
Instances7Eq, Ord, Show, Storable, HasObjectType, IsHandle, …
datadata AabbPositionsKHR
#

VkAabbPositionsKHR - Structure specifying two opposing corners of an axis-aligned bounding box

Valid Usage

See Also

VK_KHR_acceleration_structure, VK_NV_ray_tracing

Constructors

  • AabbPositionsKHR
    • minX :: Float

      minX is the x position of one opposing corner of a bounding box.

      minX must be less than or equal to maxX

    • minY :: Float

      minY is the y position of one opposing corner of a bounding box.

      minY must be less than or equal to maxY

    • minZ :: Float

      minZ is the z position of one opposing corner of a bounding box.

      minZ must be less than or equal to maxZ

    • maxX :: Float

      maxX is the x position of the other opposing corner of a bounding box.

    • maxY :: Float

      maxY is the y position of the other opposing corner of a bounding box.

    • maxZ :: Float

      maxZ is the z position of the other opposing corner of a bounding box.

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero
datadata TransformMatrixKHR
#

VkTransformMatrixKHR - Structure specifying a 3x4 affine transformation matrix

Valid Usage

  • The first three columns of matrix must define an invertible 3x3 matrix

See Also

VK_KHR_acceleration_structure, VK_NV_ray_tracing, AccelerationStructureInstanceKHR, AccelerationStructureMatrixMotionInstanceNV, VkPartitionedAccelerationStructureWriteInstanceDataNV

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero

VkAccelerationStructureInstanceKHR - Structure specifying a single acceleration structure instance for building into an acceleration structure geometry

Description

The C language specification does not define the ordering of bit-fields, but in practice, this structure produces the correct layout with existing compilers. The intended bit pattern is for the following:

  • instanceCustomIndex and mask occupy the same memory as if a single uint32_t was specified in their place

    • instanceCustomIndex occupies the 24 least significant bits of that memory

    • mask occupies the 8 most significant bits of that memory

  • instanceShaderBindingTableRecordOffset and flags occupy the same memory as if a single uint32_t was specified in their place

    • instanceShaderBindingTableRecordOffset occupies the 24 least significant bits of that memory

    • flags occupies the 8 most significant bits of that memory

If a compiler produces code that diverges from that pattern, applications must employ another method to set values according to the correct bit pattern.

Valid Usage

Valid Usage (Implicit)

See Also

VK_KHR_acceleration_structure, VK_NV_ray_tracing, AccelerationStructureMotionInstanceDataNV, GeometryInstanceFlagsKHR, TransformMatrixKHR

Constructors

Instances5Show, Storable, FromCStruct, ToCStruct, Zero
valuegetRayTracingShaderGroupHandlesKHR
  1. :: MonadIO io
  2. => Device

    device is the logical device containing the ray tracing pipeline.

  3. -> Pipeline

    pipeline is the ray tracing pipeline object containing the shaders.

  4. -> "firstGroup" ::: Word32

    firstGroup is the index of the first group to retrieve a handle for from the RayTracingPipelineCreateInfoKHR::pGroups or RayTracingPipelineCreateInfoNV::pGroups array.

  5. -> "groupCount" ::: Word32

    groupCount is the number of shader handles to retrieve.

  6. -> "dataSize" ::: Word64

    dataSize is the size in bytes of the buffer pointed to by pData.

  7. -> "data" ::: Ptr ()

    pData is a pointer to an application-allocated buffer where the results will be written.

  8. -> io ()
#

vkGetRayTracingShaderGroupHandlesKHR - Query ray tracing pipeline shader group handles

Description

On success, an array of groupCount shader handles will be written to pData, with each element being of size PhysicalDeviceRayTracingPipelinePropertiesKHR::shaderGroupHandleSize. The first handle written corresponds to the group identified by firstGroup, with subsequent handles corresponding to consecutive shader groups in the order they appear in the RayTracingPipelineCreateInfoKHR::pGroups or RayTracingPipelineCreateInfoNV::pGroups array.

If pipeline was created with PIPELINE_CREATE_LIBRARY_BIT_KHR and the pipelineLibraryGroupHandles feature is enabled applications can query group handles from that pipeline, even if the pipeline is a library and is never bound to a command buffer. These group handles remain bitwise identical for any pipeline which references the pipeline library. Group indices are assigned as-if the pipeline was created without PIPELINE_CREATE_LIBRARY_BIT_KHR.

Valid Usage

  • pipeline must be a ray tracing pipeline

Valid Usage (Implicit)

  • device must be a valid Device handle

  • pipeline must be a valid Pipeline handle

  • pData must be a valid pointer to an array of dataSize bytes

  • dataSize must be greater than 0

  • pipeline must have been created, allocated, or retrieved from device

Return Codes

Success
Failure

See Also

VK_KHR_ray_tracing_pipeline, VK_NV_ray_tracing, Device, Pipeline

newtypenewtype DebugReportObjectTypeEXT
#

VkDebugReportObjectTypeEXT - Specify the type of an object handle

Description

'

DebugReportObjectTypeEXT

Vulkan Handle Type

DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT

Unknown/Undefined Handle

DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT

Instance

DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT

PhysicalDevice

DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT

Device

DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT

Queue

DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT

Semaphore

DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT

CommandBuffer

DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT

Fence

DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT

DeviceMemory

DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT

Buffer

DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT

Image

DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT

Event

DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT

QueryPool

DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT

BufferView

DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT

ImageView

DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT

ShaderModule

DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT

PipelineCache

DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT

PipelineLayout

DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT

RenderPass

DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT

Pipeline

DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT

DescriptorSetLayout

DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT

Sampler

DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT

DescriptorPool

DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT

DescriptorSet

DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT

Framebuffer

DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT

CommandPool

DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT

SurfaceKHR

DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT

SwapchainKHR

DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT

DebugReportCallbackEXT

DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT

DisplayKHR

DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT

DisplayModeKHR

DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_EXT

DescriptorUpdateTemplate

DebugReportObjectTypeEXT and Vulkan Handle Relationship

The primary expected use of ERROR_VALIDATION_FAILED_EXT is for validation layer testing to prevent invalid commands from reaching the ICD. It is not expected that an application would see this error code during normal use of the validation layers. If an application returns TRUE in DebugUtilsMessengerCallbackDataEXT, the validation layers will return this error code instead of passing the command down the dispatch chain.

See Also

PFN_vkDebugReportCallbackEXT, VK_EXT_debug_marker, VK_EXT_debug_report, DebugMarkerObjectNameInfoEXT, DebugMarkerObjectTagInfoEXT, debugReportMessageEXT

Instances6Eq, Ord, Read, Show, Storable, Zero
newtypenewtype GeometryInstanceFlagBitsKHR
#

VkGeometryInstanceFlagBitsKHR - Instance flag bits

Description

GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR and GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR must not be used in the same flag.

See Also

VK_KHR_acceleration_structure, VK_NV_ray_tracing, GeometryInstanceFlagsKHR

Instances8Eq, Ord, Read, Show, Bits, FiniteBits, …
newtypenewtype GeometryFlagBitsKHR
#

VkGeometryFlagBitsKHR - Bitmask specifying additional parameters for a geometry

Description

  • GEOMETRY_OPAQUE_BIT_KHR specifies that this geometry does not invoke the any-hit shaders even if present in a hit group.

  • GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_KHR specifies that the implementation must only call the any-hit shader a single time for each primitive in this geometry. If this bit is absent an implementation may invoke the any-hit shader more than once for this geometry.

See Also

VK_KHR_acceleration_structure, VK_NV_ray_tracing, GeometryFlagsKHR

Instances8Eq, Ord, Read, Show, Bits, FiniteBits, …

VkBuildAccelerationStructureFlagBitsKHR - Bitmask specifying additional parameters for acceleration structure builds

Description

BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR and BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR may take more time and memory than a normal build, and so should only be used when those features are needed.

BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR and BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR are allowed to be used together. In that case, the result of the compaction copy is used as the source of a build with mode of BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR to perform the compacted update.

See Also

VK_KHR_acceleration_structure, VK_NV_ray_tracing, BuildAccelerationStructureFlagsKHR

Instances8Eq, Ord, Read, Show, Bits, FiniteBits, …

VkCopyAccelerationStructureModeKHR - Acceleration structure copy mode

Description

  • COPY_ACCELERATION_STRUCTURE_MODE_CLONE_KHR creates a direct copy of the acceleration structure specified in src into the one specified by dst. The dst acceleration structure must have been created with the same parameters as src with the exception of size, which must at least as large as the queried QUERY_TYPE_ACCELERATION_STRUCTURE_SIZE_KHR size . If src contains references to other acceleration structures, dst will reference the same acceleration structures.

See Also

VK_KHR_acceleration_structure, VK_NV_ray_tracing, CopyAccelerationStructureInfoKHR, CopyAccelerationStructureToMemoryInfoKHR, CopyMemoryToAccelerationStructureInfoKHR, cmdCopyAccelerationStructureNV

Instances6Eq, Ord, Read, Show, Storable, Zero
newtypenewtype AccelerationStructureTypeKHR
#

VkAccelerationStructureTypeKHR - Type of acceleration structure

Description

See Also

VK_KHR_acceleration_structure, VK_NV_ray_tracing, AccelerationStructureBuildGeometryInfoKHR, AccelerationStructureCreateInfo2KHR, AccelerationStructureCreateInfoKHR, AccelerationStructureInfoNV

Instances6Eq, Ord, Read, Show, Storable, Zero
newtypenewtype GeometryTypeKHR
#

VkGeometryTypeKHR - Enum specifying which type of geometry is provided

Description

See Also

VK_KHR_acceleration_structure, VK_NV_ray_tracing, AccelerationStructureGeometryKHR, GeometryNV

Instances6Eq, Ord, Read, Show, Storable, Zero
newtypenewtype RayTracingShaderGroupTypeKHR
#

VkRayTracingShaderGroupTypeKHR - Shader group types

Description

For current group types, the hit group type could be inferred from the presence or absence of the intersection shader, but we provide the type explicitly for future hit groups that do not have that property.

See Also

VK_KHR_ray_tracing_pipeline, VK_NV_ray_tracing, RayTracingShaderGroupCreateInfoKHR, RayTracingShaderGroupCreateInfoNV

Instances6Eq, Ord, Read, Show, Storable, Zero