SWDEV-299127 - Support External Mipmap

Support hipExternalMemoryGetMappedMipmappedArray().
Add ImageExternalBuffer to differiate ImageBuffer.
Currently we only support tiling_optimal mode as
vulkan driver doesn't provide tiling information.

Change-Id: I7e3524cdde53e4df9f728894bcebf4bd3f58d4d9
This commit is contained in:
taosang2
2023-08-10 11:49:48 -04:00
committed by Tao Sang
parent e63c280d4d
commit 6398f604b0
12 changed files with 136 additions and 41 deletions
-21
View File
@@ -71,25 +71,4 @@ namespace amd
virtual ~ExternalBuffer() {}
};
// to be modified once image requirments are known, for now, implement like buffer
class ExternalImage final : public Buffer, public ExternalMemory
{
protected:
// Initializes device memory array, which is located after ExternalImage object in memory
void initDeviceMemory() {
deviceMemories_ =
reinterpret_cast<DeviceMemory*>(reinterpret_cast<char*>(this) + sizeof(ExternalImage));
memset(deviceMemories_, 0, context_().devices().size() * sizeof(DeviceMemory));
}
public:
ExternalImage(Context& amdContext, size_t size_in_bytes, amd::Os::FileDesc handle,
ExternalMemory::HandleType handle_type)
: Buffer(amdContext, 0, size_in_bytes), ExternalMemory(handle, handle_type) {
setInteropObj(this);
}
virtual ~ExternalImage() {}
};
}