mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
Improve error handling for shared handles in wddm.
Change-Id: I93d33d89cb4b6333924c362b54e0638174e44091
This commit is contained in:
committed by
sys_ocldev
parent
aba7dc637d
commit
b006972d07
@@ -695,6 +695,10 @@ bool Wddm::openSharedHandle(D3DKMT_HANDLE handle, WddmAllocation *alloc) {
|
||||
auto status = gdi->queryResourceInfo(&QueryResourceInfo);
|
||||
DEBUG_BREAK_IF(status != STATUS_SUCCESS);
|
||||
|
||||
if (QueryResourceInfo.NumAllocations == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
std::unique_ptr<char[]> allocPrivateData(new char[QueryResourceInfo.TotalPrivateDriverDataSize]);
|
||||
std::unique_ptr<char[]> resPrivateData(new char[QueryResourceInfo.ResourcePrivateDriverDataSize]);
|
||||
std::unique_ptr<char[]> resPrivateRuntimeData(new char[QueryResourceInfo.PrivateRuntimeDataSize]);
|
||||
@@ -721,7 +725,7 @@ bool Wddm::openSharedHandle(D3DKMT_HANDLE handle, WddmAllocation *alloc) {
|
||||
|
||||
alloc->gmm = Gmm::create((PGMM_RESOURCE_INFO)(allocationInfo[0].pPrivateDriverData));
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Wddm::openNTHandle(HANDLE handle, WddmAllocation *alloc) {
|
||||
@@ -757,7 +761,7 @@ bool Wddm::openNTHandle(HANDLE handle, WddmAllocation *alloc) {
|
||||
|
||||
alloc->gmm = Gmm::create((PGMM_RESOURCE_INFO)(allocationInfo2[0].pPrivateDriverData));
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
return true;
|
||||
}
|
||||
|
||||
void *Wddm::lockResource(WddmAllocation *wddmAllocation) {
|
||||
|
||||
Reference in New Issue
Block a user