Class NVRayTracing
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
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);
}
- Name String
VK_NV_ray_tracing- Extension Type
- Device extension
- Registered Extension Number
- 166
- Revision
- 3
- Extension and Version Dependencies
VK_KHR_get_physical_device_properties2andVK_KHR_get_memory_requirements2or 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
- Deprecated by
VK_KHR_ray_tracing_pipelineextension
- Deprecated by
- Contact
- Eric Werness ewerness-nv
Other Extension Metadata
- Last Modified Date
- 2018-11-20
- Interactions and External Dependencies
- This extension provides API support for
GL_NV_ray_tracing
- This extension provides API support for
- 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
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intVkAccelerationStructureMemoryRequirementsTypeNV - Acceleration structure memory requirement typestatic final intVkAccelerationStructureMemoryRequirementsTypeNV - Acceleration structure memory requirement typestatic final intVkAccelerationStructureMemoryRequirementsTypeNV - Acceleration structure memory requirement typestatic final intExtendsVkAccelerationStructureTypeKHR.static final intExtendsVkAccelerationStructureTypeKHR.static final intExtendsVkAccessFlagBits.static final intExtendsVkAccessFlagBits.static final intExtendsVkBufferUsageFlagBits.static final intExtendsVkBuildAccelerationStructureFlagBitsKHR.static final intExtendsVkBuildAccelerationStructureFlagBitsKHR.static final intExtendsVkBuildAccelerationStructureFlagBitsKHR.static final intExtendsVkBuildAccelerationStructureFlagBitsKHR.static final intExtendsVkBuildAccelerationStructureFlagBitsKHR.static final intExtendsVkCopyAccelerationStructureModeKHR.static final intExtendsVkCopyAccelerationStructureModeKHR.static final intExtendsVkDebugReportObjectTypeEXT.static final intExtendsVkDescriptorType.static final intExtendsVkGeometryInstanceFlagBitsKHR.static final intExtendsVkGeometryInstanceFlagBitsKHR.static final intExtendsVkGeometryInstanceFlagBitsKHR.static final intExtendsVkGeometryInstanceFlagBitsKHR.static final intExtendsVkGeometryFlagBitsKHR.static final intExtendsVkGeometryFlagBitsKHR.static final intExtendsVkGeometryTypeKHR.static final intExtendsVkGeometryTypeKHR.static final intExtendsVkIndexType.static final StringThe extension name.static final intThe extension specification version.static final intExtendsVkObjectType.static final intExtendsVkPipelineBindPoint.static final intExtendsVkPipelineCreateFlagBits.static final intExtendsVkPipelineStageFlagBits.static final intExtendsVkPipelineStageFlagBits.static final intExtendsVkQueryType.static final intExtendsVkRayTracingShaderGroupTypeKHR.static final intExtendsVkRayTracingShaderGroupTypeKHR.static final intExtendsVkRayTracingShaderGroupTypeKHR.static final intExtendsVkShaderStageFlagBits.static final intExtendsVkShaderStageFlagBits.static final intExtendsVkShaderStageFlagBits.static final intExtendsVkShaderStageFlagBits.static final intExtendsVkShaderStageFlagBits.static final intExtendsVkShaderStageFlagBits.static final intVK_SHADER_UNUSED_NVstatic final intExtendsVkStructureType.static final intExtendsVkStructureType.static final intExtendsVkStructureType.static final intExtendsVkStructureType.static final intExtendsVkStructureType.static final intExtendsVkStructureType.static final intExtendsVkStructureType.static final intExtendsVkStructureType.static final intExtendsVkStructureType.static final intExtendsVkStructureType.static final intExtendsVkStructureType. -
Method Summary
Modifier and TypeMethodDescriptionstatic intnvkBindAccelerationStructureMemoryNV(org.lwjgl.vulkan.VkDevice device, int bindInfoCount, long pBindInfos) Unsafe version of:BindAccelerationStructureMemoryNVstatic voidnvkCmdBuildAccelerationStructureNV(org.lwjgl.vulkan.VkCommandBuffer commandBuffer, long pInfo, long instanceData, long instanceOffset, int update, long dst, long src, long scratch, long scratchOffset) Unsafe version of:CmdBuildAccelerationStructureNVstatic voidnvkCmdWriteAccelerationStructuresPropertiesNV(org.lwjgl.vulkan.VkCommandBuffer commandBuffer, int accelerationStructureCount, long pAccelerationStructures, int queryType, long queryPool, int firstQuery) Unsafe version of:CmdWriteAccelerationStructuresPropertiesNVstatic intnvkCreateAccelerationStructureNV(org.lwjgl.vulkan.VkDevice device, long pCreateInfo, long pAllocator, long pAccelerationStructure) Unsafe version of:CreateAccelerationStructureNVstatic intnvkCreateRayTracingPipelinesNV(org.lwjgl.vulkan.VkDevice device, long pipelineCache, int createInfoCount, long pCreateInfos, long pAllocator, long pPipelines) Unsafe version of:CreateRayTracingPipelinesNVstatic voidnvkDestroyAccelerationStructureNV(org.lwjgl.vulkan.VkDevice device, long accelerationStructure, long pAllocator) Unsafe version of:DestroyAccelerationStructureNVstatic intnvkGetAccelerationStructureHandleNV(org.lwjgl.vulkan.VkDevice device, long accelerationStructure, long dataSize, long pData) Unsafe version of:GetAccelerationStructureHandleNVstatic voidnvkGetAccelerationStructureMemoryRequirementsNV(org.lwjgl.vulkan.VkDevice device, long pInfo, long pMemoryRequirements) Unsafe version of:GetAccelerationStructureMemoryRequirementsNVstatic intnvkGetRayTracingShaderGroupHandlesNV(org.lwjgl.vulkan.VkDevice device, long pipeline, int firstGroup, int groupCount, long dataSize, long pData) Unsafe version of:GetRayTracingShaderGroupHandlesNVstatic intvkBindAccelerationStructureMemoryNV(org.lwjgl.vulkan.VkDevice device, VkBindAccelerationStructureMemoryInfoNV.Buffer pBindInfos) Bind acceleration structure memory.static voidvkCmdBuildAccelerationStructureNV(org.lwjgl.vulkan.VkCommandBuffer commandBuffer, VkAccelerationStructureInfoNV pInfo, long instanceData, long instanceOffset, boolean update, long dst, long src, long scratch, long scratchOffset) Build an acceleration structure.static voidvkCmdCopyAccelerationStructureNV(org.lwjgl.vulkan.VkCommandBuffer commandBuffer, long dst, long src, int mode) Copy an acceleration structure.static voidvkCmdTraceRaysNV(org.lwjgl.vulkan.VkCommandBuffer commandBuffer, long raygenShaderBindingTableBuffer, long raygenShaderBindingOffset, long missShaderBindingTableBuffer, long missShaderBindingOffset, long missShaderBindingStride, long hitShaderBindingTableBuffer, long hitShaderBindingOffset, long hitShaderBindingStride, long callableShaderBindingTableBuffer, long callableShaderBindingOffset, long callableShaderBindingStride, int width, int height, int depth) Initialize a ray tracing dispatch.static voidvkCmdWriteAccelerationStructuresPropertiesNV(org.lwjgl.vulkan.VkCommandBuffer commandBuffer, long[] pAccelerationStructures, int queryType, long queryPool, int firstQuery) Array version of:CmdWriteAccelerationStructuresPropertiesNVstatic voidvkCmdWriteAccelerationStructuresPropertiesNV(org.lwjgl.vulkan.VkCommandBuffer commandBuffer, LongBuffer pAccelerationStructures, int queryType, long queryPool, int firstQuery) Write acceleration structure result parameters to query results.static intvkCompileDeferredNV(org.lwjgl.vulkan.VkDevice device, long pipeline, int shader) Deferred compilation of shaders.static intvkCreateAccelerationStructureNV(org.lwjgl.vulkan.VkDevice device, VkAccelerationStructureCreateInfoNV pCreateInfo, @Nullable VkAllocationCallbacks pAllocator, long[] pAccelerationStructure) Array version of:CreateAccelerationStructureNVstatic intvkCreateAccelerationStructureNV(org.lwjgl.vulkan.VkDevice device, VkAccelerationStructureCreateInfoNV pCreateInfo, @Nullable VkAllocationCallbacks pAllocator, LongBuffer pAccelerationStructure) Create a new acceleration structure object.static intvkCreateRayTracingPipelinesNV(org.lwjgl.vulkan.VkDevice device, long pipelineCache, VkRayTracingPipelineCreateInfoNV.Buffer pCreateInfos, @Nullable VkAllocationCallbacks pAllocator, long[] pPipelines) Array version of:CreateRayTracingPipelinesNVstatic intvkCreateRayTracingPipelinesNV(org.lwjgl.vulkan.VkDevice device, long pipelineCache, VkRayTracingPipelineCreateInfoNV.Buffer pCreateInfos, @Nullable VkAllocationCallbacks pAllocator, LongBuffer pPipelines) Creates a new ray tracing pipeline object.static voidvkDestroyAccelerationStructureNV(org.lwjgl.vulkan.VkDevice device, long accelerationStructure, @Nullable VkAllocationCallbacks pAllocator) Destroy an acceleration structure object.static intvkGetAccelerationStructureHandleNV(org.lwjgl.vulkan.VkDevice device, long accelerationStructure, long[] pData) Array version of:GetAccelerationStructureHandleNVstatic intvkGetAccelerationStructureHandleNV(org.lwjgl.vulkan.VkDevice device, long accelerationStructure, ByteBuffer pData) Get opaque acceleration structure handle.static intvkGetAccelerationStructureHandleNV(org.lwjgl.vulkan.VkDevice device, long accelerationStructure, LongBuffer pData) Get opaque acceleration structure handle.static voidvkGetAccelerationStructureMemoryRequirementsNV(org.lwjgl.vulkan.VkDevice device, VkAccelerationStructureMemoryRequirementsInfoNV pInfo, VkMemoryRequirements2KHR pMemoryRequirements) Get acceleration structure memory requirements.static intvkGetRayTracingShaderGroupHandlesNV(org.lwjgl.vulkan.VkDevice device, long pipeline, int firstGroup, int groupCount, ByteBuffer pData)
-
Field Details
-
VK_NV_RAY_TRACING_SPEC_VERSION
public static final int VK_NV_RAY_TRACING_SPEC_VERSIONThe extension specification version.- See Also:
-
VK_NV_RAY_TRACING_EXTENSION_NAME
The extension name.- See Also:
-
VK_SHADER_UNUSED_NV
public static final int VK_SHADER_UNUSED_NVVK_SHADER_UNUSED_NV- See Also:
-
VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NV
public static final int VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NVExtendsVkStructureType.Enum values:
STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NVSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NVSTRUCTURE_TYPE_GEOMETRY_NVSTRUCTURE_TYPE_GEOMETRY_TRIANGLES_NVSTRUCTURE_TYPE_GEOMETRY_AABB_NVSTRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NVSTRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NVSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NVSTRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NVSTRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NVSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV
- See Also:
-
VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NV
public static final int VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NVExtendsVkStructureType.Enum values:
STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NVSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NVSTRUCTURE_TYPE_GEOMETRY_NVSTRUCTURE_TYPE_GEOMETRY_TRIANGLES_NVSTRUCTURE_TYPE_GEOMETRY_AABB_NVSTRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NVSTRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NVSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NVSTRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NVSTRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NVSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV
- See Also:
-
VK_STRUCTURE_TYPE_GEOMETRY_NV
public static final int VK_STRUCTURE_TYPE_GEOMETRY_NVExtendsVkStructureType.Enum values:
STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NVSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NVSTRUCTURE_TYPE_GEOMETRY_NVSTRUCTURE_TYPE_GEOMETRY_TRIANGLES_NVSTRUCTURE_TYPE_GEOMETRY_AABB_NVSTRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NVSTRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NVSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NVSTRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NVSTRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NVSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV
- See Also:
-
VK_STRUCTURE_TYPE_GEOMETRY_TRIANGLES_NV
public static final int VK_STRUCTURE_TYPE_GEOMETRY_TRIANGLES_NVExtendsVkStructureType.Enum values:
STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NVSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NVSTRUCTURE_TYPE_GEOMETRY_NVSTRUCTURE_TYPE_GEOMETRY_TRIANGLES_NVSTRUCTURE_TYPE_GEOMETRY_AABB_NVSTRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NVSTRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NVSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NVSTRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NVSTRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NVSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV
- See Also:
-
VK_STRUCTURE_TYPE_GEOMETRY_AABB_NV
public static final int VK_STRUCTURE_TYPE_GEOMETRY_AABB_NVExtendsVkStructureType.Enum values:
STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NVSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NVSTRUCTURE_TYPE_GEOMETRY_NVSTRUCTURE_TYPE_GEOMETRY_TRIANGLES_NVSTRUCTURE_TYPE_GEOMETRY_AABB_NVSTRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NVSTRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NVSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NVSTRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NVSTRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NVSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV
- See Also:
-
VK_STRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NV
public static final int VK_STRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NVExtendsVkStructureType.Enum values:
STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NVSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NVSTRUCTURE_TYPE_GEOMETRY_NVSTRUCTURE_TYPE_GEOMETRY_TRIANGLES_NVSTRUCTURE_TYPE_GEOMETRY_AABB_NVSTRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NVSTRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NVSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NVSTRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NVSTRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NVSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV
- See Also:
-
VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV
public static final int VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NVExtendsVkStructureType.Enum values:
STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NVSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NVSTRUCTURE_TYPE_GEOMETRY_NVSTRUCTURE_TYPE_GEOMETRY_TRIANGLES_NVSTRUCTURE_TYPE_GEOMETRY_AABB_NVSTRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NVSTRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NVSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NVSTRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NVSTRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NVSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV
- See Also:
-
VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NV
public static final int VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NVExtendsVkStructureType.Enum values:
STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NVSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NVSTRUCTURE_TYPE_GEOMETRY_NVSTRUCTURE_TYPE_GEOMETRY_TRIANGLES_NVSTRUCTURE_TYPE_GEOMETRY_AABB_NVSTRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NVSTRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NVSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NVSTRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NVSTRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NVSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV
- See Also:
-
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV
public static final int VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NVExtendsVkStructureType.Enum values:
STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NVSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NVSTRUCTURE_TYPE_GEOMETRY_NVSTRUCTURE_TYPE_GEOMETRY_TRIANGLES_NVSTRUCTURE_TYPE_GEOMETRY_AABB_NVSTRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NVSTRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NVSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NVSTRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NVSTRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NVSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV
- See Also:
-
VK_STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NV
public static final int VK_STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NVExtendsVkStructureType.Enum values:
STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NVSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NVSTRUCTURE_TYPE_GEOMETRY_NVSTRUCTURE_TYPE_GEOMETRY_TRIANGLES_NVSTRUCTURE_TYPE_GEOMETRY_AABB_NVSTRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NVSTRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NVSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NVSTRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NVSTRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NVSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV
- See Also:
-
VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV
public static final int VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NVExtendsVkStructureType.Enum values:
STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NVSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NVSTRUCTURE_TYPE_GEOMETRY_NVSTRUCTURE_TYPE_GEOMETRY_TRIANGLES_NVSTRUCTURE_TYPE_GEOMETRY_AABB_NVSTRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NVSTRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NVSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NVSTRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NVSTRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NVSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV
- See Also:
-
VK_SHADER_STAGE_RAYGEN_BIT_NV
public static final int VK_SHADER_STAGE_RAYGEN_BIT_NVExtendsVkShaderStageFlagBits.Enum values:
- See Also:
-
VK_SHADER_STAGE_ANY_HIT_BIT_NV
public static final int VK_SHADER_STAGE_ANY_HIT_BIT_NVExtendsVkShaderStageFlagBits.Enum values:
- See Also:
-
VK_SHADER_STAGE_CLOSEST_HIT_BIT_NV
public static final int VK_SHADER_STAGE_CLOSEST_HIT_BIT_NVExtendsVkShaderStageFlagBits.Enum values:
- See Also:
-
VK_SHADER_STAGE_MISS_BIT_NV
public static final int VK_SHADER_STAGE_MISS_BIT_NVExtendsVkShaderStageFlagBits.Enum values:
- See Also:
-
VK_SHADER_STAGE_INTERSECTION_BIT_NV
public static final int VK_SHADER_STAGE_INTERSECTION_BIT_NVExtendsVkShaderStageFlagBits.Enum values:
- See Also:
-
VK_SHADER_STAGE_CALLABLE_BIT_NV
public static final int VK_SHADER_STAGE_CALLABLE_BIT_NVExtendsVkShaderStageFlagBits.Enum values:
- See Also:
-
VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_NV
public static final int VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_NVExtendsVkPipelineStageFlagBits.Enum values:
- See Also:
-
VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_NV
public static final int VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_NVExtendsVkPipelineStageFlagBits.Enum values:
- See Also:
-
VK_BUFFER_USAGE_RAY_TRACING_BIT_NV
public static final int VK_BUFFER_USAGE_RAY_TRACING_BIT_NVExtendsVkBufferUsageFlagBits.- See Also:
-
VK_PIPELINE_BIND_POINT_RAY_TRACING_NV
public static final int VK_PIPELINE_BIND_POINT_RAY_TRACING_NVExtendsVkPipelineBindPoint.- See Also:
-
VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV
public static final int VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NVExtendsVkDescriptorType.- See Also:
-
VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_NV
public static final int VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_NVExtendsVkAccessFlagBits.Enum values:
- See Also:
-
VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_NV
public static final int VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_NVExtendsVkAccessFlagBits.Enum values:
- See Also:
-
VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_NV
public static final int VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_NVExtendsVkQueryType.- See Also:
-
VK_PIPELINE_CREATE_DEFER_COMPILE_BIT_NV
public static final int VK_PIPELINE_CREATE_DEFER_COMPILE_BIT_NVExtendsVkPipelineCreateFlagBits.- See Also:
-
VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV
public static final int VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_NVExtendsVkObjectType.- See Also:
-
VK_INDEX_TYPE_NONE_NV
public static final int VK_INDEX_TYPE_NONE_NVExtendsVkIndexType.- See Also:
-
VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_NV
public static final int VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_NVExtendsVkRayTracingShaderGroupTypeKHR.Enum values:
- See Also:
-
VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_NV
public static final int VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_NVExtendsVkRayTracingShaderGroupTypeKHR.Enum values:
- See Also:
-
VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_NV
public static final int VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_NVExtendsVkRayTracingShaderGroupTypeKHR.Enum values:
- See Also:
-
VK_GEOMETRY_TYPE_TRIANGLES_NV
public static final int VK_GEOMETRY_TYPE_TRIANGLES_NV- See Also:
-
VK_GEOMETRY_TYPE_AABBS_NV
public static final int VK_GEOMETRY_TYPE_AABBS_NV- See Also:
-
VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_NV
public static final int VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_NVExtendsVkAccelerationStructureTypeKHR.Enum values:
- See Also:
-
VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_NV
public static final int VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_NVExtendsVkAccelerationStructureTypeKHR.Enum values:
- See Also:
-
VK_GEOMETRY_OPAQUE_BIT_NV
public static final int VK_GEOMETRY_OPAQUE_BIT_NVExtendsVkGeometryFlagBitsKHR.Enum values:
- See Also:
-
VK_GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_NV
public static final int VK_GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_NVExtendsVkGeometryFlagBitsKHR.Enum values:
- See Also:
-
VK_GEOMETRY_INSTANCE_TRIANGLE_CULL_DISABLE_BIT_NV
public static final int VK_GEOMETRY_INSTANCE_TRIANGLE_CULL_DISABLE_BIT_NVExtendsVkGeometryInstanceFlagBitsKHR.Enum values:
- See Also:
-
VK_GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_NV
public static final int VK_GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_NVExtendsVkGeometryInstanceFlagBitsKHR.Enum values:
- See Also:
-
VK_GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_NV
public static final int VK_GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_NVExtendsVkGeometryInstanceFlagBitsKHR.Enum values:
- See Also:
-
VK_GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_NV
public static final int VK_GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_NVExtendsVkGeometryInstanceFlagBitsKHR.Enum values:
- See Also:
-
VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_NV
public static final int VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_NVExtendsVkBuildAccelerationStructureFlagBitsKHR.Enum values:
- See Also:
-
VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_NV
public static final int VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_NVExtendsVkBuildAccelerationStructureFlagBitsKHR.Enum values:
- See Also:
-
VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_NV
public static final int VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_NVExtendsVkBuildAccelerationStructureFlagBitsKHR.Enum values:
- See Also:
-
VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_NV
public static final int VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_NVExtendsVkBuildAccelerationStructureFlagBitsKHR.Enum values:
- See Also:
-
VK_BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_NV
public static final int VK_BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_NVExtendsVkBuildAccelerationStructureFlagBitsKHR.Enum values:
- See Also:
-
VK_COPY_ACCELERATION_STRUCTURE_MODE_CLONE_NV
public static final int VK_COPY_ACCELERATION_STRUCTURE_MODE_CLONE_NVExtendsVkCopyAccelerationStructureModeKHR.Enum values:
- See Also:
-
VK_COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_NV
public static final int VK_COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_NVExtendsVkCopyAccelerationStructureModeKHR.Enum values:
- See Also:
-
VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV_EXT
public static final int VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV_EXTExtendsVkDebugReportObjectTypeEXT.- See Also:
-
VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_NV
public static final int VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_NVVkAccelerationStructureMemoryRequirementsTypeNV - Acceleration structure memory requirement typeDescription
ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_NVrequests the memory requirement for theVkAccelerationStructureNVbacking store.ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_BUILD_SCRATCH_NVrequests the memory requirement for scratch space during the initial build.ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_UPDATE_SCRATCH_NVrequests the memory requirement for scratch space during an update.
See Also
- See Also:
-
VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_BUILD_SCRATCH_NV
public static final int VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_BUILD_SCRATCH_NVVkAccelerationStructureMemoryRequirementsTypeNV - Acceleration structure memory requirement typeDescription
ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_NVrequests the memory requirement for theVkAccelerationStructureNVbacking store.ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_BUILD_SCRATCH_NVrequests the memory requirement for scratch space during the initial build.ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_UPDATE_SCRATCH_NVrequests the memory requirement for scratch space during an update.
See Also
- See Also:
-
VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_UPDATE_SCRATCH_NV
public static final int VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_UPDATE_SCRATCH_NVVkAccelerationStructureMemoryRequirementsTypeNV - Acceleration structure memory requirement typeDescription
ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_NVrequests the memory requirement for theVkAccelerationStructureNVbacking store.ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_BUILD_SCRATCH_NVrequests the memory requirement for scratch space during the initial build.ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_UPDATE_SCRATCH_NVrequests the memory requirement for scratch space during an update.
See Also
- See Also:
-
-
Method Details
-
nvkCreateAccelerationStructureNV
public static int nvkCreateAccelerationStructureNV(org.lwjgl.vulkan.VkDevice device, long pCreateInfo, long pAllocator, long pAccelerationStructure) Unsafe version of:CreateAccelerationStructureNV -
vkCreateAccelerationStructureNV
public static int vkCreateAccelerationStructureNV(org.lwjgl.vulkan.VkDevice device, VkAccelerationStructureCreateInfoNV pCreateInfo, @Nullable VkAllocationCallbacks pAllocator, LongBuffer pAccelerationStructure) Create a new acceleration structure object.C Specification
To create acceleration structures, call:
VkResult vkCreateAccelerationStructureNV( VkDevice device, const VkAccelerationStructureCreateInfoNV* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkAccelerationStructureNV* pAccelerationStructure);Description
Similarly to other objects in Vulkan, the acceleration structure creation merely creates an object with a specific “
shape” as specified by the information inVkAccelerationStructureInfoNVandcompactedSizeinpCreateInfo.Once memory has been bound to the acceleration structure using
BindAccelerationStructureMemoryNV, that memory is populated by calls toCmdBuildAccelerationStructureNVandCmdCopyAccelerationStructureNV.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)
devicemust be a validVkDevicehandlepCreateInfomust be a valid pointer to a validVkAccelerationStructureCreateInfoNVstructure- If
pAllocatoris notNULL,pAllocatormust be a valid pointer to a validVkAllocationCallbacksstructure pAccelerationStructuremust be a valid pointer to aVkAccelerationStructureNVhandle
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
device- the logical device that creates the buffer object.pCreateInfo- a pointer to aVkAccelerationStructureCreateInfoNVstructure containing parameters affecting creation of the acceleration structure.pAllocator- controls host memory allocation as described in the Memory Allocation chapter.pAccelerationStructure- a pointer to aVkAccelerationStructureNVhandle in which the resulting acceleration structure object is returned.
-
nvkDestroyAccelerationStructureNV
public static void nvkDestroyAccelerationStructureNV(org.lwjgl.vulkan.VkDevice device, long accelerationStructure, long pAllocator) Unsafe version of:DestroyAccelerationStructureNV -
vkDestroyAccelerationStructureNV
public static void vkDestroyAccelerationStructureNV(org.lwjgl.vulkan.VkDevice device, long accelerationStructure, @Nullable VkAllocationCallbacks pAllocator) Destroy an acceleration structure object.C Specification
To destroy an acceleration structure, call:
void vkDestroyAccelerationStructureNV( VkDevice device, VkAccelerationStructureNV accelerationStructure, const VkAllocationCallbacks* pAllocator);Valid Usage
- All submitted commands that refer to
accelerationStructuremust have completed execution - If
VkAllocationCallbackswere provided whenaccelerationStructurewas created, a compatible set of callbacks must be provided here - If no
VkAllocationCallbackswere provided whenaccelerationStructurewas created,pAllocatormust beNULL
Valid Usage (Implicit)
devicemust be a validVkDevicehandle- If
accelerationStructureis notNULL_HANDLE,accelerationStructuremust be a validVkAccelerationStructureNVhandle - If
pAllocatoris notNULL,pAllocatormust be a valid pointer to a validVkAllocationCallbacksstructure - If
accelerationStructureis a valid handle, it must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
accelerationStructuremust be externally synchronized
See Also
- Parameters:
device- the logical device that destroys the buffer.accelerationStructure- the acceleration structure to destroy.pAllocator- controls host memory allocation as described in the Memory Allocation chapter.
- All submitted commands that refer to
-
nvkGetAccelerationStructureMemoryRequirementsNV
public static void nvkGetAccelerationStructureMemoryRequirementsNV(org.lwjgl.vulkan.VkDevice device, long pInfo, long pMemoryRequirements) Unsafe version of:GetAccelerationStructureMemoryRequirementsNV -
vkGetAccelerationStructureMemoryRequirementsNV
public static void vkGetAccelerationStructureMemoryRequirementsNV(org.lwjgl.vulkan.VkDevice device, VkAccelerationStructureMemoryRequirementsInfoNV pInfo, VkMemoryRequirements2KHR pMemoryRequirements) Get acceleration structure memory requirements.C Specification
An acceleration structure has memory requirements for the structure object itself, scratch space for the build, and scratch space for the update.
Scratch space is allocated as a
VkBuffer, so forACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_BUILD_SCRATCH_NVandACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_UPDATE_SCRATCH_NVthepMemoryRequirements→alignmentandpMemoryRequirements→memoryTypeBitsvalues returned by this call must be filled with zero, and should be ignored by the application.To query the memory requirements, call:
void vkGetAccelerationStructureMemoryRequirementsNV( VkDevice device, const VkAccelerationStructureMemoryRequirementsInfoNV* pInfo, VkMemoryRequirements2KHR* pMemoryRequirements);Valid Usage (Implicit)
devicemust be a validVkDevicehandlepInfomust be a valid pointer to a validVkAccelerationStructureMemoryRequirementsInfoNVstructurepMemoryRequirementsmust be a valid pointer to aVkMemoryRequirements2KHRstructure
See Also
VkAccelerationStructureMemoryRequirementsInfoNV,VkMemoryRequirements2KHR- Parameters:
device- the logical device on which the acceleration structure was created.pInfo- a pointer to aVkAccelerationStructureMemoryRequirementsInfoNVstructure specifying the acceleration structure to get memory requirements for.pMemoryRequirements- a pointer to aVkMemoryRequirements2KHRstructure in which the requested acceleration structure memory requirements are returned.
-
nvkBindAccelerationStructureMemoryNV
public static int nvkBindAccelerationStructureMemoryNV(org.lwjgl.vulkan.VkDevice device, int bindInfoCount, long pBindInfos) Unsafe version of:BindAccelerationStructureMemoryNV- Parameters:
bindInfoCount- the number of elements inpBindInfos.
-
vkBindAccelerationStructureMemoryNV
public static int vkBindAccelerationStructureMemoryNV(org.lwjgl.vulkan.VkDevice device, VkBindAccelerationStructureMemoryInfoNV.Buffer pBindInfos) Bind acceleration structure memory.C Specification
To attach memory to one or more acceleration structures at a time, call:
VkResult vkBindAccelerationStructureMemoryNV( VkDevice device, uint32_t bindInfoCount, const VkBindAccelerationStructureMemoryInfoNV* pBindInfos);Valid Usage (Implicit)
devicemust be a validVkDevicehandlepBindInfosmust be a valid pointer to an array ofbindInfoCountvalidVkBindAccelerationStructureMemoryInfoNVstructuresbindInfoCountmust be greater than 0
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
device- the logical device that owns the acceleration structures and memory.pBindInfos- a pointer to an array ofVkBindAccelerationStructureMemoryInfoNVstructures describing acceleration structures and memory to bind.
-
nvkCmdBuildAccelerationStructureNV
public static void nvkCmdBuildAccelerationStructureNV(org.lwjgl.vulkan.VkCommandBuffer commandBuffer, long pInfo, long instanceData, long instanceOffset, int update, long dst, long src, long scratch, long scratchOffset) Unsafe version of:CmdBuildAccelerationStructureNV -
vkCmdBuildAccelerationStructureNV
public static void vkCmdBuildAccelerationStructureNV(org.lwjgl.vulkan.VkCommandBuffer commandBuffer, VkAccelerationStructureInfoNV pInfo, long instanceData, long instanceOffset, boolean update, long dst, long src, long scratch, long scratchOffset) Build an acceleration structure.C Specification
To build an acceleration structure call:
void vkCmdBuildAccelerationStructureNV( VkCommandBuffer commandBuffer, const VkAccelerationStructureInfoNV* pInfo, VkBuffer instanceData, VkDeviceSize instanceOffset, VkBool32 update, VkAccelerationStructureNV dst, VkAccelerationStructureNV src, VkBuffer scratch, VkDeviceSize scratchOffset);Description
Accesses to
dst,src, andscratchmust be synchronized with thePIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHRpipeline stage and an access type ofACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHRorACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR.Valid Usage
geometryCountmust be less than or equal toVkPhysicalDeviceRayTracingPropertiesNV::maxGeometryCountdstmust have been created with compatibleVkAccelerationStructureInfoNVwhereVkAccelerationStructureInfoNV::typeandVkAccelerationStructureInfoNV::flagsare identical,VkAccelerationStructureInfoNV::instanceCountandVkAccelerationStructureInfoNV::geometryCountfordstare greater than or equal to the build size and each geometry inVkAccelerationStructureInfoNV::pGeometriesfordsthas greater than or equal to the number of vertices, indices, and AABBs- If
updateisTRUE,srcmust not beNULL_HANDLE - If
updateisTRUE,srcmust have previously been constructed withBUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_NVset inVkAccelerationStructureInfoNV::flagsin the original build - If
updateisFALSE, thesizemember of theVkMemoryRequirementsstructure returned from a call toGetAccelerationStructureMemoryRequirementsNVwithVkAccelerationStructureMemoryRequirementsInfoNV::accelerationStructureset todstandVkAccelerationStructureMemoryRequirementsInfoNV::typeset toACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_BUILD_SCRATCH_NVmust be less than or equal to the size ofscratchminusscratchOffset - If
updateisTRUE, thesizemember of theVkMemoryRequirementsstructure returned from a call toGetAccelerationStructureMemoryRequirementsNVwithVkAccelerationStructureMemoryRequirementsInfoNV::accelerationStructureset todstandVkAccelerationStructureMemoryRequirementsInfoNV::typeset toACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_UPDATE_SCRATCH_NVmust be less than or equal to the size ofscratchminusscratchOffset scratchmust have been created withBUFFER_USAGE_RAY_TRACING_BIT_NVusage flag- If
instanceDatais notNULL_HANDLE,instanceDatamust have been created withBUFFER_USAGE_RAY_TRACING_BIT_NVusage flag - Each
VkAccelerationStructureInstanceKHR::accelerationStructureReferencevalue ininstanceDatamust be a valid device address containing a value obtained fromGetAccelerationStructureHandleNV - If
updateisTRUE, then objects that were previously active must not be made inactive as per Inactive Primitives and Instances - If
updateisTRUE, then objects that were previously inactive must not be made active as per Inactive Primitives and Instances - If
updateisTRUE, thesrcanddstobjects must either be the same object or not have any memory aliasing dstmust be bound completely and contiguously to a singleVkDeviceMemoryobject viaBindAccelerationStructureMemoryNV
Valid Usage (Implicit)
commandBuffermust be a validVkCommandBufferhandlepInfomust be a valid pointer to a validVkAccelerationStructureInfoNVstructure- If
instanceDatais notNULL_HANDLE,instanceDatamust be a validVkBufferhandle dstmust be a validVkAccelerationStructureNVhandle- If
srcis notNULL_HANDLE,srcmust be a validVkAccelerationStructureNVhandle scratchmust be a validVkBufferhandlecommandBuffermust be in the recording state- The
VkCommandPoolthatcommandBufferwas 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
- Each of
commandBuffer,dst,instanceData,scratch, andsrcthat are valid handles of non-ignored parameters must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffermust be externally synchronized - Host access to the
VkCommandPoolthatcommandBufferwas 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 Compute Action See Also
- Parameters:
commandBuffer- the command buffer into which the command will be recorded.pInfo- contains the shared information for the acceleration structure’s structure.instanceData- the buffer containing an array ofVkAccelerationStructureInstanceKHRstructures defining acceleration structures. This parameter must beNULLfor bottom level acceleration structures.instanceOffset- the offset in bytes (relative to the start ofinstanceData) at which the instance data is located.update- specifies whether to update thedstacceleration structure with the data insrc.dst- a pointer to the target acceleration structure for the build.src- a pointer to an existing acceleration structure that is to be used to update thedstacceleration structure.scratch- theVkBufferthat will be used as scratch memory for the build.scratchOffset- the offset in bytes relative to the start ofscratchthat will be used as a scratch memory.
-
vkCmdCopyAccelerationStructureNV
public static void vkCmdCopyAccelerationStructureNV(org.lwjgl.vulkan.VkCommandBuffer commandBuffer, long dst, long src, int mode) Copy an acceleration structure.C Specification
To copy an acceleration structure call:
void vkCmdCopyAccelerationStructureNV( VkCommandBuffer commandBuffer, VkAccelerationStructureNV dst, VkAccelerationStructureNV src, VkCopyAccelerationStructureModeKHR mode);Description
Accesses to
srcanddstmust be synchronized with thePIPELINE_STAGE_2_ACCELERATION_STRUCTURE_COPY_BIT_KHRpipeline stage or thePIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHRpipeline stage, and an access type ofACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHRorACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHRas appropriate.Valid Usage
modemust beCOPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHRorCOPY_ACCELERATION_STRUCTURE_MODE_CLONE_KHR- The source acceleration structure
srcmust have been constructed prior to the execution of this command - If
modeisCOPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR,srcmust have been constructed withBUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHRin the build - The
bufferused to createsrcmust be bound to device memory - The
bufferused to createdstmust be bound to device memory - The range of memory backing
dstthat is accessed by this command must not overlap the memory backingsrcthat is accessed by this command dstmust be bound completely and contiguously to a singleVkDeviceMemoryobject viaBindAccelerationStructureMemoryNV
Valid Usage (Implicit)
commandBuffermust be a validVkCommandBufferhandledstmust be a validVkAccelerationStructureNVhandlesrcmust be a validVkAccelerationStructureNVhandlemodemust be a validVkCopyAccelerationStructureModeKHRvaluecommandBuffermust be in the recording state- The
VkCommandPoolthatcommandBufferwas 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
- Each of
commandBuffer,dst, andsrcmust have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffermust be externally synchronized - Host access to the
VkCommandPoolthatcommandBufferwas 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 Compute Action - Parameters:
commandBuffer- the command buffer into which the command will be recorded.dst- the target acceleration structure for the copy.src- the source acceleration structure for the copy.mode- aVkCopyAccelerationStructureModeKHRvalue specifying additional operations to perform during the copy.
-
vkCmdTraceRaysNV
public static void vkCmdTraceRaysNV(org.lwjgl.vulkan.VkCommandBuffer commandBuffer, long raygenShaderBindingTableBuffer, long raygenShaderBindingOffset, long missShaderBindingTableBuffer, long missShaderBindingOffset, long missShaderBindingStride, long hitShaderBindingTableBuffer, long hitShaderBindingOffset, long hitShaderBindingStride, long callableShaderBindingTableBuffer, long callableShaderBindingOffset, long callableShaderBindingStride, int width, int height, int depth) Initialize a ray tracing dispatch.C Specification
To dispatch ray tracing use:
void vkCmdTraceRaysNV( VkCommandBuffer commandBuffer, VkBuffer raygenShaderBindingTableBuffer, VkDeviceSize raygenShaderBindingOffset, VkBuffer missShaderBindingTableBuffer, VkDeviceSize missShaderBindingOffset, VkDeviceSize missShaderBindingStride, VkBuffer hitShaderBindingTableBuffer, VkDeviceSize hitShaderBindingOffset, VkDeviceSize hitShaderBindingStride, VkBuffer callableShaderBindingTableBuffer, VkDeviceSize callableShaderBindingOffset, VkDeviceSize callableShaderBindingStride, uint32_t width, uint32_t height, uint32_t depth);Description
When the command is executed, a ray generation group of
width × height × depthrays is assembled.Valid Usage
- If a
VkSamplercreated withmagFilterorminFilterequal toFILTER_LINEAR,reductionModeequal toSAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE, andcompareEnableequal toFALSEis used to sample aVkImageViewas a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT - If a
VkSamplercreated withmagFilterorminFilterequal toFILTER_LINEARandreductionModeequal to eitherSAMPLER_REDUCTION_MODE_MINorSAMPLER_REDUCTION_MODE_MAXis used to sample aVkImageViewas a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT - If a
VkSamplercreated withmipmapModeequal toSAMPLER_MIPMAP_MODE_LINEAR,reductionModeequal toSAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE, andcompareEnableequal toFALSEis used to sample aVkImageViewas a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT - If a
VkSamplercreated withmipmapModeequal toSAMPLER_MIPMAP_MODE_LINEARandreductionModeequal to eitherSAMPLER_REDUCTION_MODE_MINorSAMPLER_REDUCTION_MODE_MAXis used to sample aVkImageViewas a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT - If a
VkSamplercreated withunnormalizedCoordinatesequal toTRUEis used to sample aVkImageViewas a result of this command, then the image view’slevelCountandlayerCountmust be 1 - If a
VkSamplercreated withunnormalizedCoordinatesequal toTRUEis used to sample aVkImageViewas a result of this command, then the image view’sviewTypemust beIMAGE_VIEW_TYPE_1DorIMAGE_VIEW_TYPE_2D - If a
VkSamplercreated withunnormalizedCoordinatesequal toTRUEis used to sample aVkImageViewas a result of this command, then the sampler must not be used with any of the SPIR-VOpImageSample*orOpImageSparseSample*instructions withImplicitLod,DreforProjin their name - If a
VkSamplercreated withunnormalizedCoordinatesequal toTRUEis used to sample aVkImageViewas a result of this command, then the sampler must not be used with any of the SPIR-VOpImageSample*orOpImageSparseSample*instructions that includes a LOD bias or any offset values - If a
VkImageViewis sampled with depth comparison, the image view’s format features must containFORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT - If a
VkImageViewis accessed using atomic operations as a result of this command, then the image view’s format features must containFORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT - If a
DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFERdescriptor is accessed using atomic operations as a result of this command, then the storage texel buffer’s format features must containFORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT - If a
VkImageViewis sampled withFILTER_CUBIC_EXTas a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT - If the
VK_EXT_filter_cubicextension is not enabled and anyVkImageViewis sampled withFILTER_CUBIC_EXTas a result of this command, it must not have aVkImageViewTypeofIMAGE_VIEW_TYPE_3D,IMAGE_VIEW_TYPE_CUBE, orIMAGE_VIEW_TYPE_CUBE_ARRAY - Any
VkImageViewbeing sampled withFILTER_CUBIC_EXTas a result of this command must have aVkImageViewTypeand format that supports cubic filtering, as specified byVkFilterCubicImageViewImageFormatPropertiesEXT::filterCubicreturned byGetPhysicalDeviceImageFormatProperties2 - Any
VkImageViewbeing sampled withFILTER_CUBIC_EXTwith a reduction mode of eitherSAMPLER_REDUCTION_MODE_MINorSAMPLER_REDUCTION_MODE_MAXas a result of this command must have aVkImageViewTypeand format that supports cubic filtering together with minmax filtering, as specified byVkFilterCubicImageViewImageFormatPropertiesEXT::filterCubicMinmaxreturned byGetPhysicalDeviceImageFormatProperties2 - If the
cubicRangeClampfeature is not enabled, then anyVkImageViewbeing sampled withFILTER_CUBIC_EXTas a result of this command must not have aVkSamplerReductionModeCreateInfo::reductionModeequal toSAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_RANGECLAMP_QCOM - Any
VkImageViewbeing sampled with aVkSamplerReductionModeCreateInfo::reductionModeequal toSAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_RANGECLAMP_QCOMas a result of this command must sample withFILTER_CUBIC_EXT - If the
selectableCubicWeightsfeature is not enabled, then anyVkImageViewbeing sampled withFILTER_CUBIC_EXTas a result of this command must haveVkSamplerCubicWeightsCreateInfoQCOM::cubicWeightsequal toCUBIC_FILTER_WEIGHTS_CATMULL_ROM_QCOM - Any
VkImagecreated with aVkImageCreateInfo::flagscontainingIMAGE_CREATE_CORNER_SAMPLED_BIT_NVsampled as a result of this command must only be sampled using aVkSamplerAddressModeofSAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE - For any
VkImageViewbeing written as a storage image where the image format field of theOpTypeImageisUnknown, the view’s format features must containFORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT - For any
VkImageViewbeing read as a storage image where the image format field of theOpTypeImageisUnknown, the view’s format features must containFORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT - For any
VkBufferViewbeing written as a storage texel buffer where the image format field of theOpTypeImageisUnknown, the view’s buffer features must containFORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT - Any
VkBufferViewbeing read as a storage texel buffer where the image format field of theOpTypeImageisUnknownthen the view’s buffer features must containFORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT - For each set n that is statically used by a bound shader, a descriptor set must have been bound to n at the same pipeline bind point, with a
VkPipelineLayoutthat is compatible for set n, with theVkPipelineLayoutused to create the currentVkPipelineor theVkDescriptorSetLayoutarray used to create the currentVkShaderEXT, as described in Pipeline Layout Compatibility - For each push constant that is statically used by a bound shader, a push constant value must have been set for the same pipeline bind point, with a
VkPipelineLayoutthat is compatible for push constants, with theVkPipelineLayoutused to create the currentVkPipelineor theVkDescriptorSetLayoutarray used to create the currentVkShaderEXT, as described in Pipeline Layout Compatibility - For each array of resources that is used by a bound shader, the indices used to access members of the array must be less than the descriptor count for the identified binding in the descriptor sets used by this command
- If the
maintenance4feature is not enabled, then for each push constant that is statically used by a bound shader, a push constant value must have been set for the same pipeline bind point, with aVkPipelineLayoutthat is compatible for push constants, with theVkPipelineLayoutused to create the currentVkPipelineor theVkDescriptorSetLayoutandVkPushConstantRangearrays used to create the currentVkShaderEXT, as described in Pipeline Layout Compatibility - Descriptors in each bound descriptor set, specified via
CmdBindDescriptorSets, must be valid as described by descriptor validity if they are statically used by theVkPipelinebound to the pipeline bind point used by this command and the boundVkPipelinewas not created withPIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT - If the descriptors used by the
VkPipelinebound to the pipeline bind point were specified viaCmdBindDescriptorSets, the boundVkPipelinemust have been created withoutPIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT - Descriptors in bound descriptor buffers, specified via
CmdSetDescriptorBufferOffsetsEXT, must be valid if they are dynamically used by theVkPipelinebound to the pipeline bind point used by this command and the boundVkPipelinewas created withPIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT - Descriptors in bound descriptor buffers, specified via
CmdSetDescriptorBufferOffsetsEXT, must be valid if they are dynamically used by anyVkShaderEXTbound to a stage corresponding to the pipeline bind point used by this command - If the descriptors used by the
VkPipelinebound to the pipeline bind point were specified viaCmdSetDescriptorBufferOffsetsEXT, the boundVkPipelinemust have been created withPIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT - If a descriptor is dynamically used with a
VkPipelinecreated withPIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT, the descriptor memory must be resident - If a descriptor is dynamically used with a
VkShaderEXTcreated with aVkDescriptorSetLayoutthat was created withDESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT, the descriptor memory must be resident - If the
shaderObjectfeature is not enabled, a valid pipeline must be bound to the pipeline bind point used by this command - If a pipeline is bound to the pipeline bind point used by this command, there must not have been any calls to dynamic state setting commands for any state specified statically in the
VkPipelineobject bound to the pipeline bind point used by this command, since that pipeline was bound - If the
shaderObjectfeature is enabled, either a valid pipeline must be bound to the pipeline bind point used by this command, or a valid combination of valid andNULL_HANDLEshader objects must be bound to every supported shader stage corresponding to the pipeline bind point used by this command - If any stage of the
VkPipelineobject bound to the pipeline bind point used by this command accesses a uniform buffer, and that stage was created without enabling eitherPIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESSorPIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_2foruniformBuffers, and therobustBufferAccessfeature is not enabled, that stage must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point - If the
robustBufferAccessfeature is not enabled, and anyVkShaderEXTbound to a stage corresponding to the pipeline bind point used by this command accesses a uniform buffer, it must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point - If any stage of the
VkPipelineobject bound to the pipeline bind point used by this command accesses a storage buffer, and that stage was created without enabling eitherPIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESSorPIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_2forstorageBuffers, and therobustBufferAccessfeature is not enabled, that stage must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point - If the
robustBufferAccessfeature is not enabled, and anyVkShaderEXTbound to a stage corresponding to the pipeline bind point used by this command accesses a storage buffer, it must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point - If
commandBufferis an unprotected command buffer andprotectedNoFaultis not supported, any resource accessed by bound shaders must not be a protected resource - If a bound shader accesses a
VkSamplerorVkImageViewobject that enables sampler Y′CBCR conversion, that object must only be used withOpImageSample*orOpImageSparseSample*instructions - If a bound shader accesses a
VkSamplerorVkImageViewobject that enables sampler Y′CBCR conversion, that object must not use theConstOffsetandOffsetoperands - If a
VkImageViewis accessed as a result of this command, then the image view’sviewTypemust match theDimoperand of theOpTypeImageas described in Compatibility Between SPIR-V Image Dimensions and Vulkan ImageView Types - If a
VkImageViewis accessed as a result of this command, then the numeric type of the image view’sformatand theSampledTypeoperand of theOpTypeImagemust match - If a
VkImageViewcreated with a format other thanFORMAT_A8_UNORMis accessed usingOpImageWriteas a result of this command, then theTypeof theTexeloperand of that instruction must have at least as many components as the image view’s format - If a
VkImageViewcreated with the formatFORMAT_A8_UNORMis accessed usingOpImageWriteas a result of this command, then theTypeof theTexeloperand of that instruction must have four components - If a
VkBufferViewis accessed usingOpImageWriteas a result of this command, then theTypeof theTexeloperand of that instruction must have at least as many components as the buffer view’s format - If a
VkImageViewwith aVkFormatthat has a 64-bit component width is accessed as a result of this command, theSampledTypeof theOpTypeImageoperand of that instruction must have aWidthof 64 - If a
VkImageViewwith aVkFormatthat has a component width less than 64-bit is accessed as a result of this command, theSampledTypeof theOpTypeImageoperand of that instruction must have aWidthof 32 - If a
VkBufferViewwith aVkFormatthat has a 64-bit component width is accessed as a result of this command, theSampledTypeof theOpTypeImageoperand of that instruction must have aWidthof 64 - If a
VkBufferViewwith aVkFormatthat has a component width less than 64-bit is accessed as a result of this command, theSampledTypeof theOpTypeImageoperand of that instruction must have aWidthof 32 - If the
sparseImageInt64Atomicsfeature is not enabled,VkImageobjects created with theIMAGE_CREATE_SPARSE_RESIDENCY_BITflag must not be accessed by atomic instructions through anOpTypeImagewith aSampledTypewith aWidthof 64 by this command - If the
sparseImageInt64Atomicsfeature is not enabled,VkBufferobjects created with theBUFFER_CREATE_SPARSE_RESIDENCY_BITflag must not be accessed by atomic instructions through anOpTypeImagewith aSampledTypewith aWidthof 64 by this command - If
OpImageWeightedSampleQCOMis used to sample aVkImageViewas a result of this command, then the image view’s format features must containFORMAT_FEATURE_2_WEIGHT_SAMPLED_IMAGE_BIT_QCOM - If
OpImageWeightedSampleQCOMuses aVkImageViewas a sample weight image as a result of this command, then the image view’s format features must containFORMAT_FEATURE_2_WEIGHT_IMAGE_BIT_QCOM - If
OpImageBoxFilterQCOMis used to sample aVkImageViewas a result of this command, then the image view’s format features must containFORMAT_FEATURE_2_BOX_FILTER_SAMPLED_BIT_QCOM - If
OpImageBlockMatchSSDQCOMis used to read from anVkImageViewas a result of this command, then the image view’s format features must containFORMAT_FEATURE_2_BLOCK_MATCHING_BIT_QCOM - If
OpImageBlockMatchSADQCOMis used to read from anVkImageViewas a result of this command, then the image view’s format features must containFORMAT_FEATURE_2_BLOCK_MATCHING_BIT_QCOM - If
OpImageBlockMatchSADQCOMor OpImageBlockMatchSSDQCOM is used to read from a reference image as result of this command, then the specified reference coordinates must not fail integer texel coordinate validation - If
OpImageWeightedSampleQCOM,OpImageBoxFilterQCOM,OpImageBlockMatchWindowSSDQCOM,OpImageBlockMatchWindowSADQCOM,OpImageBlockMatchGatherSSDQCOM,OpImageBlockMatchGatherSADQCOM,OpImageBlockMatchSSDQCOM, orOpImageBlockMatchSADQCOMuses aVkSampleras a result of this command, then the sampler must have been created withSAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM - If any command other than
OpImageWeightedSampleQCOM,OpImageBoxFilterQCOM,OpImageBlockMatchWindowSSDQCOM,OpImageBlockMatchWindowSADQCOM,OpImageBlockMatchGatherSSDQCOM,OpImageBlockMatchGatherSADQCOM,OpImageBlockMatchSSDQCOM, orOpImageBlockMatchSADQCOMuses aVkSampleras a result of this command, then the sampler must not have been created withSAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM - If a
OpImageBlockMatchWindow*QCOMorOpImageBlockMatchGather*QCOMinstruction is used to read from anVkImageViewas a result of this command, then the image view’s format features must containFORMAT_FEATURE_2_BLOCK_MATCHING_BIT_QCOM - If a
OpImageBlockMatchWindow*QCOMorOpImageBlockMatchGather*QCOMinstruction is used to read from anVkImageViewas a result of this command, then the image view’s format must be a single-component format - If a
OpImageBlockMatchWindow*QCOMorOpImageBlockMatchGather*QCOMread from a reference image as result of this command, then the specified reference coordinates must not fail integer texel coordinate validation - Any shader invocation executed by this command must terminate
- If a descriptor with type equal to any of
DESCRIPTOR_TYPE_SAMPLE_WEIGHT_IMAGE_QCOM,DESCRIPTOR_TYPE_BLOCK_MATCH_IMAGE_QCOM,DESCRIPTOR_TYPE_SAMPLED_IMAGE,DESCRIPTOR_TYPE_STORAGE_IMAGE, orDESCRIPTOR_TYPE_INPUT_ATTACHMENTis accessed as a result of this command, the image subresource identified by that descriptor must be in the image layout identified when the descriptor was written - Any shader group handle referenced by this call must have been queried from the bound ray tracing pipeline
- If the bound ray tracing pipeline state was created with the
DYNAMIC_STATE_RAY_TRACING_PIPELINE_STACK_SIZE_KHRdynamic state enabled thenCmdSetRayTracingPipelineStackSizeKHRmust have been called in the current command buffer prior to this trace command commandBuffermust not be a protected command buffer- This command must not cause a pipeline trace ray instruction to be executed from a shader invocation with a recursion depth greater than the value of
maxRecursionDepthused to create the bound ray tracing pipeline - If
raygenShaderBindingTableBufferis non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemoryobject raygenShaderBindingOffsetmust be less than the size ofraygenShaderBindingTableBufferraygenShaderBindingOffsetmust be a multiple ofVkPhysicalDeviceRayTracingPropertiesNV::shaderGroupBaseAlignment- If
missShaderBindingTableBufferis non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemoryobject missShaderBindingOffsetmust be less than the size ofmissShaderBindingTableBuffermissShaderBindingOffsetmust be a multiple ofVkPhysicalDeviceRayTracingPropertiesNV::shaderGroupBaseAlignment- If
hitShaderBindingTableBufferis non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemoryobject hitShaderBindingOffsetmust be less than the size ofhitShaderBindingTableBufferhitShaderBindingOffsetmust be a multiple ofVkPhysicalDeviceRayTracingPropertiesNV::shaderGroupBaseAlignment- If
callableShaderBindingTableBufferis non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemoryobject callableShaderBindingOffsetmust be less than the size ofcallableShaderBindingTableBuffercallableShaderBindingOffsetmust be a multiple ofVkPhysicalDeviceRayTracingPropertiesNV::shaderGroupBaseAlignmentmissShaderBindingStridemust be a multiple ofVkPhysicalDeviceRayTracingPropertiesNV::shaderGroupHandleSizehitShaderBindingStridemust be a multiple ofVkPhysicalDeviceRayTracingPropertiesNV::shaderGroupHandleSizecallableShaderBindingStridemust be a multiple ofVkPhysicalDeviceRayTracingPropertiesNV::shaderGroupHandleSizemissShaderBindingStridemust be less than or equal toVkPhysicalDeviceRayTracingPropertiesNV::maxShaderGroupStridehitShaderBindingStridemust be less than or equal toVkPhysicalDeviceRayTracingPropertiesNV::maxShaderGroupStridecallableShaderBindingStridemust be less than or equal toVkPhysicalDeviceRayTracingPropertiesNV::maxShaderGroupStridewidthmust be less than or equal toVkPhysicalDeviceLimits::maxComputeWorkGroupCount[0]heightmust be less than or equal toVkPhysicalDeviceLimits::maxComputeWorkGroupCount[1]depthmust be less than or equal toVkPhysicalDeviceLimits::maxComputeWorkGroupCount[2]
Valid Usage (Implicit)
commandBuffermust be a validVkCommandBufferhandleraygenShaderBindingTableBuffermust be a validVkBufferhandle- If
missShaderBindingTableBufferis notNULL_HANDLE,missShaderBindingTableBuffermust be a validVkBufferhandle - If
hitShaderBindingTableBufferis notNULL_HANDLE,hitShaderBindingTableBuffermust be a validVkBufferhandle - If
callableShaderBindingTableBufferis notNULL_HANDLE,callableShaderBindingTableBuffermust be a validVkBufferhandle commandBuffermust be in the recording state- The
VkCommandPoolthatcommandBufferwas 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
- Each of
callableShaderBindingTableBuffer,commandBuffer,hitShaderBindingTableBuffer,missShaderBindingTableBuffer, andraygenShaderBindingTableBufferthat are valid handles of non-ignored parameters must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffermust be externally synchronized - Host access to the
VkCommandPoolthatcommandBufferwas 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 Compute Action - Parameters:
commandBuffer- the command buffer into which the command will be recorded.raygenShaderBindingTableBuffer- the buffer object that holds the shader binding table data for the ray generation shader stage.raygenShaderBindingOffset- the offset in bytes (relative toraygenShaderBindingTableBuffer) of the ray generation shader being used for the trace.missShaderBindingTableBuffer- the buffer object that holds the shader binding table data for the miss shader stage.missShaderBindingOffset- the offset in bytes (relative tomissShaderBindingTableBuffer) of the miss shader being used for the trace.missShaderBindingStride- the size in bytes of each shader binding table record inmissShaderBindingTableBuffer.hitShaderBindingTableBuffer- the buffer object that holds the shader binding table data for the hit shader stages.hitShaderBindingOffset- the offset in bytes (relative tohitShaderBindingTableBuffer) of the hit shader group being used for the trace.hitShaderBindingStride- the size in bytes of each shader binding table record inhitShaderBindingTableBuffer.callableShaderBindingTableBuffer- the buffer object that holds the shader binding table data for the callable shader stage.callableShaderBindingOffset- the offset in bytes (relative tocallableShaderBindingTableBuffer) of the callable shader being used for the trace.callableShaderBindingStride- the size in bytes of each shader binding table record incallableShaderBindingTableBuffer.width- the width of the ray trace query dimensions.height- height of the ray trace query dimensions.depth- depth of the ray trace query dimensions.
- If a
-
nvkCreateRayTracingPipelinesNV
public static int nvkCreateRayTracingPipelinesNV(org.lwjgl.vulkan.VkDevice device, long pipelineCache, int createInfoCount, long pCreateInfos, long pAllocator, long pPipelines) Unsafe version of:CreateRayTracingPipelinesNV- Parameters:
createInfoCount- the length of thepCreateInfosandpPipelinesarrays.
-
vkCreateRayTracingPipelinesNV
public static int vkCreateRayTracingPipelinesNV(org.lwjgl.vulkan.VkDevice device, long pipelineCache, VkRayTracingPipelineCreateInfoNV.Buffer pCreateInfos, @Nullable VkAllocationCallbacks pAllocator, LongBuffer pPipelines) Creates a new ray tracing pipeline object.C Specification
To create ray tracing pipelines, call:
VkResult vkCreateRayTracingPipelinesNV( VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoNV* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines);Description
Pipelines are created and returned as described for Multiple Pipeline Creation.
Valid Usage
devicemust support at least one queue family with theQUEUE_COMPUTE_BITcapability- If the
flagsmember of any element ofpCreateInfoscontains thePIPELINE_CREATE_DERIVATIVE_BITflag, and thebasePipelineIndexmember of that same element is not-1,basePipelineIndexmust be less than the index intopCreateInfosthat corresponds to that element - If the
flagsmember of any element ofpCreateInfoscontains thePIPELINE_CREATE_DERIVATIVE_BITflag, the base pipeline must have been created with thePIPELINE_CREATE_ALLOW_DERIVATIVES_BITflag set flagsmust not contain thePIPELINE_CREATE_DISPATCH_BASEflag- If
pipelineCachewas created withPIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT, host access topipelineCachemust be externally synchronized
- If
VkPipelineBinaryInfoKHR::binaryCountis not 0 for any element ofpCreateInfos,pipelineCachemust beNULL_HANDLE - If a
VkPipelineCreateFlags2CreateInfoKHRstructure with thePIPELINE_CREATE_2_CAPTURE_DATA_BIT_KHRflag set is included in thepNextchain of any element ofpCreateInfos,pipelineCachemust beNULL_HANDLE - If
VkPipelineBinaryInfoKHR::binaryCountis not 0 for any element ofpCreateInfos,PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BITmust not be set in theflagsof that element - If
VkPipelineBinaryInfoKHR::binaryCountis not 0 for any element ofpCreateInfos,PIPELINE_CREATION_FEEDBACK_BASE_PIPELINE_ACCELERATION_BITmust not be set in theflagsof that element - If
VkPipelineBinaryInfoKHR::binaryCountis not 0 for any element ofpCreateInfos,PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT_EXTmust not be set in theflagsof that element - If a
VkPipelineCreateFlags2CreateInfoKHRstructure is included in thepNextchain of any element ofpCreateInfos,PIPELINE_CREATE_2_CAPTURE_DATA_BIT_KHRflag must not be set
Valid Usage (Implicit)
devicemust be a validVkDevicehandle- If
pipelineCacheis notNULL_HANDLE,pipelineCachemust be a validVkPipelineCachehandle pCreateInfosmust be a valid pointer to an array ofcreateInfoCountvalidVkRayTracingPipelineCreateInfoNVstructures- If
pAllocatoris notNULL,pAllocatormust be a valid pointer to a validVkAllocationCallbacksstructure pPipelinesmust be a valid pointer to an array ofcreateInfoCountVkPipelinehandlescreateInfoCountmust be greater than 0- If
pipelineCacheis a valid handle, it must have been created, allocated, or retrieved fromdevice
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
device- the logical device that creates the ray tracing pipelines.pipelineCache- eitherNULL_HANDLE, indicating that pipeline caching is disabled, or the handle of a valid pipeline cache object, in which case use of that cache is enabled for the duration of the command.pCreateInfos- a pointer to an array ofVkRayTracingPipelineCreateInfoNVstructures.pAllocator- controls host memory allocation as described in the Memory Allocation chapter.pPipelines- a pointer to an array in which the resulting ray tracing pipeline objects are returned.
-
nvkGetRayTracingShaderGroupHandlesNV
public static int nvkGetRayTracingShaderGroupHandlesNV(org.lwjgl.vulkan.VkDevice device, long pipeline, int firstGroup, int groupCount, long dataSize, long pData) Unsafe version of:GetRayTracingShaderGroupHandlesNV- Parameters:
dataSize- the size in bytes of the buffer pointed to bypData.
-
vkGetRayTracingShaderGroupHandlesNV
public static int vkGetRayTracingShaderGroupHandlesNV(org.lwjgl.vulkan.VkDevice device, long pipeline, int firstGroup, int groupCount, ByteBuffer pData) - Parameters:
device- the logical device containing the ray tracing pipeline.pipeline- the ray tracing pipeline object containing the shaders.firstGroup- the index of the first group to retrieve a handle for from theVkRayTracingPipelineCreateInfoKHR::pGroupsorVkRayTracingPipelineCreateInfoNV::pGroupsarray.groupCount- the number of shader handles to retrieve.pData- a pointer to an application-allocated buffer where the results will be written.
-
nvkGetAccelerationStructureHandleNV
public static int nvkGetAccelerationStructureHandleNV(org.lwjgl.vulkan.VkDevice device, long accelerationStructure, long dataSize, long pData) Unsafe version of:GetAccelerationStructureHandleNV- Parameters:
dataSize- the size in bytes of the buffer pointed to bypData.
-
vkGetAccelerationStructureHandleNV
public static int vkGetAccelerationStructureHandleNV(org.lwjgl.vulkan.VkDevice device, long accelerationStructure, ByteBuffer pData) Get opaque acceleration structure handle.C Specification
To allow constructing geometry instances with device code if desired, we need to be able to query an opaque handle for an acceleration structure. This handle is a value of 8 bytes. To get this handle, call:
VkResult vkGetAccelerationStructureHandleNV( VkDevice device, VkAccelerationStructureNV accelerationStructure, size_t dataSize, void* pData);Valid Usage
dataSizemust be large enough to contain the result of the query, as described aboveaccelerationStructuremust be bound completely and contiguously to a singleVkDeviceMemoryobject viaBindAccelerationStructureMemoryNV
Valid Usage (Implicit)
devicemust be a validVkDevicehandleaccelerationStructuremust be a validVkAccelerationStructureNVhandlepDatamust be a valid pointer to an array ofdataSizebytesdataSizemust be greater than 0accelerationStructuremust have been created, allocated, or retrieved fromdevice
Return Codes
- On success, this command returns
- On failure, this command returns
- Parameters:
device- the logical device that owns the acceleration structures.accelerationStructure- the acceleration structure.pData- a pointer to an application-allocated buffer where the results will be written.
-
vkGetAccelerationStructureHandleNV
public static int vkGetAccelerationStructureHandleNV(org.lwjgl.vulkan.VkDevice device, long accelerationStructure, LongBuffer pData) Get opaque acceleration structure handle.C Specification
To allow constructing geometry instances with device code if desired, we need to be able to query an opaque handle for an acceleration structure. This handle is a value of 8 bytes. To get this handle, call:
VkResult vkGetAccelerationStructureHandleNV( VkDevice device, VkAccelerationStructureNV accelerationStructure, size_t dataSize, void* pData);Valid Usage
dataSizemust be large enough to contain the result of the query, as described aboveaccelerationStructuremust be bound completely and contiguously to a singleVkDeviceMemoryobject viaBindAccelerationStructureMemoryNV
Valid Usage (Implicit)
devicemust be a validVkDevicehandleaccelerationStructuremust be a validVkAccelerationStructureNVhandlepDatamust be a valid pointer to an array ofdataSizebytesdataSizemust be greater than 0accelerationStructuremust have been created, allocated, or retrieved fromdevice
Return Codes
- On success, this command returns
- On failure, this command returns
- Parameters:
device- the logical device that owns the acceleration structures.accelerationStructure- the acceleration structure.pData- a pointer to an application-allocated buffer where the results will be written.
-
nvkCmdWriteAccelerationStructuresPropertiesNV
public static void nvkCmdWriteAccelerationStructuresPropertiesNV(org.lwjgl.vulkan.VkCommandBuffer commandBuffer, int accelerationStructureCount, long pAccelerationStructures, int queryType, long queryPool, int firstQuery) Unsafe version of:CmdWriteAccelerationStructuresPropertiesNV- Parameters:
accelerationStructureCount- the count of acceleration structures for which to query the property.
-
vkCmdWriteAccelerationStructuresPropertiesNV
public static void vkCmdWriteAccelerationStructuresPropertiesNV(org.lwjgl.vulkan.VkCommandBuffer commandBuffer, LongBuffer pAccelerationStructures, int queryType, long queryPool, int firstQuery) Write acceleration structure result parameters to query results.C Specification
To query acceleration structure size parameters call:
void vkCmdWriteAccelerationStructuresPropertiesNV( VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount, const VkAccelerationStructureNV* pAccelerationStructures, VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery);Description
Accesses to any of the acceleration structures listed in
pAccelerationStructuresmust be synchronized with thePIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHRpipeline stage and an access type ofACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR.Valid Usage
queryPoolmust have been created with aqueryTypematchingqueryType- The queries identified by
queryPoolandfirstQuerymust be unavailable accelerationStructuremust be bound completely and contiguously to a singleVkDeviceMemoryobject viaBindAccelerationStructureMemoryNV- All acceleration structures in
pAccelerationStructuresmust have been built prior to the execution of this command - All acceleration structures in
pAccelerationStructuresmust have been built withBUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHRifqueryTypeisQUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_NV queryTypemust beQUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_NV
Valid Usage (Implicit)
commandBuffermust be a validVkCommandBufferhandlepAccelerationStructuresmust be a valid pointer to an array ofaccelerationStructureCountvalidVkAccelerationStructureNVhandlesqueryTypemust be a validVkQueryTypevaluequeryPoolmust be a validVkQueryPoolhandlecommandBuffermust be in the recording state- The
VkCommandPoolthatcommandBufferwas 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
accelerationStructureCountmust be greater than 0- Each of
commandBuffer,queryPool, and the elements ofpAccelerationStructuresmust have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffermust be externally synchronized - Host access to the
VkCommandPoolthatcommandBufferwas 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 Compute Action - Parameters:
commandBuffer- the command buffer into which the command will be recorded.pAccelerationStructures- a pointer to an array of existing previously built acceleration structures.queryType- aVkQueryTypevalue specifying the type of queries managed by the pool.queryPool- the query pool that will manage the results of the query.firstQuery- the first query index within the query pool that will contain theaccelerationStructureCountnumber of results.
-
vkCompileDeferredNV
public static int vkCompileDeferredNV(org.lwjgl.vulkan.VkDevice device, long pipeline, int shader) Deferred compilation of shaders.C Specification
To compile a deferred shader in a pipeline call:
VkResult vkCompileDeferredNV( VkDevice device, VkPipeline pipeline, uint32_t shader);Valid Usage
pipelinemust be a ray tracing pipelinepipelinemust have been created withPIPELINE_CREATE_DEFER_COMPILE_BIT_NVshadermust not have been called as a deferred compile before
Valid Usage (Implicit)
devicemust be a validVkDevicehandlepipelinemust be a validVkPipelinehandlepipelinemust have been created, allocated, or retrieved fromdevice
Return Codes
- On success, this command returns
- On failure, this command returns
- Parameters:
device- the logical device containing the ray tracing pipeline.pipeline- the ray tracing pipeline object containing the shaders.shader- the index of the shader to compile.
-
vkCreateAccelerationStructureNV
public static int vkCreateAccelerationStructureNV(org.lwjgl.vulkan.VkDevice device, VkAccelerationStructureCreateInfoNV pCreateInfo, @Nullable VkAllocationCallbacks pAllocator, long[] pAccelerationStructure) Array version of:CreateAccelerationStructureNV -
vkCreateRayTracingPipelinesNV
public static int vkCreateRayTracingPipelinesNV(org.lwjgl.vulkan.VkDevice device, long pipelineCache, VkRayTracingPipelineCreateInfoNV.Buffer pCreateInfos, @Nullable VkAllocationCallbacks pAllocator, long[] pPipelines) Array version of:CreateRayTracingPipelinesNV -
vkGetAccelerationStructureHandleNV
public static int vkGetAccelerationStructureHandleNV(org.lwjgl.vulkan.VkDevice device, long accelerationStructure, long[] pData) Array version of:GetAccelerationStructureHandleNV -
vkCmdWriteAccelerationStructuresPropertiesNV
public static void vkCmdWriteAccelerationStructuresPropertiesNV(org.lwjgl.vulkan.VkCommandBuffer commandBuffer, long[] pAccelerationStructures, int queryType, long queryPool, int firstQuery) Array version of:CmdWriteAccelerationStructuresPropertiesNV
-