From c6627102d331f0af5f12489278b3d9adbf6b81d8 Mon Sep 17 00:00:00 2001 From: tiancyin Date: Thu, 29 May 2025 15:30:54 +0800 Subject: [PATCH] libhsakmt: fix resource count in memory export D3DKMTShareObjects() need resource count paramenter not the allocations count. There is only one resource no matter how many allocations for a buffer. Reviewed-by: Longlong Yao Signed-off-by: tiancyin --- wddm/gpu_memory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wddm/gpu_memory.cpp b/wddm/gpu_memory.cpp index 6677ea1fda..53a56466f0 100644 --- a/wddm/gpu_memory.cpp +++ b/wddm/gpu_memory.cpp @@ -406,7 +406,7 @@ ErrorCode GpuMemory::ExportPhysicalHandle(int* dmabuf_fd, uint32_t flags) { } if (IsShared()) - return d3dthunk::ShareObjects(num_allocations_, resource_, flags, dmabuf_fd); + return d3dthunk::ShareObjects(1, resource_, flags, dmabuf_fd); else return ErrorCode::UnSupported; }