mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[dxgi] Implement IDXGIAdapter4
This commit is contained in:
parent
26ea12b18e
commit
15f5efe4c3
@ -89,6 +89,7 @@ namespace dxvk {
|
|||||||
|| riid == __uuidof(IDXGIAdapter1)
|
|| riid == __uuidof(IDXGIAdapter1)
|
||||||
|| riid == __uuidof(IDXGIAdapter2)
|
|| riid == __uuidof(IDXGIAdapter2)
|
||||||
|| riid == __uuidof(IDXGIAdapter3)
|
|| riid == __uuidof(IDXGIAdapter3)
|
||||||
|
|| riid == __uuidof(IDXGIAdapter4)
|
||||||
|| riid == __uuidof(IDXGIDXVKAdapter)) {
|
|| riid == __uuidof(IDXGIDXVKAdapter)) {
|
||||||
*ppvObject = ref(this);
|
*ppvObject = ref(this);
|
||||||
return S_OK;
|
return S_OK;
|
||||||
@ -158,8 +159,8 @@ namespace dxvk {
|
|||||||
if (pDesc == nullptr)
|
if (pDesc == nullptr)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
|
||||||
DXGI_ADAPTER_DESC2 desc;
|
DXGI_ADAPTER_DESC3 desc;
|
||||||
HRESULT hr = GetDesc2(&desc);
|
HRESULT hr = GetDesc3(&desc);
|
||||||
|
|
||||||
if (SUCCEEDED(hr)) {
|
if (SUCCEEDED(hr)) {
|
||||||
std::memcpy(pDesc->Description, desc.Description, sizeof(pDesc->Description));
|
std::memcpy(pDesc->Description, desc.Description, sizeof(pDesc->Description));
|
||||||
@ -182,8 +183,8 @@ namespace dxvk {
|
|||||||
if (pDesc == nullptr)
|
if (pDesc == nullptr)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
|
||||||
DXGI_ADAPTER_DESC2 desc;
|
DXGI_ADAPTER_DESC3 desc;
|
||||||
HRESULT hr = GetDesc2(&desc);
|
HRESULT hr = GetDesc3(&desc);
|
||||||
|
|
||||||
if (SUCCEEDED(hr)) {
|
if (SUCCEEDED(hr)) {
|
||||||
std::memcpy(pDesc->Description, desc.Description, sizeof(pDesc->Description));
|
std::memcpy(pDesc->Description, desc.Description, sizeof(pDesc->Description));
|
||||||
@ -206,6 +207,34 @@ namespace dxvk {
|
|||||||
HRESULT STDMETHODCALLTYPE DxgiAdapter::GetDesc2(DXGI_ADAPTER_DESC2* pDesc) {
|
HRESULT STDMETHODCALLTYPE DxgiAdapter::GetDesc2(DXGI_ADAPTER_DESC2* pDesc) {
|
||||||
if (pDesc == nullptr)
|
if (pDesc == nullptr)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
|
||||||
|
DXGI_ADAPTER_DESC3 desc;
|
||||||
|
HRESULT hr = GetDesc3(&desc);
|
||||||
|
|
||||||
|
if (SUCCEEDED(hr)) {
|
||||||
|
std::memcpy(pDesc->Description, desc.Description, sizeof(pDesc->Description));
|
||||||
|
|
||||||
|
pDesc->VendorId = desc.VendorId;
|
||||||
|
pDesc->DeviceId = desc.DeviceId;
|
||||||
|
pDesc->SubSysId = desc.SubSysId;
|
||||||
|
pDesc->Revision = desc.Revision;
|
||||||
|
pDesc->DedicatedVideoMemory = desc.DedicatedVideoMemory;
|
||||||
|
pDesc->DedicatedSystemMemory = desc.DedicatedSystemMemory;
|
||||||
|
pDesc->SharedSystemMemory = desc.SharedSystemMemory;
|
||||||
|
pDesc->AdapterLuid = desc.AdapterLuid;
|
||||||
|
pDesc->Flags = desc.Flags;
|
||||||
|
pDesc->GraphicsPreemptionGranularity = desc.GraphicsPreemptionGranularity;
|
||||||
|
pDesc->ComputePreemptionGranularity = desc.ComputePreemptionGranularity;
|
||||||
|
}
|
||||||
|
|
||||||
|
return hr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
HRESULT STDMETHODCALLTYPE DxgiAdapter::GetDesc3(
|
||||||
|
DXGI_ADAPTER_DESC3* pDesc) {
|
||||||
|
if (pDesc == nullptr)
|
||||||
|
return E_INVALIDARG;
|
||||||
|
|
||||||
const DxgiOptions* options = m_factory->GetOptions();
|
const DxgiOptions* options = m_factory->GetOptions();
|
||||||
|
|
||||||
@ -271,7 +300,7 @@ namespace dxvk {
|
|||||||
pDesc->DedicatedSystemMemory = 0;
|
pDesc->DedicatedSystemMemory = 0;
|
||||||
pDesc->SharedSystemMemory = sharedMemory;
|
pDesc->SharedSystemMemory = sharedMemory;
|
||||||
pDesc->AdapterLuid = LUID { 0, 0 };
|
pDesc->AdapterLuid = LUID { 0, 0 };
|
||||||
pDesc->Flags = 0;
|
pDesc->Flags = DXGI_ADAPTER_FLAG3_NONE;
|
||||||
pDesc->GraphicsPreemptionGranularity = DXGI_GRAPHICS_PREEMPTION_DMA_BUFFER_BOUNDARY;
|
pDesc->GraphicsPreemptionGranularity = DXGI_GRAPHICS_PREEMPTION_DMA_BUFFER_BOUNDARY;
|
||||||
pDesc->ComputePreemptionGranularity = DXGI_COMPUTE_PREEMPTION_DMA_BUFFER_BOUNDARY;
|
pDesc->ComputePreemptionGranularity = DXGI_COMPUTE_PREEMPTION_DMA_BUFFER_BOUNDARY;
|
||||||
|
|
||||||
@ -282,8 +311,8 @@ namespace dxvk {
|
|||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE DxgiAdapter::QueryVideoMemoryInfo(
|
HRESULT STDMETHODCALLTYPE DxgiAdapter::QueryVideoMemoryInfo(
|
||||||
UINT NodeIndex,
|
UINT NodeIndex,
|
||||||
DXGI_MEMORY_SEGMENT_GROUP MemorySegmentGroup,
|
DXGI_MEMORY_SEGMENT_GROUP MemorySegmentGroup,
|
||||||
|
@ -75,6 +75,9 @@ namespace dxvk {
|
|||||||
HRESULT STDMETHODCALLTYPE GetDesc2(
|
HRESULT STDMETHODCALLTYPE GetDesc2(
|
||||||
DXGI_ADAPTER_DESC2* pDesc) final;
|
DXGI_ADAPTER_DESC2* pDesc) final;
|
||||||
|
|
||||||
|
HRESULT STDMETHODCALLTYPE GetDesc3(
|
||||||
|
DXGI_ADAPTER_DESC3* pDesc) final;
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE QueryVideoMemoryInfo(
|
HRESULT STDMETHODCALLTYPE QueryVideoMemoryInfo(
|
||||||
UINT NodeIndex,
|
UINT NodeIndex,
|
||||||
DXGI_MEMORY_SEGMENT_GROUP MemorySegmentGroup,
|
DXGI_MEMORY_SEGMENT_GROUP MemorySegmentGroup,
|
||||||
|
@ -86,7 +86,7 @@ IDXGIVkSwapChain : public IUnknown {
|
|||||||
* this interface.
|
* this interface.
|
||||||
*/
|
*/
|
||||||
MIDL_INTERFACE("907bf281-ea3c-43b4-a8e4-9f231107b4ff")
|
MIDL_INTERFACE("907bf281-ea3c-43b4-a8e4-9f231107b4ff")
|
||||||
IDXGIDXVKAdapter : public IDXGIAdapter3 {
|
IDXGIDXVKAdapter : public IDXGIAdapter4 {
|
||||||
virtual dxvk::Rc<dxvk::DxvkAdapter> STDMETHODCALLTYPE GetDXVKAdapter() = 0;
|
virtual dxvk::Rc<dxvk::DxvkAdapter> STDMETHODCALLTYPE GetDXVKAdapter() = 0;
|
||||||
|
|
||||||
virtual dxvk::Rc<dxvk::DxvkInstance> STDMETHODCALLTYPE GetDXVKInstance() = 0;
|
virtual dxvk::Rc<dxvk::DxvkInstance> STDMETHODCALLTYPE GetDXVKInstance() = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user