D3D12: Remove WrapSharedHandle

Removes WrapSharedHandle in favor of using
ExternalImageDXGI.

BUG=dawn:625

Change-Id: Ibd469600959aea344e7a59557d986fc673a79727
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/46020
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
This commit is contained in:
Bryan Bernhart 2021-03-25 21:31:34 +00:00 committed by Commit Bot service account
parent d9b56a02c5
commit 1a232448d2
2 changed files with 1 additions and 26 deletions

View File

@ -145,23 +145,6 @@ namespace dawn_native { namespace d3d12 {
memorySegment, requestedReservationSize);
}
WGPUTexture WrapSharedHandle(WGPUDevice device,
const ExternalImageDescriptorDXGISharedHandle* descriptor) {
std::unique_ptr<ExternalImageDXGI> externalImage =
ExternalImageDXGI::Create(device, descriptor);
if (externalImage == nullptr) {
return nullptr;
}
ExternalImageAccessDescriptorDXGIKeyedMutex externalAccessDesc = {};
externalAccessDesc.isInitialized = descriptor->isInitialized;
externalAccessDesc.isSwapChainTexture = descriptor->isSwapChainTexture;
externalAccessDesc.acquireMutexKey = descriptor->acquireMutexKey;
externalAccessDesc.usage = descriptor->cTextureDescriptor->usage;
return externalImage->ProduceTexture(device, &externalAccessDesc);
}
AdapterDiscoveryOptions::AdapterDiscoveryOptions(ComPtr<IDXGIAdapter> adapter)
: AdapterDiscoveryOptionsBase(WGPUBackendType_D3D12), dxgiAdapter(std::move(adapter)) {
}

View File

@ -48,11 +48,8 @@ namespace dawn_native { namespace d3d12 {
public:
ExternalImageDescriptorDXGISharedHandle();
// Note: SharedHandle must be a handle to a texture object.
HANDLE sharedHandle;
// Warning: depreciated, replaced by ExternalImageAccessDescriptorDXGIKeyedMutex.
uint64_t acquireMutexKey;
bool isSwapChainTexture = false;
};
struct DAWN_NATIVE_EXPORT ExternalImageAccessDescriptorDXGIKeyedMutex
@ -88,11 +85,6 @@ namespace dawn_native { namespace d3d12 {
uint32_t mSampleCount;
};
// Warning: depreciated, replaced by ExternalImageDXGI::Create.
// Note: SharedHandle must be a handle to a texture object.
DAWN_NATIVE_EXPORT WGPUTexture
WrapSharedHandle(WGPUDevice device, const ExternalImageDescriptorDXGISharedHandle* descriptor);
struct DAWN_NATIVE_EXPORT AdapterDiscoveryOptions : public AdapterDiscoveryOptionsBase {
AdapterDiscoveryOptions(Microsoft::WRL::ComPtr<IDXGIAdapter> adapter);