mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-04 07:14:10 +08:00
Allocate per-tile RTDispatchGlobals, handle ray tracing patch tokens.
Related-to: NEO-6711 Signed-off-by: Raiyan Latif <raiyan.latif@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
0eb2001d8f
commit
f4879f064f
@@ -301,7 +301,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(K
|
||||
return ZE_RESULT_ERROR_UNINITIALIZED;
|
||||
} else {
|
||||
NEO::LinearStream *linearStream = commandContainer.getCommandStream();
|
||||
NEO::EncodeEnableRayTracing<GfxFamily>::programEnableRayTracing(*linearStream, *memoryBackedBuffer);
|
||||
NEO::EncodeEnableRayTracing<GfxFamily>::programEnableRayTracing(*linearStream, memoryBackedBuffer->getGpuAddress());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -904,23 +904,23 @@ ze_result_t KernelImp::initialize(const ze_kernel_desc_t *desc) {
|
||||
kernelDescriptor.kernelAttributes.hasNonKernelArgAtomic;
|
||||
|
||||
if (this->usesRayTracing()) {
|
||||
if (this->getImmutableData()->getDescriptor().payloadMappings.implicitArgs.rtDispatchGlobals.pointerSize > 0) {
|
||||
uint32_t bvhLevels = NEO::RayTracingHelper::maxBvhLevels;
|
||||
neoDevice->initializeRayTracing(bvhLevels);
|
||||
auto rtDispatchGlobals = neoDevice->getRTDispatchGlobals(bvhLevels);
|
||||
if (rtDispatchGlobals == nullptr) {
|
||||
return ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY;
|
||||
}
|
||||
this->residencyContainer.push_back(neoDevice->getRTMemoryBackedBuffer());
|
||||
this->residencyContainer.push_back(rtDispatchGlobals);
|
||||
|
||||
NEO::patchPointer(ArrayRef<uint8_t>(crossThreadData.get(), crossThreadDataSize),
|
||||
this->getImmutableData()->getDescriptor().payloadMappings.implicitArgs.rtDispatchGlobals,
|
||||
static_cast<uintptr_t>(rtDispatchGlobals->getGpuAddressToPatch()));
|
||||
} else {
|
||||
neoDevice->initializeRayTracing(0);
|
||||
this->residencyContainer.push_back(neoDevice->getRTMemoryBackedBuffer());
|
||||
uint32_t bvhLevels = NEO::RayTracingHelper::maxBvhLevels;
|
||||
neoDevice->initializeRayTracing(bvhLevels);
|
||||
auto rtDispatchGlobalsInfo = neoDevice->getRTDispatchGlobals(bvhLevels);
|
||||
if (rtDispatchGlobalsInfo == nullptr) {
|
||||
return ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY;
|
||||
}
|
||||
|
||||
for (auto rtDispatchGlobals : rtDispatchGlobalsInfo->rtDispatchGlobals) {
|
||||
this->residencyContainer.push_back(rtDispatchGlobals);
|
||||
}
|
||||
|
||||
auto address = rtDispatchGlobalsInfo->rtDispatchGlobals[0]->getGpuAddressToPatch();
|
||||
NEO::patchPointer(ArrayRef<uint8_t>(crossThreadData.get(), crossThreadDataSize),
|
||||
this->getImmutableData()->getDescriptor().payloadMappings.implicitArgs.rtDispatchGlobals,
|
||||
static_cast<uintptr_t>(address));
|
||||
|
||||
this->residencyContainer.push_back(neoDevice->getRTMemoryBackedBuffer());
|
||||
}
|
||||
|
||||
return ZE_RESULT_SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user