CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
55 lines
1.8 KiB
C++
55 lines
1.8 KiB
C++
/*
|
|
* Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#include "paldevice.hpp"
|
|
|
|
#if defined(ATI_OS_LINUX)
|
|
namespace amd::pal {
|
|
bool Device::associateD3D9Device(void* d3d9Device) { return false; }
|
|
} // namespace amd::pal
|
|
#else // !ATI_OS_LINUX
|
|
|
|
#include <d3d9.h>
|
|
#include <dxgi.h>
|
|
|
|
/**************************************************************************************************************
|
|
* Note: ideally the DXX extension interfaces should be mapped from the DXX perforce branch.
|
|
* This means OCL client spec will need to change to include headers directly from the DXX perforce
|
|
*tree.
|
|
* However, OCL only cares about the DXX OpenCL extension interface class. The spec cannot change
|
|
* without notification. So it is safe to use a local copy of the relevant DXX extension interface
|
|
*classes.
|
|
**************************************************************************************************************/
|
|
#include "platform/DxxInteropExt.h"
|
|
|
|
namespace amd::pal {
|
|
|
|
bool Device::associateD3D9Device(void* d3d9Device) {
|
|
D3DCAPS9 pCaps;
|
|
IDirect3D9* p3d9dev;
|
|
LUID d3d9deviceLuid = {0, 0};
|
|
|
|
IDirect3DDevice9* pd3d9Device = static_cast<IDirect3DDevice9*>(d3d9Device);
|
|
|
|
// Get D3D9 Device caps
|
|
pd3d9Device->GetDeviceCaps(&pCaps);
|
|
// Get 3D9 Device
|
|
pd3d9Device->GetDirect3D(&p3d9dev);
|
|
|
|
IDirect3D9Ex* p3d9devEx = static_cast<IDirect3D9Ex*>(p3d9dev);
|
|
p3d9devEx->GetAdapterLUID(pCaps.AdapterOrdinal, &d3d9deviceLuid);
|
|
p3d9dev->Release();
|
|
|
|
// match the adapter
|
|
bool canInteroperate = (properties().osProperties.luidHighPart == d3d9deviceLuid.HighPart) &&
|
|
(properties().osProperties.luidLowPart == d3d9deviceLuid.LowPart);
|
|
|
|
return canInteroperate;
|
|
}
|
|
|
|
} // namespace amd::pal
|
|
#endif // !ATI_OS_WIN
|