Skip to content

Commit

Permalink
minor refactor
Browse files Browse the repository at this point in the history
minor refactor
  • Loading branch information
ficol authored and igcbot committed Nov 26, 2024
1 parent f8a58d2 commit ed93602
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,8 @@ int intel_get_ray_mask(intel_ray_query_t rayquery, uint bvh_level)
// a procedural leaf or a non-opaque triangle leaf, and requires shader processing.
bool intel_is_traversal_done(intel_ray_query_t rayquery)
{
return MemHit_getDone(get_query_hit(rayquery, intel_hit_type_potential_hit));
bool isTraversalDone = MemHit_getDone(get_query_hit(rayquery, intel_hit_type_potential_hit));
return isTraversalDone;
}

// if traversal is done one can test for the presence of a committed hit to either invoke miss or closest hit shader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ void ResolveOCLRaytracingBuiltins::defineOpaqueTypes() {

IGC_ASSERT(rtFenceTy && rtGlobalsTy);


SmallVector<Type*, 4> Tys{
PointerType::get(rtFenceTy, ADDRESS_SPACE_PRIVATE),
PointerType::get(rtGlobalsTy, ADDRESS_SPACE_GLOBAL),
Expand Down Expand Up @@ -361,6 +362,7 @@ void ResolveOCLRaytracingBuiltins::handleGetRTGlobalBuffer(llvm::CallInst& callI
callInst.eraseFromParent();
}


/*
Handler for
void __builtin_IB_intel_init_ray_query(
Expand All @@ -382,6 +384,7 @@ void ResolveOCLRaytracingBuiltins::handleInitRayQuery(llvm::CallInst& callInst)

m_builder->SetInsertPoint(&callInst);


auto storeToAlloca = [&](unsigned argIndex)
{
auto ptr = m_builder->CreateGEP(alloca->getAllocatedType(), alloca, { m_builder->getInt32(0), m_builder->getInt32(argIndex) });
Expand All @@ -392,6 +395,7 @@ void ResolveOCLRaytracingBuiltins::handleInitRayQuery(llvm::CallInst& callInst)
for (unsigned argIndex = 0; argIndex < numArgs; argIndex++)
storeToAlloca(argIndex);


callInst.replaceAllUsesWith(alloca);
callInst.eraseFromParent();
}
Expand Down

0 comments on commit ed93602

Please sign in to comment.