+9
-3
tests/tests_aux_d3d_d3d11.cpp
+9
-3
tests/tests_aux_d3d_d3d11.cpp
···
93
93
handlesForImport.reserve(image_count);
94
94
95
95
for (HANDLE handle : handles) {
96
-
wil::unique_handle duped{u_graphics_buffer_ref(handle)};
96
+
/*!
97
+
* If shared resources have been allocated without using NT handles we can't use DuplicateHandle
98
+
* (like u_graphics_buffer_ref does internally).
99
+
* More info:
100
+
* https://learn.microsoft.com/en-us/windows/win32/api/dxgi/nf-dxgi-idxgiresource-getsharedhandle#remarks
101
+
*/
102
+
wil::unique_handle h{handle};
97
103
xrt_image_native xin;
98
-
xin.handle = duped.get();
104
+
xin.handle = h.get();
99
105
xin.size = 0;
100
106
xin.use_dedicated_allocation = use_dedicated_allocation;
101
107
102
-
handlesForImport.emplace_back(std::move(duped));
108
+
handlesForImport.emplace_back(std::move(h));
103
109
xins.emplace_back(xin);
104
110
}
105
111