@@ -411,7 +411,7 @@ class IGPUTopLevelAccelerationStructure : public asset::ITopLevelAccelerationStr
411
411
if (buildRangeInfo.instanceCount >dstAS->getMaxInstanceCount ())
412
412
return false ;
413
413
414
- const bool arrayOfPointers = buildFlags. hasFlags (BUILD_FLAGS::INSTANCE_DATA_IS_POINTERS_TYPE_ENCODED_LSB) ;
414
+ const bool arrayOfPointers = instanceDataTypeEncodedInPointersLSB ;
415
415
constexpr bool HostBuild = std::is_same_v<BufferType,asset::ICPUBuffer>;
416
416
// I'm not gonna do the `std::conditional_t<HostBuild,,>` to get the correct Instance struct type as they're the same size essentially
417
417
const size_t instanceSize = arrayOfPointers ? sizeof (void *):(
@@ -467,11 +467,13 @@ class IGPUTopLevelAccelerationStructure : public asset::ITopLevelAccelerationStr
467
467
468
468
469
469
core::bitflag<BUILD_FLAGS> buildFlags = BUILD_FLAGS::PREFER_FAST_BUILD_BIT;
470
+ // What we use to indicate `VkAccelerationStructureGeometryInstancesDataKHR::arrayOfPointers`
471
+ uint8_t instanceDataTypeEncodedInPointersLSB : 1 = false ;
470
472
const IGPUTopLevelAccelerationStructure* srcAS = nullptr ;
471
473
IGPUTopLevelAccelerationStructure* dstAS = nullptr ;
472
- // depending on the presence certain bits in `buildFlags` this buffer will be filled with:
474
+ // depending on value of certain build info members this buffer will be filled with:
473
475
// - addresses to `StaticInstance`, `MatrixMotionInstance`, `SRTMotionInstance` packed in upper 60 bits
474
- // and struct type in lower 4 bits if and only if `buildFlags.hasFlags(INSTANCE_DATA_IS_POINTERS_TYPE_ENCODED_LSB) `, otherwise:
476
+ // and struct type in lower 4 bits if and only if `instanceDataTypeEncodedInPointersLSB `, otherwise:
475
477
// + an array of `PolymorphicInstance` if our `SCreationParams::flags.hasFlags(MOTION_BIT)`, otherwise
476
478
// + an array of `StaticInstance`
477
479
asset::SBufferBinding<const BufferType> instanceData = {};
@@ -482,7 +484,6 @@ class IGPUTopLevelAccelerationStructure : public asset::ITopLevelAccelerationStr
482
484
using HostBuildInfo = BuildInfo<asset::ICPUBuffer>;
483
485
484
486
// ! BEWARE, OUR RESOURCE LIFETIME TRACKING DOES NOT WORK ACROSS TLAS->BLAS boundaries with these types of BLAS references!
485
- // TODO: Investigate `EXT_private_data` to be able to go ` -> IGPUBottomLevelAccelerationStructure` on Host Builds
486
487
using DeviceInstance = Instance<IGPUBottomLevelAccelerationStructure::device_op_ref_t >;
487
488
using HostInstance = Instance<IGPUBottomLevelAccelerationStructure::host_op_ref_t >;
488
489
static_assert (sizeof (DeviceInstance)==sizeof (HostInstance));
0 commit comments