mirror of
https://github.com/status-im/Vulkan-Docs.git
synced 2025-02-25 12:35:11 +00:00
* Update release number to 120. Github Issues: * Add slink:VkAccelerationStructureTypeNV explicitly to extension XML for `<<VK_NV_ray_tracing>>` (public issue 848). * Add missing valid usage statements for feature flags in slink:VkCommandBufferInheritanceInfo (public pull request 1017). Internal Issues: * Clarify behavior of non-premultiplied destination colors for `<<VK_EXT_blend_operation_advanced>>` prior to the definition of slink:VkBlendOverlapEXT (internal issue 1766). * Fix the confusing phrasing "`no other queue must: be (doing something)`" for flink:vkQueuePresentKHR, flink:vkQueueSubmit, and flink:vkQueueBindSparse (internal issue 1774). * Add `<<VK_EXT_validation_features>>` flag to enable best practices checks, which will soon be available in the validation layer (internal issue 1779). * Specify allowed characters for VUID tag name components in the style guide (internal issue 1788). * Update links to SPIR-V extension specifications, and parameterize their markup in case the URLs change in the future (internal issue 1797). * Fix an off-by-one error in the valid usage statement for slink:VkPipelineExecutableInfoKHR (internal merge request 3303). * Clean up markup indentation not matching the style guide (internal merge request 3314). * Minor script updates to allow refpage aliases, generate a dynamic TOC for refpages, generate Apache rewrite rules for aliases, open external links from refpages in a new window, and synchronize with the OpenCL scripts. This will shortly enable a paned navigation setup for refpages, similar to the OpenCL 2.2 refpages (internal merge request 3322). * Script updates to add tests to the checker, refactor and reformat code, generate better text for some valid usage statements, use more Pythonic idioms, and synchronize with the OpenXR scripts (internal merge request 3239). * Script updates and minor fixes in spec language to not raise checker errors for refpage markup of pages not existing in the API, such as VKAPI_NO_STDINT_H. Remove corresponding suppression of some check_spec_links.py tests from .gitlab-ci.yml and 'allchecks' target (internal merge request 3315).
198 lines
7.2 KiB
Plaintext
198 lines
7.2 KiB
Plaintext
include::meta/VK_NV_ray_tracing.txt[]
|
|
|
|
*Last Modified Date*::
|
|
2018-11-20
|
|
|
|
*Interactions and External Dependencies*::
|
|
- This extension requires the
|
|
{spirv}/NV/SPV_NV_ray_tracing.html[`SPV_NV_ray_tracing`] SPIR-V
|
|
extension.
|
|
- This extension requires the
|
|
https://github.com/KhronosGroup/GLSL/blob/master/extensions/nv/GLSL_NV_ray_tracing.txt[`GL_NV_ray_tracing`]
|
|
extension for GLSL source languages.
|
|
|
|
*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
|
|
|
|
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
|
|
|
|
* slink:VkAccelerationStructureNV
|
|
|
|
=== New Enum Constants
|
|
|
|
* Extending elink:VkStructureType:
|
|
** ename:VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NV
|
|
** ename:VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NV
|
|
** ename:VK_STRUCTURE_TYPE_GEOMETRY_NV
|
|
** ename:VK_STRUCTURE_TYPE_GEOMETRY_TRIANGLES_NV
|
|
** ename:VK_STRUCTURE_TYPE_GEOMETRY_AABB_NV
|
|
** ename:VK_STRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NV
|
|
** ename:VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV
|
|
** ename:VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NV
|
|
** ename:VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV
|
|
** ename:VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV
|
|
** ename:VK_STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NV
|
|
* Extending elink:VkShaderStageFlagBits:
|
|
** ename:VK_SHADER_STAGE_RAYGEN_BIT_NV
|
|
** ename:VK_SHADER_STAGE_ANY_HIT_BIT_NV
|
|
** ename:VK_SHADER_STAGE_CLOSEST_HIT_BIT_NV
|
|
** ename:VK_SHADER_STAGE_MISS_BIT_NV
|
|
** ename:VK_SHADER_STAGE_INTERSECTION_BIT_NV
|
|
** ename:VK_SHADER_STAGE_CALLABLE_BIT_NV
|
|
* Extending elink:VkPipelineStageFlagBits:
|
|
** ename:VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_NV
|
|
** ename:VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_NV
|
|
* Extending elink:VkBufferUsageFlagBits:
|
|
** ename:VK_BUFFER_USAGE_RAY_TRACING_BIT_NV
|
|
* Extending elink:VkPipelineBindPoint:
|
|
** ename:VK_PIPELINE_BIND_POINT_RAY_TRACING_NV
|
|
* Extending elink:VkDescriptorType:
|
|
** ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV
|
|
* Extending elink:VkAccessFlagBits:
|
|
** ename:VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_NV
|
|
** ename:VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_NV
|
|
* Extending elink:VkQueryType:
|
|
** ename:VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_NV
|
|
* Extending elink:VkPipelineCreateFlagBits:
|
|
** ename:VK_PIPELINE_CREATE_DEFER_COMPILE_BIT_NV
|
|
* Extending elink:VkIndexType:
|
|
** ename:VK_INDEX_TYPE_NONE_NV
|
|
|
|
=== New Enums
|
|
|
|
** elink:VkGeometryFlagBitsNV
|
|
** elink:VkGeometryInstanceFlagBitsNV
|
|
** elink:VkBuildAccelerationStructureFlagBitsNV
|
|
** elink:VkCopyAccelerationStructureModeNV
|
|
** elink:VkGeometryTypeNV
|
|
** elink:VkRayTracingShaderGroupTypeNV
|
|
** elink:VkAccelerationStructureMemoryRequirementsTypeNV
|
|
** elink:VkAccelerationStructureTypeNV
|
|
|
|
=== New Structures
|
|
|
|
** slink:VkRayTracingPipelineCreateInfoNV
|
|
** slink:VkGeometryTrianglesNV
|
|
** slink:VkGeometryAABBNV
|
|
** slink:VkGeometryDataNV
|
|
** slink:VkGeometryNV
|
|
** slink:VkAccelerationStructureCreateInfoNV
|
|
** slink:VkBindAccelerationStructureMemoryInfoNV
|
|
** slink:VkWriteDescriptorSetAccelerationStructureNV
|
|
** slink:VkAccelerationStructureMemoryRequirementsInfoNV
|
|
** slink:VkPhysicalDeviceRayTracingPropertiesNV
|
|
** slink:VkRayTracingShaderGroupCreateInfoNV
|
|
** slink:VkAccelerationStructureInfoNV
|
|
|
|
=== New Functions
|
|
|
|
* flink:vkCreateAccelerationStructureNV
|
|
* flink:vkDestroyAccelerationStructureNV
|
|
* flink:vkGetAccelerationStructureMemoryRequirementsNV
|
|
* flink:vkBindAccelerationStructureMemoryNV
|
|
* flink:vkCmdBuildAccelerationStructureNV
|
|
* flink:vkCmdCopyAccelerationStructureNV
|
|
* flink:vkCmdTraceRaysNV
|
|
* flink:vkCreateRayTracingPipelinesNV
|
|
* flink:vkGetRayTracingShaderGroupHandlesNV
|
|
* flink:vkGetAccelerationStructureHandleNV
|
|
* flink:vkCmdWriteAccelerationStructuresPropertiesNV
|
|
* flink:vkCompileDeferredNV
|
|
|
|
=== New or Modified Built-In Variables
|
|
|
|
* <<interfaces-builtin-variables-launchid,code:LaunchIDNV>>
|
|
* <<interfaces-builtin-variables-launchsize,code:LaunchSizeNV>>
|
|
* <<interfaces-builtin-variables-worldrayorigin,code:WorldRayOriginNV>>
|
|
* <<interfaces-builtin-variables-worldraydirection,code:WorldRayDirectionNV>>
|
|
* <<interfaces-builtin-variables-objectrayorigin,code:ObjectRayOriginNV>>
|
|
* <<interfaces-builtin-variables-objectraydirection,code:ObjectRayDirectionNV>>
|
|
* <<interfaces-builtin-variables-raytmin,code:RayTminNV>>
|
|
* <<interfaces-builtin-variables-raytmax,code:RayTmaxNV>>
|
|
* <<interfaces-builtin-variables-instancecustomindex,code:InstanceCustomIndexNV>>
|
|
* <<interfaces-builtin-variables-instanceid,code:InstanceId>>
|
|
* <<interfaces-builtin-variables-objecttoworld,code:ObjectToWorldNV>>
|
|
* <<interfaces-builtin-variables-worldtoobject,code:WorldToObjectNV>>
|
|
* <<interfaces-builtin-variables-hitt,code:HitTNV>>
|
|
* <<interfaces-builtin-variables-hitkind,code:HitKindNV>>
|
|
* <<interfaces-builtin-variables-incomingrayflags,code:IncomingRayFlagsNV>>
|
|
* (modified)code:PrimitiveId
|
|
|
|
=== New SPIR-V Capabilities
|
|
|
|
* <<spirvenv-capabilities-table-raytracing,RayTracingNV>>
|
|
|
|
=== Issues
|
|
|
|
1) Are there issues?
|
|
|
|
*RESOLVED*: Yes.
|
|
|
|
=== Sample Code
|
|
|
|
Example ray generation GLSL shader
|
|
|
|
[source,c]
|
|
---------------------------------------------------
|
|
#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.
|