Skip to content

Commit 71b2cb5

Browse files
authored
Raytracing execution reordering (#1461)
* Add ray tracing invocation reorder sample using VK_EXT_ray_tracing_invocation_reorder extension. * Align code formatting in ray tracing invocation reorder sample. * Extend ray tracing sample with advanced rendering features including shadow mapping, ambient occlusion, flame particles, and dynamic object support * Align code formatting in ray tracing invocation reorder sample * Add conditional compilation guards for VK_EXT_ray_tracing_invocation_reorder to support older Vulkan SDK versions * Add ray tracing invocation reorder sample to CMakeLists and fix code formatting * Add compiled SPIR-V shader binaries for ray tracing closest-hit shaders * Update copyright years to 2026 * Fix for including all shaders correctly. GLSLC doesn't currently have all supported capabilities in the public SDK. This prevents the samples from trying to build GLSL. * Update the README.adoc
1 parent 962870b commit 71b2cb5

28 files changed

Lines changed: 3537 additions & 5 deletions

antora/modules/ROOT/nav.adoc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
////
2-
- Copyright (c) 2023-2025, Holochip Inc
3-
- Copyright (c) 2023-2025, Sascha Willems
2+
- Copyright (c) 2023-2026, Holochip Inc
3+
- Copyright (c) 2023-2026, Sascha Willems
44
- Copyright (c) 2025, Arm Limited and Contributors
55
-
66
- SPDX-License-Identifier: Apache-2.0
@@ -84,6 +84,7 @@
8484
*** xref:samples/extensions/hpp_push_descriptors/README.adoc[Push descriptors (Vulkan-Hpp)]
8585
** xref:samples/extensions/ray_tracing_basic/README.adoc[Raytracing basic]
8686
** xref:samples/extensions/ray_tracing_extended/README.adoc[Raytracing extended]
87+
** xref:samples/extensions/ray_tracing_invocation_reorder/README.adoc[Ray tracing invocation reorder (SER)]
8788
** xref:samples/extensions/ray_queries/README.adoc[Ray queries]
8889
** xref:samples/extensions/ray_tracing_reflection/README.adoc[Ray tracing reflection]
8990
** xref:samples/extensions/ray_tracing_position_fetch/README.adoc[Ray tracing position fetch]

framework/vulkan_type_mapping.h

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Copyright (c) 2025, Arm Limited and Contributors
2-
* Copyright (c) 2024-2025, NVIDIA CORPORATION. All rights reserved.
2+
* Copyright (c) 2024-2026, NVIDIA CORPORATION. All rights reserved.
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*
@@ -243,6 +243,20 @@ struct HPPType<VkPhysicalDeviceRayTracingPipelineFeaturesKHR>
243243
using Type = vk::PhysicalDeviceRayTracingPipelineFeaturesKHR;
244244
};
245245

246+
#ifdef VK_EXT_ray_tracing_invocation_reorder
247+
template <>
248+
struct HPPType<VkPhysicalDeviceRayTracingInvocationReorderFeaturesEXT>
249+
{
250+
using Type = vk::PhysicalDeviceRayTracingInvocationReorderFeaturesEXT;
251+
};
252+
#endif
253+
254+
template <>
255+
struct HPPType<VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV>
256+
{
257+
using Type = vk::PhysicalDeviceRayTracingInvocationReorderFeaturesNV;
258+
};
259+
246260
template <>
247261
struct HPPType<VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR>
248262
{

samples/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2019-2025, Arm Limited and Contributors
1+
# Copyright (c) 2019-2026, Arm Limited and Contributors
22
#
33
# SPDX-License-Identifier: Apache-2.0
44
#
@@ -75,6 +75,7 @@ set(ORDER_LIST
7575
"ray_tracing_basic"
7676
"ray_tracing_extended"
7777
"ray_tracing_reflection"
78+
"ray_tracing_invocation_reorder"
7879
"timeline_semaphore"
7980
"shader_object"
8081
"shader_debugprintf"

samples/extensions/README.adoc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
////
22
- Copyright (c) 2025, Arm Limited and Contributors
3-
- Copyright (c) 2021-2025, The Khronos Group
3+
- Copyright (c) 2021-2026, The Khronos Group
44
-
55
- SPDX-License-Identifier: Apache-2.0
66
-
@@ -312,3 +312,9 @@ Demonstrate how to build data graph pipelines and execute neural networks:
312312

313313
* xref:./{extension_samplespath}tensor_and_data_graph/simple_tensor_and_data_graph/README.adoc[simple_tensor_and_data_graph]
314314
- Explains how to set up and execute a simple neural network using a data graph pipeline.
315+
316+
=== xref:./{extension_samplespath}ray_tracing_invocation_reorder/README.adoc[Ray Tracing Invocation Reorder]
317+
318+
*Extensions:* https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_ray_tracing_invocation_reorder.html[`VK_EXT_ray_tracing_invocation_reorder`]
319+
320+
Demonstrate how to optimize ray tracing pipelines by reordering the invocation order.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Copyright (c) 2025-2026, Holochip Inc.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# Licensed under the Apache License, Version 2.0 the "License";
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
get_filename_component(FOLDER_NAME ${CMAKE_CURRENT_LIST_DIR} NAME)
18+
get_filename_component(PARENT_DIR ${CMAKE_CURRENT_LIST_DIR} PATH)
19+
get_filename_component(CATEGORY_NAME ${PARENT_DIR} NAME)
20+
21+
add_sample_with_tags(
22+
ID ${FOLDER_NAME}
23+
CATEGORY ${CATEGORY_NAME}
24+
AUTHOR "Holochip Inc."
25+
NAME "Ray tracing invocation reorder"
26+
DESCRIPTION "Demonstrates Shader Execution Reordering (SER) using VK_EXT_ray_tracing_invocation_reorder to reduce divergence"
27+
SHADER_FILES_GLSL
28+
# Note: We do not compile GLSL here because glslc may lack GL_EXT_shader_invocation_reorder (current public SDK doesn't support it).
29+
# "ray_tracing_invocation_reorder/glsl/raygen.rgen"
30+
# "ray_tracing_invocation_reorder/glsl//miss.rmiss"
31+
# "ray_tracing_invocation_reorder/glsl//closesthit_flame.rchit"
32+
# "ray_tracing_invocation_reorder/glsl//closesthit_normal.rchit"
33+
# "ray_tracing_invocation_reorder/glsl//closesthit_refraction.rchit"
34+
SHADER_FILES_SLANG
35+
"ray_tracing_invocation_reorder/slang/raygen.rgen.slang"
36+
"ray_tracing_invocation_reorder/slang/miss.rmiss.slang"
37+
"ray_tracing_invocation_reorder/slang/closesthit_normal.rchit.slang"
38+
"ray_tracing_invocation_reorder/slang/closesthit_refraction.rchit.slang"
39+
"ray_tracing_invocation_reorder/slang/closesthit_flame.rchit.slang"
40+
)

0 commit comments

Comments
 (0)