Skip to content

Commit

Permalink
add hotzone overload
Browse files Browse the repository at this point in the history
add hotzone overload
  • Loading branch information
scottp101 authored and igcbot committed Jan 5, 2024
1 parent 900081d commit 9271d51
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
30 changes: 30 additions & 0 deletions IGC/AdaptorCommon/RayTracing/AutoGenRTStackAccessPrivateOS.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions IGC/AdaptorCommon/RayTracing/RTBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<GenIntrinsicInst>(CI);
}

CallInst* RTBuilder::ctlz(Value* V)
{
auto* Ctlz = Intrinsic::getDeclaration(
Expand Down
2 changes: 2 additions & 0 deletions IGC/AdaptorCommon/RayTracing/RTBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,8 @@ class RTBuilder : public IGCIRBuilder<>
Type* getRayDispatchGlobalDataPtrTy(Module &M);


GenIntrinsicInst* createDummyInstID(Value* pSrcVal);

CallInst* ctlz(Value* V);

void createPotentialHit2CommittedHit(StackPointerVal* StackPtr);
Expand Down
11 changes: 11 additions & 0 deletions IGC/AdaptorCommon/RayTracing/RTStackFormat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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?");

Expand Down

0 comments on commit 9271d51

Please sign in to comment.