feature: bindless addressing - store bindlessInfo in allocation

- store surface state info for bindless addressing in graphics
allocation
- remove map in BindlessHeapsHelper - bindlessInfo is constant for
the lifetime of an allocation
- program bindless offsets and surface states for images when used in
bindless kernel
- handle ouf of memory on surface state heap - return error

Related-To: NEO-7063

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2023-07-21 11:55:22 +00:00
committed by Compute-Runtime-Automation
parent e52712b800
commit 67d39f88e6
10 changed files with 240 additions and 61 deletions

View File

@@ -35,6 +35,7 @@ constexpr auto nonSharedResource = 0u;
class Gmm;
class MemoryManager;
class CommandStreamReceiver;
class GraphicsAllocation;
struct AubInfo {
uint32_t aubWritable = std::numeric_limits<uint32_t>::max();
@@ -45,6 +46,12 @@ struct AubInfo {
bool writeMemoryOnly = false;
};
struct SurfaceStateInHeapInfo {
GraphicsAllocation *heapAllocation;
uint64_t surfaceStateOffset;
void *ssPtr;
};
class GraphicsAllocation : public IDNode<GraphicsAllocation> {
public:
enum UsmInitialPlacement {
@@ -286,6 +293,21 @@ class GraphicsAllocation : public IDNode<GraphicsAllocation> {
return residency;
}
uint64_t getBindlessOffset() {
if (bindlessInfo.heapAllocation == nullptr) {
return std::numeric_limits<uint64_t>::max();
}
return bindlessInfo.surfaceStateOffset;
}
void setBindlessInfo(const SurfaceStateInHeapInfo &info) {
bindlessInfo = info;
}
SurfaceStateInHeapInfo getBindlessInfo() {
return bindlessInfo;
}
OsHandleStorage fragmentsStorage;
StorageInfo storageInfo = {};
@@ -341,6 +363,7 @@ class GraphicsAllocation : public IDNode<GraphicsAllocation> {
AubInfo aubInfo;
SharingInfo sharingInfo;
ReservedAddressRange reservedAddressRangeInfo;
SurfaceStateInHeapInfo bindlessInfo = {nullptr, 0, nullptr};
uint64_t allocationOffset = 0u;
uint64_t gpuBaseAddress = 0;