Skip to content

Commit 32f35f3

Browse files
Critsium-xyclaude
andcommitted
WIP: port the NVIDIA path tracer
Ports the path tracing pipeline from NVIDIA's Godot fork (NVIDIA-RTX/godot, branch nvidia-pt-dlss-dev, merge base c3e6b2c). It builds and runs, but the image is still black: see the status below. The RenderingDevice raytracing API this depends on (acceleration structures, raytracing pipelines, trace rays, the raygen/hit/miss shader stages) is already in upstream Godot, so what is ported here is only NVIDIA's renderer on top of it: - servers/rendering/renderer_rd/forward_clustered/render_raytracing.*, the BLAS/TLAS builder and per-surface acceleration structure cache. - scene_shader_raytracing.*, a second material shader system compiling materials for the raytracing stages. - render_forward_clustered_pt.*, a RenderForwardClustered subclass that replaces the raster scene render when path tracing is on. - shaders/raytracing/*, the raygen/closest hit/BRDF/light sampling shaders. - RTProceduralInstance3D plus its gizmo, Environment path tracing properties, bindless_block, and depth_reconstruct. - Shader::set_code_rt so user shaders can carry raytracing code. - The spirv-reflect patch adding SpvOpTypeHitObjectEXT, without which reflection of the raygen stage fails outright. Deliberately not taken from that branch, as none of it belongs to the path tracer: Nsight Aftermath, error backtraces, PIX markers, the gizmo suppression refactor, the Shape3D debug mesh cache, concurrent BVH building, and a second Reflex ping path through a new display server window event. Where NVIDIA's branch and ours had both grown a DLSS implementation, ours is kept, including its corrections: the vertical FOV derivation, the clip space the matrices handed to DLSS are built in, declaring the upscaled output read-write to the render graph, and falling back to FSR2 when DLSS cannot service a configuration. NVIDIA's _render_3d_upscaling refactor is adopted because the path traced path needs it to pass DLSS Ray Reconstruction guide buffers, and those fixes were reapplied on top of it. Current state, measured on an RTX 4070 Laptop with Vulkan: - The engine starts, path tracing enables, and 60 frames render with no errors. - The TLAS receives every instance and the raster path correctly stands down. - Ray traversal works. The UV, front/back face, geometry normal and final normal debug views all resolve geometry. - Every material derived value is zero: albedo, ORM and roughness debug views are entirely black, and so is the final image. So the remaining defect is isolated to material evaluation in the closest hit path, not to the acceleration structures or vertex data. The material UBO pool and the bindless texture binding are the places to look. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WgxxgYZUnriDqgepZHiKpY
1 parent b8739c3 commit 32f35f3

120 files changed

Lines changed: 14269 additions & 618 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

SConstruct

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,13 @@ opts.Add(
290290
)
291291
opts.Add(BoolVariable("use_precise_math_checks", "Math checks use very precise epsilon (debug option)", False))
292292
opts.Add(BoolVariable("strict_checks", "Enforce stricter checks (debug option)", False))
293+
opts.Add(
294+
BoolVariable(
295+
"error_backtrace",
296+
"Dump native C++ stack traces to stderr on each printed engine error (slow); use debug_symbols for file:line where supported",
297+
False,
298+
)
299+
)
293300
opts.Add(
294301
BoolVariable(
295302
"limit_transitive_includes", "Attempt to limit the amount of transitive includes in system headers", True
@@ -691,6 +698,9 @@ if env["production"]:
691698
if env["strict_checks"]:
692699
env.Append(CPPDEFINES=["STRICT_CHECKS"])
693700

701+
if env["error_backtrace"]:
702+
env.Append(CPPDEFINES=["ERROR_BACKTRACE_ENABLED"])
703+
694704
# Run SCU file generation script if in a SCU build.
695705
if env["scu_build"]:
696706
env.Append(CPPDEFINES=["SCU_BUILD_ENABLED"])

core/config/engine.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,18 @@ bool Engine::is_validation_layers_enabled() const {
282282
return use_validation_layers;
283283
}
284284

285+
bool Engine::is_raytracing_validation_enabled() const {
286+
return use_raytracing_validation;
287+
}
288+
285289
bool Engine::is_generate_spirv_debug_info_enabled() const {
286290
return generate_spirv_debug_info;
287291
}
288292

293+
bool Engine::is_gpu_markers_enabled() const {
294+
return use_gpu_markers;
295+
}
296+
289297
bool Engine::is_extra_gpu_memory_tracking_enabled() const {
290298
return extra_gpu_memory_tracking;
291299
}

core/config/engine.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ class Engine {
7676
double _physics_interpolation_fraction = 0.0f;
7777
bool abort_on_gpu_errors = false;
7878
bool use_validation_layers = false;
79+
bool use_raytracing_validation = false;
7980
bool generate_spirv_debug_info = false;
81+
bool use_gpu_markers = false;
8082
bool extra_gpu_memory_tracking = false;
8183
#if defined(DEBUG_ENABLED) || defined(DEV_ENABLED)
8284
bool accurate_breadcrumbs = false;
@@ -210,7 +212,9 @@ class Engine {
210212

211213
bool is_abort_on_gpu_errors_enabled() const;
212214
bool is_validation_layers_enabled() const;
215+
bool is_raytracing_validation_enabled() const;
213216
bool is_generate_spirv_debug_info_enabled() const;
217+
bool is_gpu_markers_enabled() const;
214218
bool is_extra_gpu_memory_tracking_enabled() const;
215219
#if defined(DEBUG_ENABLED) || defined(DEV_ENABLED)
216220
bool is_accurate_breadcrumbs_enabled() const;
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<class name="RTProceduralInstance3D" inherits="GeometryInstance3D" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
3+
<brief_description>
4+
A scene node that represents procedural ray tracing geometry using axis-aligned bounding boxes (AABBs).
5+
</brief_description>
6+
<description>
7+
[RTProceduralInstance3D] adds a set of axis-aligned bounding boxes (AABBs) to the Top-Level Acceleration Structure (TLAS) as procedural geometry. Unlike mesh-based instances, procedural instances do not have triangle geometry; instead, intersection is handled entirely by a custom intersection shader in the ray tracing pipeline.
8+
Each entry in [member bounds] defines one primitive AABB visible to intersection shaders via [code]gl_PrimitiveID[/code]. If [member bounds] is empty the node falls back to a single primitive using [member size] as the bounding box centered at the origin.
9+
A zero-surface [ArrayMesh] is attached internally so the renderer classifies this node as a mesh instance. No vertex or index data is submitted to the raster pipeline; the node is invisible outside of ray tracing.
10+
[b]Note:[/b] Requires a GPU with hardware ray tracing support and path tracing enabled in the [Environment].
11+
</description>
12+
<tutorials>
13+
</tutorials>
14+
<methods>
15+
<method name="is_multi_aabb" qualifiers="const">
16+
<return type="bool" />
17+
<description>
18+
Returns [code]true[/code] if [member bounds] contains at least one entry, meaning the node uses per-primitive AABBs rather than the single [member size]-derived bounding box.
19+
</description>
20+
</method>
21+
</methods>
22+
<members>
23+
<member name="bounds" type="AABB[]" setter="set_bounds" getter="get_bounds" default="[]">
24+
Array of per-primitive axis-aligned bounding boxes submitted to the ray tracer. Each entry corresponds to one procedural primitive accessible via [code]gl_PrimitiveID[/code] in the intersection shader. When this array is empty, a single primitive is created using [member size].
25+
</member>
26+
<member name="custom_enclosing_aabb" type="AABB" setter="set_custom_enclosing_aabb" getter="get_custom_enclosing_aabb" default="AABB(0, 0, 0, 0, 0, 0)">
27+
Optional override for the conservative bounding volume used to cull this instance in the TLAS. When set to a non-empty AABB (i.e., [method AABB.has_volume] returns [code]true[/code]), this value is used instead of the union of all [member bounds] entries. Useful when the logical extents of your procedural geometry exceed the individual AABBs.
28+
</member>
29+
<member name="expose_aabb_bounds" type="bool" setter="set_expose_aabb_bounds" getter="get_expose_aabb_bounds" default="false">
30+
If [code]true[/code], the per-primitive AABBs from [member bounds] are made accessible to hit shaders, allowing intersection shaders to skip redundant ray-AABB tests using precomputed results.
31+
</member>
32+
<member name="size" type="Vector3" setter="set_size" getter="get_size" default="Vector3(1, 1, 1)">
33+
The size of the single fallback bounding box used when [member bounds] is empty. The box is centered at the node origin. Has no effect when [member bounds] contains at least one entry.
34+
</member>
35+
</members>
36+
</class>

drivers/d3d12/rendering_device_driver_d3d12.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5782,6 +5782,10 @@ void RenderingDeviceDriverD3D12::command_build_blas(CommandBufferID p_cmd_buffer
57825782
ERR_FAIL_MSG("Ray tracing is not currently supported by the D3D12 driver.");
57835783
}
57845784

5785+
void RenderingDeviceDriverD3D12::command_update_blas(CommandBufferID p_cmd_buffer, AccelerationStructureID p_acceleration_structure, BufferID p_scratch_buffer) {
5786+
ERR_FAIL_MSG("Ray tracing is not currently supported by the D3D12 driver.");
5787+
}
5788+
57855789
void RenderingDeviceDriverD3D12::command_build_tlas(CommandBufferID p_cmd_buffer, AccelerationStructureID p_acceleration_structure, BufferID p_scratch_buffer, BufferID p_instance_buffer, uint32_t p_instance_offset, uint32_t p_instance_count) {
57865790
ERR_FAIL_MSG("Ray tracing is not currently supported by the D3D12 driver.");
57875791
}

drivers/d3d12/rendering_device_driver_d3d12.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,7 @@ class RenderingDeviceDriverD3D12 : public RenderingDeviceDriver {
876876
// ----- COMMANDS -----
877877

878878
virtual void command_build_blas(CommandBufferID p_cmd_buffer, AccelerationStructureID p_acceleration_structure, BufferID p_scratch_buffer) override final;
879+
virtual void command_update_blas(CommandBufferID p_cmd_buffer, AccelerationStructureID p_acceleration_structure, BufferID p_scratch_buffer) override final;
879880
virtual void command_build_tlas(CommandBufferID p_cmd_buffer, AccelerationStructureID p_acceleration_structure, BufferID p_scratch_buffer, BufferID p_instance_buffer, uint32_t p_instance_offset, uint32_t p_instance_count) override final;
880881
virtual void command_bind_raytracing_pipeline(CommandBufferID p_cmd_buffer, RaytracingPipelineID p_pipeline) override final;
881882
virtual void command_bind_raytracing_uniform_set(CommandBufferID p_cmd_buffer, UniformSetID p_uniform_set, ShaderID p_shader, uint32_t p_set_index) override final;

drivers/gles3/rasterizer_scene_gles3.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2399,7 +2399,7 @@ void RasterizerSceneGLES3::_render_shadow_pass(RID p_light, RID p_shadow_atlas,
23992399
glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
24002400
}
24012401

2402-
void RasterizerSceneGLES3::render_scene(const Ref<RenderSceneBuffers> &p_render_buffers, const CameraData *p_camera_data, const CameraData *p_prev_camera_data, const PagedArray<RenderGeometryInstance *> &p_instances, const PagedArray<RID> &p_lights, const PagedArray<RID> &p_reflection_probes, const PagedArray<RID> &p_voxel_gi_instances, const PagedArray<RID> &p_decals, const PagedArray<RID> &p_lightmaps, const PagedArray<RID> &p_fog_volumes, RID p_environment, RID p_camera_attributes, RID p_compositor, RID p_shadow_atlas, RID p_occluder_debug_tex, RID p_reflection_atlas, RID p_reflection_probe, int p_reflection_probe_pass, float p_screen_mesh_lod_threshold, const RenderShadowData *p_render_shadows, int p_render_shadow_count, const RenderSDFGIData *p_render_sdfgi_regions, int p_render_sdfgi_region_count, float p_window_output_max_value, const RenderSDFGIUpdateData *p_sdfgi_update_data, RenderingServerTypes::RenderInfo *r_render_info) {
2402+
void RasterizerSceneGLES3::render_scene(const Ref<RenderSceneBuffers> &p_render_buffers, const CameraData *p_camera_data, const CameraData *p_prev_camera_data, const PagedArray<RenderGeometryInstance *> &p_instances, const PagedArray<RID> &p_lights, const PagedArray<RID> &p_reflection_probes, const PagedArray<RID> &p_voxel_gi_instances, const PagedArray<RID> &p_decals, const PagedArray<RID> &p_lightmaps, const PagedArray<RID> &p_fog_volumes, RID p_environment, RID p_camera_attributes, RID p_compositor, RID p_shadow_atlas, RID p_occluder_debug_tex, RID p_reflection_atlas, RID p_reflection_probe, int p_reflection_probe_pass, float p_screen_mesh_lod_threshold, const RenderShadowData *p_render_shadows, int p_render_shadow_count, const RenderSDFGIData *p_render_sdfgi_regions, int p_render_sdfgi_region_count, float p_window_output_max_value, const RenderSDFGIUpdateData *p_sdfgi_update_data, RenderingServerTypes::RenderInfo *r_render_info, const PagedArray<RenderGeometryInstance *> *p_rt_instances, const PagedArray<RID> *p_rt_lights) {
24032403
GLES3::TextureStorage *texture_storage = GLES3::TextureStorage::get_singleton();
24042404
GLES3::Config *config = GLES3::Config::get_singleton();
24052405
RENDER_TIMESTAMP("Setup 3D Scene");

drivers/gles3/rasterizer_scene_gles3.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ class RasterizerSceneGLES3 : public RendererSceneRender {
955955

956956
void voxel_gi_set_quality(RSE::VoxelGIQuality) override;
957957

958-
void render_scene(const Ref<RenderSceneBuffers> &p_render_buffers, const CameraData *p_camera_data, const CameraData *p_prev_camera_data, const PagedArray<RenderGeometryInstance *> &p_instances, const PagedArray<RID> &p_lights, const PagedArray<RID> &p_reflection_probes, const PagedArray<RID> &p_voxel_gi_instances, const PagedArray<RID> &p_decals, const PagedArray<RID> &p_lightmaps, const PagedArray<RID> &p_fog_volumes, RID p_environment, RID p_camera_attributes, RID p_compositor, RID p_shadow_atlas, RID p_occluder_debug_tex, RID p_reflection_atlas, RID p_reflection_probe, int p_reflection_probe_pass, float p_screen_mesh_lod_threshold, const RenderShadowData *p_render_shadows, int p_render_shadow_count, const RenderSDFGIData *p_render_sdfgi_regions, int p_render_sdfgi_region_count, float p_window_output_max_value, const RenderSDFGIUpdateData *p_sdfgi_update_data = nullptr, RenderingServerTypes::RenderInfo *r_render_info = nullptr) override;
958+
void render_scene(const Ref<RenderSceneBuffers> &p_render_buffers, const CameraData *p_camera_data, const CameraData *p_prev_camera_data, const PagedArray<RenderGeometryInstance *> &p_instances, const PagedArray<RID> &p_lights, const PagedArray<RID> &p_reflection_probes, const PagedArray<RID> &p_voxel_gi_instances, const PagedArray<RID> &p_decals, const PagedArray<RID> &p_lightmaps, const PagedArray<RID> &p_fog_volumes, RID p_environment, RID p_camera_attributes, RID p_compositor, RID p_shadow_atlas, RID p_occluder_debug_tex, RID p_reflection_atlas, RID p_reflection_probe, int p_reflection_probe_pass, float p_screen_mesh_lod_threshold, const RenderShadowData *p_render_shadows, int p_render_shadow_count, const RenderSDFGIData *p_render_sdfgi_regions, int p_render_sdfgi_region_count, float p_window_output_max_value, const RenderSDFGIUpdateData *p_sdfgi_update_data = nullptr, RenderingServerTypes::RenderInfo *r_render_info = nullptr, const PagedArray<RenderGeometryInstance *> *p_rt_instances = nullptr, const PagedArray<RID> *p_rt_lights = nullptr) override;
959959
void render_material(const Transform3D &p_cam_transform, const Projection &p_cam_projection, bool p_cam_orthogonal, const PagedArray<RenderGeometryInstance *> &p_instances, RID p_framebuffer, const Rect2i &p_region) override;
960960
void render_particle_collider_heightfield(RID p_collider, const Transform3D &p_transform, const PagedArray<RenderGeometryInstance *> &p_instances) override;
961961

drivers/vulkan/rendering_device_driver_vulkan.cpp

Lines changed: 50 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6389,25 +6389,40 @@ RDD::AccelerationStructureID RenderingDeviceDriverVulkan::blas_create(VectorView
63896389
VkAccelerationStructureGeometryKHR &vk_geometry = accel_info->geometries[i];
63906390
vk_geometry = {};
63916391
vk_geometry.sType = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR;
6392-
vk_geometry.geometryType = VK_GEOMETRY_TYPE_TRIANGLES_KHR;
63936392
vk_geometry.flags = geometry.flags;
63946393

6395-
vk_geometry.geometry.triangles.sType = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR;
6396-
vk_geometry.geometry.triangles.vertexFormat = RD_TO_VK_FORMAT[geometry.vertex_format];
6397-
vk_geometry.geometry.triangles.vertexData.deviceAddress = buffer_get_device_address(geometry.vertex_buffer) + geometry.vertex_offset;
6398-
vk_geometry.geometry.triangles.vertexStride = geometry.vertex_stride;
6399-
// Number of vertices in vertexData minus one, aka max vertex index.
6400-
vk_geometry.geometry.triangles.maxVertex = (geometry.vertex_count ? (geometry.vertex_count - 1) : 0);
6401-
6402-
// Info for building BLAS.
6403-
uint32_t primitive_count;
6404-
if (geometry.index_buffer != BufferID()) {
6405-
vk_geometry.geometry.triangles.indexType = (geometry.index_format == INDEX_BUFFER_FORMAT_UINT16 ? VK_INDEX_TYPE_UINT16 : VK_INDEX_TYPE_UINT32);
6406-
vk_geometry.geometry.triangles.indexData.deviceAddress = buffer_get_device_address(geometry.index_buffer) + geometry.index_offset;
6407-
primitive_count = geometry.index_count / 3;
6408-
} else {
6409-
vk_geometry.geometry.triangles.indexType = VK_INDEX_TYPE_NONE_KHR;
6410-
primitive_count = geometry.vertex_count / 3;
6394+
uint32_t primitive_count = 0;
6395+
switch (geometry.type) {
6396+
case AccelerationStructureGeometry::TYPE_TRIANGLES: {
6397+
const AccelerationStructureGeometry::Triangles &t = geometry.geometry.triangles;
6398+
vk_geometry.geometryType = VK_GEOMETRY_TYPE_TRIANGLES_KHR;
6399+
vk_geometry.geometry.triangles.sType = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR;
6400+
vk_geometry.geometry.triangles.vertexFormat = RD_TO_VK_FORMAT[t.vertex_format];
6401+
vk_geometry.geometry.triangles.vertexData.deviceAddress = buffer_get_device_address(t.vertex_buffer) + t.vertex_offset;
6402+
vk_geometry.geometry.triangles.vertexStride = t.vertex_stride;
6403+
// Number of vertices in vertexData minus one, aka max vertex index.
6404+
vk_geometry.geometry.triangles.maxVertex = (t.vertex_count ? (t.vertex_count - 1) : 0);
6405+
6406+
if (t.index_buffer != BufferID()) {
6407+
vk_geometry.geometry.triangles.indexType = (t.index_format == INDEX_BUFFER_FORMAT_UINT16 ? VK_INDEX_TYPE_UINT16 : VK_INDEX_TYPE_UINT32);
6408+
vk_geometry.geometry.triangles.indexData.deviceAddress = buffer_get_device_address(t.index_buffer) + t.index_offset;
6409+
primitive_count = t.index_count / 3;
6410+
} else {
6411+
vk_geometry.geometry.triangles.indexType = VK_INDEX_TYPE_NONE_KHR;
6412+
primitive_count = t.vertex_count / 3;
6413+
}
6414+
} break;
6415+
6416+
case AccelerationStructureGeometry::TYPE_AABBS: {
6417+
const AccelerationStructureGeometry::Aabbs &a = geometry.geometry.aabbs;
6418+
ERR_FAIL_COND_V_MSG(a.stride < 24, AccelerationStructureID(), "AABB stride must be at least 24 bytes (two float3: min, max).");
6419+
vk_geometry.geometryType = VK_GEOMETRY_TYPE_AABBS_KHR;
6420+
vk_geometry.geometry.aabbs.sType = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_AABBS_DATA_KHR;
6421+
vk_geometry.geometry.aabbs.pNext = nullptr;
6422+
vk_geometry.geometry.aabbs.data.deviceAddress = buffer_get_device_address(a.buffer) + a.offset;
6423+
vk_geometry.geometry.aabbs.stride = a.stride;
6424+
primitive_count = a.count;
6425+
} break;
64116426
}
64126427

64136428
VkAccelerationStructureBuildRangeInfoKHR &vk_range_info = accel_info->range_infos[i];
@@ -6583,6 +6598,24 @@ void RenderingDeviceDriverVulkan::command_build_blas(CommandBufferID p_cmd_buffe
65836598
#endif
65846599
}
65856600

6601+
void RenderingDeviceDriverVulkan::command_update_blas(CommandBufferID p_cmd_buffer, AccelerationStructureID p_acceleration_structure, BufferID p_scratch_buffer) {
6602+
#if VULKAN_RAYTRACING_ENABLED
6603+
const CommandBufferInfo *command_buffer = (const CommandBufferInfo *)p_cmd_buffer.id;
6604+
AccelerationStructureInfo *accel_info = (AccelerationStructureInfo *)p_acceleration_structure.id;
6605+
6606+
VkAccelerationStructureBuildGeometryInfoKHR *build_info = &accel_info->build_info;
6607+
build_info->mode = VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR;
6608+
build_info->srcAccelerationStructure = accel_info->vk_acceleration_structure;
6609+
build_info->dstAccelerationStructure = accel_info->vk_acceleration_structure;
6610+
VkDeviceAddress scratch_address = buffer_get_device_address(p_scratch_buffer);
6611+
build_info->scratchData.deviceAddress = _align_up_address(scratch_address, accel_info->scratch_alignment);
6612+
6613+
const VkAccelerationStructureBuildRangeInfoKHR *range_infos = accel_info->range_infos.ptr();
6614+
6615+
device_functions.CmdBuildAccelerationStructuresKHR(command_buffer->vk_command_buffer, 1, build_info, &range_infos);
6616+
#endif
6617+
}
6618+
65866619
void RenderingDeviceDriverVulkan::command_build_tlas(CommandBufferID p_cmd_buffer, AccelerationStructureID p_acceleration_structure, BufferID p_scratch_buffer, BufferID p_instance_buffer, uint32_t p_instance_offset, uint32_t p_instance_count) {
65876620
#if VULKAN_RAYTRACING_ENABLED
65886621
const CommandBufferInfo *command_buffer = (const CommandBufferInfo *)p_cmd_buffer.id;

drivers/vulkan/rendering_device_driver_vulkan.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,7 @@ class RenderingDeviceDriverVulkan : public RenderingDeviceDriver {
708708
VkAccelerationStructureKHR vk_acceleration_structure = VK_NULL_HANDLE;
709709
// Buffer used for the structure
710710
RDD::BufferID buffer;
711+
VkDeviceAddress cached_device_address = 0;
711712

712713
// Alignment of the scratch buffer for building the structure
713714
uint32_t scratch_alignment;
@@ -735,6 +736,7 @@ class RenderingDeviceDriverVulkan : public RenderingDeviceDriver {
735736
public:
736737
// ----- COMMANDS -----
737738
virtual void command_build_blas(CommandBufferID p_cmd_buffer, AccelerationStructureID p_acceleration_structure, BufferID p_scratch_buffer) override final;
739+
virtual void command_update_blas(CommandBufferID p_cmd_buffer, AccelerationStructureID p_acceleration_structure, BufferID p_scratch_buffer) override final;
738740
virtual void command_build_tlas(CommandBufferID p_cmd_buffer, AccelerationStructureID p_acceleration_structure, BufferID p_scratch_buffer, BufferID p_instance_buffer, uint32_t p_instance_offset, uint32_t p_instance_count) override final;
739741
virtual void command_bind_raytracing_pipeline(CommandBufferID p_cmd_buffer, RaytracingPipelineID p_pipeline) override final;
740742
virtual void command_bind_raytracing_uniform_set(CommandBufferID p_cmd_buffer, UniformSetID p_uniform_set, ShaderID p_shader, uint32_t p_set_index) override final;

0 commit comments

Comments
 (0)