Skip to content

Commit

Permalink
add instance id for BLAS in TLAS.
Browse files Browse the repository at this point in the history
  • Loading branch information
LinkClinton committed Nov 1, 2023
1 parent 4b032d3 commit dfb70c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions raytracings/accleration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ wrapper::directx12::raytracing_acceleration wrapper::directx12::raytracing_accel
auto& desc = instances_desc[index];

desc.Flags = D3D12_RAYTRACING_INSTANCE_FLAG_FORCE_OPAQUE;
desc.InstanceID = static_cast<UINT>(index);
desc.InstanceContributionToHitGroupIndex = static_cast<UINT>(index);
desc.InstanceID = static_cast<UINT>(instances[index].identity);
desc.InstanceContributionToHitGroupIndex = static_cast<UINT>(instances[index].identity);
desc.AccelerationStructure = instances[index].geometry.acceleration()->GetGPUVirtualAddress();
desc.InstanceMask = 0xff;

Expand Down
2 changes: 2 additions & 0 deletions raytracings/accleration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ namespace wrapper::directx12
{
raytracing_geometry geometry;

uint32 identity;

real transform[3][4];
};

Expand Down

0 comments on commit dfb70c7

Please sign in to comment.