Zebin - Improving binding table generation

Allowing N:1 kernel_arg:bti mappings

Signed-off-by: Jaroslaw Chodor <jaroslaw.chodor@intel.com>
This commit is contained in:
Jaroslaw Chodor
2021-01-07 11:30:05 +01:00
committed by Compute-Runtime-Automation
parent 6a54bde164
commit 4c50a9e147
4 changed files with 22 additions and 7 deletions

View File

@@ -878,10 +878,14 @@ NEO::DecodeError populateKernelDescriptor(NEO::ProgramInfo &dst, NEO::Elf::Elf<N
auto generatedBindingTablePos = kernelDescriptor.generatedHeaps.size();
kernelDescriptor.generatedHeaps.resize(generatedBindingTablePos + numEntries * btiSize, 0U);
auto bindingTableIt = reinterpret_cast<int *>(kernelDescriptor.generatedHeaps.data() + generatedBindingTablePos);
for (auto &bti : bindingTableIndices) {
*bindingTableIt = bti.btiValue * 64U;
for (int i = 0; i < numEntries; ++i) {
*bindingTableIt = i * maxSurfaceStateSize;
++bindingTableIt;
}
for (auto &bti : bindingTableIndices) {
auto &explicitArg = kernelDescriptor.payloadMappings.explicitArgs[bti.argIndex];
switch (explicitArg.type) {
default:

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020 Intel Corporation
* Copyright (C) 2020-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -282,7 +282,7 @@ inline bool patchPointer(ArrayRef<uint8_t> buffer, const ArgDescPointer &arg, ui
if (arg.pointerSize == 8) {
return patchNonPointer(buffer, arg.stateless, static_cast<uint64_t>(value));
} else {
UNRECOVERABLE_IF(arg.pointerSize != 4);
UNRECOVERABLE_IF((arg.pointerSize != 4) && isValidOffset(arg.stateless));
return patchNonPointer(buffer, arg.stateless, static_cast<uint32_t>(value));
}
}