Skip to content

Commit

Permalink
Fix continufy.stage metadata for TraceRay library (#2689)
Browse files Browse the repository at this point in the history
The metadata is set to the wrong function. `m_entryPoint` is the entry
function of GPURT library, after `createTraceRay()`, `m_entryPoint` is
set to the real entry function of the module, we need to set metadata to
it.
  • Loading branch information
LLJJDD authored Sep 8, 2023
1 parent a49681a commit 9129dcf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions llpc/lower/llpcSpirvLowerRayTracing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -554,12 +554,13 @@ PreservedAnalyses SpirvLowerRayTracing::run(Module &module, ModuleAnalysisManage
}
// Process traceRays module
if (m_shaderStage == ShaderStageCompute) {
CallInst *call = createTraceRay();
inlineTraceRay(call, analysisManager);

unsigned lgcRtStage = ~0u;
m_entryPoint->setMetadata(RtName::ContinufyStageMeta,
MDNode::get(*m_context, ConstantAsMetadata::get(m_builder->getInt32(lgcRtStage))));

CallInst *call = createTraceRay();
inlineTraceRay(call, analysisManager);
static auto visitor = llvm_dialects::VisitorBuilder<SpirvLowerRayTracing>()
.setStrategy(llvm_dialects::VisitorStrategy::ByFunctionDeclaration)
.add(&SpirvLowerRayTracing::visitGetHitAttributes)
Expand Down

0 comments on commit 9129dcf

Please sign in to comment.