Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement new functions from gpurt #2822

Merged
merged 2 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions llpc/lower/llpcSpirvProcessGpuRtLibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ SpirvProcessGpuRtLibrary::LibraryFunctionTable::LibraryFunctionTable() {
m_libFuncPtrs["AmdTraceRaySetParentId"] = &SpirvProcessGpuRtLibrary::createSetParentId;
m_libFuncPtrs["AmdTraceRayDispatchRaysIndex"] = &SpirvProcessGpuRtLibrary::createDispatchRayIndex;
m_libFuncPtrs["AmdTraceRayGetStaticId"] = &SpirvProcessGpuRtLibrary::createGetStaticId;
m_libFuncPtrs["AmdTraceRayGetKnownSetRayFlags"] = &SpirvProcessGpuRtLibrary::createGetKnownSetRayFlags;
m_libFuncPtrs["AmdTraceRayGetKnownUnsetRayFlags"] = &SpirvProcessGpuRtLibrary::createGetKnownUnsetRayFlags;
}

// =====================================================================================================================
Expand Down Expand Up @@ -639,4 +641,16 @@ void SpirvProcessGpuRtLibrary::createGetStaticId(llvm::Function *func) {
m_builder->CreateRet(m_builder->create<GpurtGetRayStaticIdOp>());
}

void SpirvProcessGpuRtLibrary::createGetKnownSetRayFlags(llvm::Function *func) {
// TODO: currently return 0 to indicate that there is no known set
// We will probably need to analyse the traceRay ray flags for actual value
m_builder->CreateRet(m_builder->getInt32(0));
}

void SpirvProcessGpuRtLibrary::createGetKnownUnsetRayFlags(llvm::Function *func) {
// TODO: return 0 to indicate there is no knownUnset bits
// We will probably need to analyse the traceRay ray flags for actual value
m_builder->CreateRet(m_builder->getInt32(0));
}

} // namespace Llpc
2 changes: 2 additions & 0 deletions llpc/lower/llpcSpirvProcessGpuRtLibrary.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ class SpirvProcessGpuRtLibrary : public SpirvLower, public llvm::PassInfoMixin<S
void createSetParentId(llvm::Function *func);
void createDispatchRayIndex(llvm::Function *func);
void createGetStaticId(llvm::Function *func);
void createGetKnownSetRayFlags(llvm::Function *func);
void createGetKnownUnsetRayFlags(llvm::Function *func);
llvm::Value *createGetBvhSrd(llvm::Value *expansion, llvm::Value *boxSortMode);
};
} // namespace Llpc
Loading