Class KHRRayTracingPipeline

java.lang.Object
org.lwjgl.vulkan.KHRRayTracingPipeline

public class KHRRayTracingPipeline extends Object
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:

  • A new ray tracing pipeline type with new shader domains: ray generation, intersection, any-hit, closest hit, miss, and callable
  • A shader binding indirection table to link shader groups with acceleration structure items
  • Ray tracing commands which initiate the ray pipeline traversal and invocation of the various new shader domains depending on which traversal conditions are met

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

  • SPV_KHR_ray_tracing
Sample Code

Example ray generation GLSL shader


 #version 450 core
 #extension GL_EXT_ray_tracing : require
 layout(set = 0, binding = 0, rgba8) uniform image2D image;
 layout(set = 0, binding = 1) uniform accelerationStructureEXT as;
 layout(location = 0) rayPayloadEXT float payload;
 
 void main()
 {
    vec4 col = vec4(0, 0, 0, 1);
 
    vec3 origin = vec3(float(gl_LaunchIDEXT.x)/float(gl_LaunchSizeEXT.x), float(gl_LaunchIDEXT.y)/float(gl_LaunchSizeEXT.y), 1.0);
    vec3 dir = vec3(0.0, 0.0, -1.0);
 
    traceRayEXT(as, 0, 0xff, 0, 1, 0, origin, 0.0, dir, 1000.0, 0);
 
    col.y = payload;
 
    imageStore(image, ivec2(gl_LaunchIDEXT.xy), col);
 }
Name String
VK_KHR_ray_tracing_pipeline
Extension Type
Device extension
Registered Extension Number
348
Revision
1
Extension and Version Dependencies
VK_KHR_spirv_1_4 and VK_KHR_acceleration_structure
API Interactions
  • Interacts with VK_KHR_ray_query
SPIR-V Dependencies
Contact
Other Extension Metadata
Last Modified Date
2020-11-12
Interactions and External Dependencies
Contributors
  • Matthäus Chajdas, AMD
  • Greg Grebe, AMD
  • Nicolai Hähnle, AMD
  • Tobias Hector, AMD
  • Dave Oldcorn, AMD
  • Skyler Saleh, AMD
  • Mathieu Robart, Arm
  • Marius Bjorge, Arm
  • Tom Olson, Arm
  • Sebastian Tafuri, EA
  • Henrik Rydgard, Embark
  • Juan Cañada, Epic Games
  • Patrick Kelly, Epic Games
  • Yuriy O’Donnell, Epic Games
  • Michael Doggett, Facebook/Oculus
  • Andrew Garrard, Imagination
  • Don Scorgie, Imagination
  • Dae Kim, Imagination
  • Joshua Barczak, Intel
  • Slawek Grajewski, Intel
  • Jeff Bolz, NVIDIA
  • Pascal Gautron, NVIDIA
  • Daniel Koch, NVIDIA
  • Christoph Kubisch, NVIDIA
  • Ashwin Lele, NVIDIA
  • Robert Stepinski, NVIDIA
  • Martin Stich, NVIDIA
  • Nuno Subtil, NVIDIA
  • Eric Werness, NVIDIA
  • Jon Leech, Khronos
  • Jeroen van Schijndel, OTOY
  • Juul Joosten, OTOY
  • Alex Bourd, Qualcomm
  • Roman Larionov, Qualcomm
  • David McAllister, Qualcomm
  • Spencer Fricke, Samsung
  • Lewis Gordon, Samsung
  • Ralph Potter, Samsung
  • Jasper Bekkers, Traverse Research
  • Jesse Barker, Unity
  • Baldur Karlsson, Valve