diff --git a/IGC/AdaptorCommon/RayTracing/AutoGenRTStackAccessPrivateOS.h b/IGC/AdaptorCommon/RayTracing/AutoGenRTStackAccessPrivateOS.h index 790891545b23..1cca73092dbc 100644 --- a/IGC/AdaptorCommon/RayTracing/AutoGenRTStackAccessPrivateOS.h +++ b/IGC/AdaptorCommon/RayTracing/AutoGenRTStackAccessPrivateOS.h @@ -277,6 +277,30 @@ static Type* _struct_RTStackFormat__SWHotZone_v2(Module &M) return StructType::create(M.getContext(), Tys, StructName, false); }(); } +static Type* _struct_RTStackFormat__SWHotZone_v3(Module &M) +{ + return + [&] { + StringRef StructName = "struct.RTStackFormat::SWHotZone_v3"; + if (auto *Ty = IGCLLVM::getTypeByName(M, StructName)) + return Ty; + Type* Tys[] = { + IntegerType::get(M.getContext(), 32), + [&] { + auto *EltTy = + IntegerType::get(M.getContext(), 32); + return ArrayType::get(EltTy, 3); + }(), + IntegerType::get(M.getContext(), 32), + [&] { + auto *EltTy = + IntegerType::get(M.getContext(), 32); + return ArrayType::get(EltTy, 3); + }(), + }; + return StructType::create(M.getContext(), Tys, StructName, false); + }(); +} static Type* _struct_IGC__RayDispatchGlobalData(Module &M) { return @@ -739,6 +763,12 @@ static Type* _gettype_SWHotZone_v2(Module &M) _struct_RTStackFormat__SWHotZone_v2(M); } +static Type* _gettype_SWHotZone_v3(Module &M) +{ + return + _struct_RTStackFormat__SWHotZone_v3(M); +} + static Type* _gettype_RayDispatchGlobalData(Module &M) { return diff --git a/IGC/AdaptorCommon/RayTracing/RTBuilder.cpp b/IGC/AdaptorCommon/RayTracing/RTBuilder.cpp index 9ccf2ccc34cc..7b30fabd43c0 100644 --- a/IGC/AdaptorCommon/RayTracing/RTBuilder.cpp +++ b/IGC/AdaptorCommon/RayTracing/RTBuilder.cpp @@ -1724,6 +1724,17 @@ void RTBuilder::setDisableRTGlobalsKnownValues(bool Disable) { } +GenIntrinsicInst* RTBuilder::createDummyInstID(Value* pSrcVal) +{ + Module* module = GetInsertBlock()->getModule(); + Function* pFunc = GenISAIntrinsic::getDeclaration( + module, + GenISAIntrinsic::GenISA_dummyInstID, + pSrcVal->getType()); + auto* CI = CreateCall(pFunc, pSrcVal); + return cast(CI); +} + CallInst* RTBuilder::ctlz(Value* V) { auto* Ctlz = Intrinsic::getDeclaration( diff --git a/IGC/AdaptorCommon/RayTracing/RTBuilder.h b/IGC/AdaptorCommon/RayTracing/RTBuilder.h index a64e18cb2896..3f298188896f 100644 --- a/IGC/AdaptorCommon/RayTracing/RTBuilder.h +++ b/IGC/AdaptorCommon/RayTracing/RTBuilder.h @@ -453,6 +453,8 @@ class RTBuilder : public IGCIRBuilder<> Type* getRayDispatchGlobalDataPtrTy(Module &M); + GenIntrinsicInst* createDummyInstID(Value* pSrcVal); + CallInst* ctlz(Value* V); void createPotentialHit2CommittedHit(StackPointerVal* StackPtr); diff --git a/IGC/AdaptorCommon/RayTracing/RTStackFormat.h b/IGC/AdaptorCommon/RayTracing/RTStackFormat.h index 62e44fc44e61..a6d8310f58f2 100644 --- a/IGC/AdaptorCommon/RayTracing/RTStackFormat.h +++ b/IGC/AdaptorCommon/RayTracing/RTStackFormat.h @@ -904,6 +904,17 @@ struct alignas(LSC_WRITE_GRANULARITY) SWHotZone_v2 // pad to LSC write granularity (16B on Gen12) }; +struct alignas(LSC_WRITE_GRANULARITY) SWHotZone_v3 +{ + uint32_t StackOffset; + uint32_t DispatchRaysIndex[3]; + + uint32_t Complete; + + // pad to LSC write granularity (16B on Gen12) + uint32_t Pad[3]; +}; + constexpr uint32_t StackFrameAlign = 16; static_assert(IGC::RTStackAlign % LSC_WRITE_GRANULARITY == 0, "not aligned to write granularity?");