mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 12:23:31 +00:00
[DXGI] This doesn't belong to trunk. [WBEMPROX] Disable the code that depends on dxgi.dll.
svn path=/trunk/; revision=69779
This commit is contained in:
@@ -34,7 +34,6 @@ add_subdirectory(dplay)
|
||||
add_subdirectory(dplayx)
|
||||
add_subdirectory(dsound)
|
||||
add_subdirectory(dxdiagn)
|
||||
add_subdirectory(dxgi)
|
||||
add_subdirectory(msdmo)
|
||||
add_subdirectory(qedit)
|
||||
add_subdirectory(quartz)
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
|
||||
add_definitions(-D__WINESRC__)
|
||||
include_directories(BEFORE ${REACTOS_SOURCE_DIR}/include/reactos/wine)
|
||||
spec2def(dxgi.dll dxgi.spec ADD_IMPORTLIB)
|
||||
|
||||
list(APPEND SOURCE
|
||||
adapter.c
|
||||
device.c
|
||||
dxgi_main.c
|
||||
factory.c
|
||||
output.c
|
||||
surface.c
|
||||
swapchain.c
|
||||
utils.c
|
||||
dxgi_private.h)
|
||||
|
||||
add_library(dxgi SHARED
|
||||
${SOURCE}
|
||||
guid.c
|
||||
version.rc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/dxgi.def)
|
||||
|
||||
set_module_type(dxgi win32dll)
|
||||
target_link_libraries(dxgi uuid dxgi_uuids wine)
|
||||
add_importlibs(dxgi d3dwine user32 msvcrt kernel32 ntdll)
|
||||
add_dependencies(dxgi wineheaders)
|
||||
add_pch(dxgi dxgi_private.h SOURCE)
|
||||
add_cd_file(TARGET dxgi DESTINATION reactos/system32 FOR all)
|
||||
@@ -1,247 +0,0 @@
|
||||
/*
|
||||
* Copyright 2008 Henri Verbeet for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*
|
||||
*/
|
||||
|
||||
#include "dxgi_private.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
static inline struct dxgi_adapter *impl_from_IDXGIAdapter1(IDXGIAdapter1 *iface)
|
||||
{
|
||||
return CONTAINING_RECORD(iface, struct dxgi_adapter, IDXGIAdapter1_iface);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_adapter_QueryInterface(IDXGIAdapter1 *iface, REFIID iid, void **out)
|
||||
{
|
||||
TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out);
|
||||
|
||||
if (IsEqualGUID(iid, &IID_IDXGIAdapter1)
|
||||
|| IsEqualGUID(iid, &IID_IDXGIAdapter)
|
||||
|| IsEqualGUID(iid, &IID_IDXGIObject)
|
||||
|| IsEqualGUID(iid, &IID_IUnknown))
|
||||
{
|
||||
IUnknown_AddRef(iface);
|
||||
*out = iface;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid));
|
||||
|
||||
*out = NULL;
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE dxgi_adapter_AddRef(IDXGIAdapter1 *iface)
|
||||
{
|
||||
struct dxgi_adapter *adapter = impl_from_IDXGIAdapter1(iface);
|
||||
ULONG refcount = InterlockedIncrement(&adapter->refcount);
|
||||
|
||||
TRACE("%p increasing refcount to %u.\n", iface, refcount);
|
||||
|
||||
return refcount;
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE dxgi_adapter_Release(IDXGIAdapter1 *iface)
|
||||
{
|
||||
struct dxgi_adapter *adapter = impl_from_IDXGIAdapter1(iface);
|
||||
ULONG refcount = InterlockedDecrement(&adapter->refcount);
|
||||
|
||||
TRACE("%p decreasing refcount to %u.\n", iface, refcount);
|
||||
|
||||
if (!refcount)
|
||||
{
|
||||
IDXGIOutput_Release(adapter->output);
|
||||
wined3d_private_store_cleanup(&adapter->private_store);
|
||||
HeapFree(GetProcessHeap(), 0, adapter);
|
||||
}
|
||||
|
||||
return refcount;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_adapter_SetPrivateData(IDXGIAdapter1 *iface,
|
||||
REFGUID guid, UINT data_size, const void *data)
|
||||
{
|
||||
struct dxgi_adapter *adapter = impl_from_IDXGIAdapter1(iface);
|
||||
|
||||
TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
|
||||
|
||||
return dxgi_set_private_data(&adapter->private_store, guid, data_size, data);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_adapter_SetPrivateDataInterface(IDXGIAdapter1 *iface,
|
||||
REFGUID guid, const IUnknown *object)
|
||||
{
|
||||
struct dxgi_adapter *adapter = impl_from_IDXGIAdapter1(iface);
|
||||
|
||||
TRACE("iface %p, guid %s, object %p.\n", iface, debugstr_guid(guid), object);
|
||||
|
||||
return dxgi_set_private_data_interface(&adapter->private_store, guid, object);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetPrivateData(IDXGIAdapter1 *iface,
|
||||
REFGUID guid, UINT *data_size, void *data)
|
||||
{
|
||||
struct dxgi_adapter *adapter = impl_from_IDXGIAdapter1(iface);
|
||||
|
||||
TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
|
||||
|
||||
return dxgi_get_private_data(&adapter->private_store, guid, data_size, data);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetParent(IDXGIAdapter1 *iface, REFIID iid, void **parent)
|
||||
{
|
||||
struct dxgi_adapter *adapter = impl_from_IDXGIAdapter1(iface);
|
||||
|
||||
TRACE("iface %p, iid %s, parent %p\n", iface, debugstr_guid(iid), parent);
|
||||
|
||||
return IDXGIFactory1_QueryInterface(&adapter->parent->IDXGIFactory1_iface, iid, parent);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_adapter_EnumOutputs(IDXGIAdapter1 *iface,
|
||||
UINT output_idx, IDXGIOutput **output)
|
||||
{
|
||||
struct dxgi_adapter *adapter = impl_from_IDXGIAdapter1(iface);
|
||||
|
||||
TRACE("iface %p, output_idx %u, output %p.\n", iface, output_idx, output);
|
||||
|
||||
if (output_idx > 0)
|
||||
{
|
||||
*output = NULL;
|
||||
return DXGI_ERROR_NOT_FOUND;
|
||||
}
|
||||
|
||||
*output = adapter->output;
|
||||
IDXGIOutput_AddRef(*output);
|
||||
|
||||
TRACE("Returning output %p.\n", output);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetDesc1(IDXGIAdapter1 *iface, DXGI_ADAPTER_DESC1 *desc)
|
||||
{
|
||||
struct dxgi_adapter *adapter = impl_from_IDXGIAdapter1(iface);
|
||||
struct wined3d_adapter_identifier adapter_id;
|
||||
char description[128];
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, desc %p.\n", iface, desc);
|
||||
|
||||
if (!desc)
|
||||
return E_INVALIDARG;
|
||||
|
||||
adapter_id.driver_size = 0;
|
||||
adapter_id.description = description;
|
||||
adapter_id.description_size = sizeof(description);
|
||||
adapter_id.device_name_size = 0;
|
||||
|
||||
EnterCriticalSection(&dxgi_cs);
|
||||
hr = wined3d_get_adapter_identifier(adapter->parent->wined3d, adapter->ordinal, 0, &adapter_id);
|
||||
LeaveCriticalSection(&dxgi_cs);
|
||||
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
if (!MultiByteToWideChar(CP_ACP, 0, description, -1, desc->Description, 128))
|
||||
{
|
||||
DWORD err = GetLastError();
|
||||
ERR("Failed to translate description %s (%#x).\n", debugstr_a(description), err);
|
||||
hr = E_FAIL;
|
||||
}
|
||||
|
||||
desc->VendorId = adapter_id.vendor_id;
|
||||
desc->DeviceId = adapter_id.device_id;
|
||||
desc->SubSysId = adapter_id.subsystem_id;
|
||||
desc->Revision = adapter_id.revision;
|
||||
desc->DedicatedVideoMemory = adapter_id.video_memory;
|
||||
desc->DedicatedSystemMemory = 0; /* FIXME */
|
||||
desc->SharedSystemMemory = 0; /* FIXME */
|
||||
memcpy(&desc->AdapterLuid, &adapter_id.adapter_luid, sizeof(desc->AdapterLuid));
|
||||
desc->Flags = 0;
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetDesc(IDXGIAdapter1 *iface, DXGI_ADAPTER_DESC *desc)
|
||||
{
|
||||
DXGI_ADAPTER_DESC1 desc1;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, desc %p.\n", iface, desc);
|
||||
|
||||
if (!desc)
|
||||
return E_INVALIDARG;
|
||||
|
||||
if (FAILED(hr = dxgi_adapter_GetDesc1(iface, &desc1)))
|
||||
return hr;
|
||||
memcpy(desc, &desc1, sizeof(*desc));
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_adapter_CheckInterfaceSupport(IDXGIAdapter1 *iface,
|
||||
REFGUID guid, LARGE_INTEGER *umd_version)
|
||||
{
|
||||
FIXME("iface %p, guid %s, umd_version %p stub!\n", iface, debugstr_guid(guid), umd_version);
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static const struct IDXGIAdapter1Vtbl dxgi_adapter_vtbl =
|
||||
{
|
||||
dxgi_adapter_QueryInterface,
|
||||
dxgi_adapter_AddRef,
|
||||
dxgi_adapter_Release,
|
||||
dxgi_adapter_SetPrivateData,
|
||||
dxgi_adapter_SetPrivateDataInterface,
|
||||
dxgi_adapter_GetPrivateData,
|
||||
dxgi_adapter_GetParent,
|
||||
dxgi_adapter_EnumOutputs,
|
||||
dxgi_adapter_GetDesc,
|
||||
dxgi_adapter_CheckInterfaceSupport,
|
||||
dxgi_adapter_GetDesc1,
|
||||
};
|
||||
|
||||
struct dxgi_adapter *unsafe_impl_from_IDXGIAdapter1(IDXGIAdapter1 *iface)
|
||||
{
|
||||
if (!iface)
|
||||
return NULL;
|
||||
assert(iface->lpVtbl == &dxgi_adapter_vtbl);
|
||||
return CONTAINING_RECORD(iface, struct dxgi_adapter, IDXGIAdapter1_iface);
|
||||
}
|
||||
|
||||
HRESULT dxgi_adapter_init(struct dxgi_adapter *adapter, struct dxgi_factory *parent, UINT ordinal)
|
||||
{
|
||||
struct dxgi_output *output;
|
||||
|
||||
adapter->IDXGIAdapter1_iface.lpVtbl = &dxgi_adapter_vtbl;
|
||||
adapter->parent = parent;
|
||||
adapter->refcount = 1;
|
||||
wined3d_private_store_init(&adapter->private_store);
|
||||
adapter->ordinal = ordinal;
|
||||
|
||||
if (!(output = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*output))))
|
||||
{
|
||||
wined3d_private_store_cleanup(&adapter->private_store);
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
dxgi_output_init(output, adapter);
|
||||
adapter->output = &output->IDXGIOutput_iface;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -1,427 +0,0 @@
|
||||
/*
|
||||
* Copyright 2008 Henri Verbeet for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*
|
||||
*/
|
||||
|
||||
#include "dxgi_private.h"
|
||||
|
||||
static inline struct dxgi_device *impl_from_IWineDXGIDevice(IWineDXGIDevice *iface)
|
||||
{
|
||||
return CONTAINING_RECORD(iface, struct dxgi_device, IWineDXGIDevice_iface);
|
||||
}
|
||||
|
||||
/* IUnknown methods */
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_device_QueryInterface(IWineDXGIDevice *iface, REFIID riid, void **object)
|
||||
{
|
||||
struct dxgi_device *This = impl_from_IWineDXGIDevice(iface);
|
||||
|
||||
TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object);
|
||||
|
||||
if (IsEqualGUID(riid, &IID_IUnknown)
|
||||
|| IsEqualGUID(riid, &IID_IDXGIObject)
|
||||
|| IsEqualGUID(riid, &IID_IDXGIDevice)
|
||||
|| IsEqualGUID(riid, &IID_IWineDXGIDevice))
|
||||
{
|
||||
IUnknown_AddRef(iface);
|
||||
*object = iface;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
if (This->child_layer)
|
||||
{
|
||||
TRACE("forwarding to child layer %p\n", This->child_layer);
|
||||
return IUnknown_QueryInterface(This->child_layer, riid, object);
|
||||
}
|
||||
|
||||
WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
|
||||
|
||||
*object = NULL;
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE dxgi_device_AddRef(IWineDXGIDevice *iface)
|
||||
{
|
||||
struct dxgi_device *This = impl_from_IWineDXGIDevice(iface);
|
||||
ULONG refcount = InterlockedIncrement(&This->refcount);
|
||||
|
||||
TRACE("%p increasing refcount to %u\n", This, refcount);
|
||||
|
||||
return refcount;
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE dxgi_device_Release(IWineDXGIDevice *iface)
|
||||
{
|
||||
struct dxgi_device *This = impl_from_IWineDXGIDevice(iface);
|
||||
ULONG refcount = InterlockedDecrement(&This->refcount);
|
||||
|
||||
TRACE("%p decreasing refcount to %u\n", This, refcount);
|
||||
|
||||
if (!refcount)
|
||||
{
|
||||
if (This->child_layer) IUnknown_Release(This->child_layer);
|
||||
EnterCriticalSection(&dxgi_cs);
|
||||
wined3d_device_uninit_3d(This->wined3d_device);
|
||||
wined3d_device_decref(This->wined3d_device);
|
||||
LeaveCriticalSection(&dxgi_cs);
|
||||
IDXGIFactory1_Release(This->factory);
|
||||
wined3d_private_store_cleanup(&This->private_store);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
}
|
||||
|
||||
return refcount;
|
||||
}
|
||||
|
||||
/* IDXGIObject methods */
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_device_SetPrivateData(IWineDXGIDevice *iface,
|
||||
REFGUID guid, UINT data_size, const void *data)
|
||||
{
|
||||
struct dxgi_device *device = impl_from_IWineDXGIDevice(iface);
|
||||
|
||||
TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
|
||||
|
||||
return dxgi_set_private_data(&device->private_store, guid, data_size, data);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_device_SetPrivateDataInterface(IWineDXGIDevice *iface,
|
||||
REFGUID guid, const IUnknown *object)
|
||||
{
|
||||
struct dxgi_device *device = impl_from_IWineDXGIDevice(iface);
|
||||
|
||||
TRACE("iface %p, guid %s, object %p.\n", iface, debugstr_guid(guid), object);
|
||||
|
||||
return dxgi_set_private_data_interface(&device->private_store, guid, object);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_device_GetPrivateData(IWineDXGIDevice *iface,
|
||||
REFGUID guid, UINT *data_size, void *data)
|
||||
{
|
||||
struct dxgi_device *device = impl_from_IWineDXGIDevice(iface);
|
||||
|
||||
TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
|
||||
|
||||
return dxgi_get_private_data(&device->private_store, guid, data_size, data);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_device_GetParent(IWineDXGIDevice *iface, REFIID riid, void **parent)
|
||||
{
|
||||
IDXGIAdapter *adapter;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, riid %s, parent %p.\n", iface, debugstr_guid(riid), parent);
|
||||
|
||||
hr = IWineDXGIDevice_GetAdapter(iface, &adapter);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
ERR("Failed to get adapter, hr %#x.\n", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
hr = IDXGIAdapter_QueryInterface(adapter, riid, parent);
|
||||
IDXGIAdapter_Release(adapter);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/* IDXGIDevice methods */
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_device_GetAdapter(IWineDXGIDevice *iface, IDXGIAdapter **adapter)
|
||||
{
|
||||
struct dxgi_device *This = impl_from_IWineDXGIDevice(iface);
|
||||
struct wined3d_device_creation_parameters create_parameters;
|
||||
|
||||
TRACE("iface %p, adapter %p\n", iface, adapter);
|
||||
|
||||
EnterCriticalSection(&dxgi_cs);
|
||||
wined3d_device_get_creation_parameters(This->wined3d_device, &create_parameters);
|
||||
LeaveCriticalSection(&dxgi_cs);
|
||||
|
||||
return IDXGIFactory1_EnumAdapters(This->factory, create_parameters.adapter_idx, adapter);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_device_CreateSurface(IWineDXGIDevice *iface,
|
||||
const DXGI_SURFACE_DESC *desc, UINT surface_count, DXGI_USAGE usage,
|
||||
const DXGI_SHARED_RESOURCE *shared_resource, IDXGISurface **surface)
|
||||
{
|
||||
struct wined3d_device_parent *device_parent;
|
||||
struct wined3d_resource_desc surface_desc;
|
||||
IWineDXGIDeviceParent *dxgi_device_parent;
|
||||
HRESULT hr;
|
||||
UINT i;
|
||||
UINT j;
|
||||
|
||||
TRACE("iface %p, desc %p, surface_count %u, usage %#x, shared_resource %p, surface %p\n",
|
||||
iface, desc, surface_count, usage, shared_resource, surface);
|
||||
|
||||
hr = IWineDXGIDevice_QueryInterface(iface, &IID_IWineDXGIDeviceParent, (void **)&dxgi_device_parent);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
ERR("Device should implement IWineD3DDeviceParent\n");
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
device_parent = IWineDXGIDeviceParent_get_wined3d_device_parent(dxgi_device_parent);
|
||||
|
||||
FIXME("Implement DXGI<->wined3d usage conversion\n");
|
||||
surface_desc.resource_type = WINED3D_RTYPE_SURFACE;
|
||||
surface_desc.format = wined3dformat_from_dxgi_format(desc->Format);
|
||||
surface_desc.multisample_type = desc->SampleDesc.Count > 1 ? desc->SampleDesc.Count : WINED3D_MULTISAMPLE_NONE;
|
||||
surface_desc.multisample_quality = desc->SampleDesc.Quality;
|
||||
surface_desc.usage = usage;
|
||||
surface_desc.pool = WINED3D_POOL_DEFAULT;
|
||||
surface_desc.width = desc->Width;
|
||||
surface_desc.height = desc->Height;
|
||||
surface_desc.depth = 1;
|
||||
surface_desc.size = 0;
|
||||
|
||||
memset(surface, 0, surface_count * sizeof(*surface));
|
||||
for (i = 0; i < surface_count; ++i)
|
||||
{
|
||||
struct wined3d_surface *wined3d_surface;
|
||||
IUnknown *parent;
|
||||
|
||||
if (FAILED(hr = device_parent->ops->create_swapchain_surface(device_parent,
|
||||
NULL, &surface_desc, &wined3d_surface)))
|
||||
{
|
||||
ERR("Failed to create surface, hr %#x.\n", hr);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
parent = wined3d_surface_get_parent(wined3d_surface);
|
||||
hr = IUnknown_QueryInterface(parent, &IID_IDXGISurface, (void **)&surface[i]);
|
||||
wined3d_surface_decref(wined3d_surface);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
ERR("Surface should implement IDXGISurface\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
TRACE("Created IDXGISurface %p (%u/%u)\n", surface[i], i + 1, surface_count);
|
||||
}
|
||||
IWineDXGIDeviceParent_Release(dxgi_device_parent);
|
||||
|
||||
return S_OK;
|
||||
|
||||
fail:
|
||||
for (j = 0; j < i; ++j)
|
||||
{
|
||||
IDXGISurface_Release(surface[i]);
|
||||
}
|
||||
IWineDXGIDeviceParent_Release(dxgi_device_parent);
|
||||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_device_QueryResourceResidency(IWineDXGIDevice *iface,
|
||||
IUnknown *const *resources, DXGI_RESIDENCY *residency, UINT resource_count)
|
||||
{
|
||||
FIXME("iface %p, resources %p, residency %p, resource_count %u stub!\n",
|
||||
iface, resources, residency, resource_count);
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_device_SetGPUThreadPriority(IWineDXGIDevice *iface, INT priority)
|
||||
{
|
||||
FIXME("iface %p, priority %d stub!\n", iface, priority);
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_device_GetGPUThreadPriority(IWineDXGIDevice *iface, INT *priority)
|
||||
{
|
||||
FIXME("iface %p, priority %p stub!\n", iface, priority);
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
/* IWineDXGIDevice methods */
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_device_create_surface(IWineDXGIDevice *iface, const DXGI_SURFACE_DESC *desc,
|
||||
DXGI_USAGE usage, const DXGI_SHARED_RESOURCE *shared_resource, IUnknown *outer, void **surface)
|
||||
{
|
||||
struct dxgi_surface *object;
|
||||
HRESULT hr;
|
||||
|
||||
FIXME("iface %p, desc %p, usage %#x, shared_resource %p, outer %p, surface %p partial stub!\n",
|
||||
iface, desc, usage, shared_resource, outer, surface);
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate DXGI surface object memory\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
if (FAILED(hr = dxgi_surface_init(object, (IDXGIDevice *)iface, outer, desc)))
|
||||
{
|
||||
WARN("Failed to initialize surface, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created IDXGISurface %p\n", object);
|
||||
*surface = outer ? &object->IUnknown_iface : (IUnknown *)&object->IDXGISurface_iface;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_device_create_swapchain(IWineDXGIDevice *iface,
|
||||
struct wined3d_swapchain_desc *desc, struct wined3d_swapchain **wined3d_swapchain)
|
||||
{
|
||||
struct dxgi_device *This = impl_from_IWineDXGIDevice(iface);
|
||||
struct dxgi_swapchain *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, desc %p, wined3d_swapchain %p.\n",
|
||||
iface, desc, wined3d_swapchain);
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate DXGI swapchain object memory\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
hr = dxgi_swapchain_init(object, This, desc);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize swapchain, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created IDXGISwapChain %p\n", object);
|
||||
*wined3d_swapchain = object->wined3d_swapchain;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static const struct IWineDXGIDeviceVtbl dxgi_device_vtbl =
|
||||
{
|
||||
/* IUnknown methods */
|
||||
dxgi_device_QueryInterface,
|
||||
dxgi_device_AddRef,
|
||||
dxgi_device_Release,
|
||||
/* IDXGIObject methods */
|
||||
dxgi_device_SetPrivateData,
|
||||
dxgi_device_SetPrivateDataInterface,
|
||||
dxgi_device_GetPrivateData,
|
||||
dxgi_device_GetParent,
|
||||
/* IDXGIDevice methods */
|
||||
dxgi_device_GetAdapter,
|
||||
dxgi_device_CreateSurface,
|
||||
dxgi_device_QueryResourceResidency,
|
||||
dxgi_device_SetGPUThreadPriority,
|
||||
dxgi_device_GetGPUThreadPriority,
|
||||
/* IWineDXGIDevice methods */
|
||||
dxgi_device_create_surface,
|
||||
dxgi_device_create_swapchain,
|
||||
};
|
||||
|
||||
HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *layer,
|
||||
IDXGIFactory *factory, IDXGIAdapter *adapter)
|
||||
{
|
||||
struct wined3d_device_parent *wined3d_device_parent;
|
||||
struct wined3d_swapchain_desc swapchain_desc;
|
||||
IWineDXGIDeviceParent *dxgi_device_parent;
|
||||
struct dxgi_adapter *dxgi_adapter;
|
||||
struct dxgi_factory *dxgi_factory;
|
||||
void *layer_base;
|
||||
HRESULT hr;
|
||||
WINED3DCAPS caps;
|
||||
|
||||
if (!(dxgi_factory = unsafe_impl_from_IDXGIFactory1((IDXGIFactory1 *)factory)))
|
||||
{
|
||||
WARN("This is not the factory we're looking for.\n");
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (!(dxgi_adapter = unsafe_impl_from_IDXGIAdapter1((IDXGIAdapter1 *)adapter)))
|
||||
{
|
||||
WARN("This is not the adapter we're looking for.\n");
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
device->IWineDXGIDevice_iface.lpVtbl = &dxgi_device_vtbl;
|
||||
device->refcount = 1;
|
||||
wined3d_private_store_init(&device->private_store);
|
||||
|
||||
layer_base = device + 1;
|
||||
|
||||
if (FAILED(hr = layer->create(layer->id, &layer_base, 0,
|
||||
device, &IID_IUnknown, (void **)&device->child_layer)))
|
||||
{
|
||||
WARN("Failed to create device, returning %#x.\n", hr);
|
||||
wined3d_private_store_cleanup(&device->private_store);
|
||||
return hr;
|
||||
}
|
||||
|
||||
if (FAILED(hr = IWineDXGIDevice_QueryInterface(&device->IWineDXGIDevice_iface,
|
||||
&IID_IWineDXGIDeviceParent, (void **)&dxgi_device_parent)))
|
||||
{
|
||||
ERR("DXGI device should implement IWineD3DDeviceParent.\n");
|
||||
IUnknown_Release(device->child_layer);
|
||||
wined3d_private_store_cleanup(&device->private_store);
|
||||
return hr;
|
||||
}
|
||||
wined3d_device_parent = IWineDXGIDeviceParent_get_wined3d_device_parent(dxgi_device_parent);
|
||||
IWineDXGIDeviceParent_Release(dxgi_device_parent);
|
||||
|
||||
FIXME("Ignoring adapter type.\n");
|
||||
|
||||
hr = wined3d_get_device_caps(dxgi_factory->wined3d, dxgi_adapter->ordinal, WINED3D_DEVICE_TYPE_HAL, &caps);
|
||||
if (FAILED(hr) || caps.VertexShaderVersion < 4 || caps.PixelShaderVersion < 4)
|
||||
{
|
||||
WARN("Direct3D 10 is not supported on this GPU with the current shader backend.\n");
|
||||
if (SUCCEEDED(hr))
|
||||
hr = E_FAIL;
|
||||
IUnknown_Release(device->child_layer);
|
||||
wined3d_private_store_cleanup(&device->private_store);
|
||||
return hr;
|
||||
}
|
||||
|
||||
EnterCriticalSection(&dxgi_cs);
|
||||
hr = wined3d_device_create(dxgi_factory->wined3d, dxgi_adapter->ordinal, WINED3D_DEVICE_TYPE_HAL,
|
||||
NULL, 0, 4, wined3d_device_parent, &device->wined3d_device);
|
||||
LeaveCriticalSection(&dxgi_cs);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to create a wined3d device, returning %#x.\n", hr);
|
||||
IUnknown_Release(device->child_layer);
|
||||
wined3d_private_store_cleanup(&device->private_store);
|
||||
return hr;
|
||||
}
|
||||
|
||||
memset(&swapchain_desc, 0, sizeof(swapchain_desc));
|
||||
swapchain_desc.swap_effect = WINED3D_SWAP_EFFECT_DISCARD;
|
||||
swapchain_desc.device_window = dxgi_factory_get_device_window(dxgi_factory);
|
||||
swapchain_desc.windowed = TRUE;
|
||||
if (FAILED(hr = wined3d_device_init_3d(device->wined3d_device, &swapchain_desc)))
|
||||
{
|
||||
ERR("Failed to initialize 3D, hr %#x.\n", hr);
|
||||
wined3d_device_decref(device->wined3d_device);
|
||||
IUnknown_Release(device->child_layer);
|
||||
wined3d_private_store_cleanup(&device->private_store);
|
||||
return hr;
|
||||
}
|
||||
|
||||
device->factory = &dxgi_factory->IDXGIFactory1_iface;
|
||||
IDXGIFactory1_AddRef(device->factory);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
@ stdcall CreateDXGIFactory(ptr ptr)
|
||||
@ stdcall CreateDXGIFactory1(ptr ptr)
|
||||
@ stdcall DXGID3D10CreateDevice(ptr ptr ptr long ptr ptr)
|
||||
@ stdcall DXGID3D10RegisterLayers(ptr long)
|
||||
@@ -1,238 +0,0 @@
|
||||
/*
|
||||
* Copyright 2008 Henri Verbeet for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*
|
||||
*/
|
||||
|
||||
#include "dxgi_private.h"
|
||||
|
||||
static CRITICAL_SECTION_DEBUG dxgi_cs_debug =
|
||||
{
|
||||
0, 0, &dxgi_cs,
|
||||
{&dxgi_cs_debug.ProcessLocksList,
|
||||
&dxgi_cs_debug.ProcessLocksList},
|
||||
0, 0, {(DWORD_PTR)(__FILE__ ": dxgi_cs")}
|
||||
};
|
||||
CRITICAL_SECTION dxgi_cs = {&dxgi_cs_debug, -1, 0, 0, 0, 0};
|
||||
|
||||
struct dxgi_main
|
||||
{
|
||||
HMODULE d3d10core;
|
||||
struct dxgi_device_layer *device_layers;
|
||||
UINT layer_count;
|
||||
};
|
||||
static struct dxgi_main dxgi_main;
|
||||
|
||||
static void dxgi_main_cleanup(void)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, dxgi_main.device_layers);
|
||||
FreeLibrary(dxgi_main.d3d10core);
|
||||
DeleteCriticalSection(&dxgi_cs);
|
||||
}
|
||||
|
||||
BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, void *reserved)
|
||||
{
|
||||
switch (reason)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
DisableThreadLibraryCalls(inst);
|
||||
break;
|
||||
|
||||
case DLL_PROCESS_DETACH:
|
||||
if (!reserved)
|
||||
dxgi_main_cleanup();
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
HRESULT WINAPI CreateDXGIFactory1(REFIID riid, void **factory)
|
||||
{
|
||||
TRACE("riid %s, factory %p\n", debugstr_guid(riid), factory);
|
||||
|
||||
return dxgi_factory_create(riid, factory, TRUE);
|
||||
}
|
||||
|
||||
HRESULT WINAPI CreateDXGIFactory(REFIID riid, void **factory)
|
||||
{
|
||||
TRACE("riid %s, factory %p\n", debugstr_guid(riid), factory);
|
||||
|
||||
return dxgi_factory_create(riid, factory, FALSE);
|
||||
}
|
||||
|
||||
static BOOL get_layer(enum dxgi_device_layer_id id, struct dxgi_device_layer *layer)
|
||||
{
|
||||
UINT i;
|
||||
|
||||
EnterCriticalSection(&dxgi_cs);
|
||||
|
||||
for (i = 0; i < dxgi_main.layer_count; ++i)
|
||||
{
|
||||
if (dxgi_main.device_layers[i].id == id)
|
||||
{
|
||||
*layer = dxgi_main.device_layers[i];
|
||||
LeaveCriticalSection(&dxgi_cs);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
LeaveCriticalSection(&dxgi_cs);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static HRESULT register_d3d10core_layers(HMODULE d3d10core)
|
||||
{
|
||||
EnterCriticalSection(&dxgi_cs);
|
||||
|
||||
if (!dxgi_main.d3d10core)
|
||||
{
|
||||
HRESULT hr;
|
||||
HRESULT (WINAPI *d3d10core_register_layers)(void);
|
||||
HMODULE mod;
|
||||
BOOL ret;
|
||||
|
||||
if (!(ret = GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, (const char *)d3d10core, &mod)))
|
||||
{
|
||||
LeaveCriticalSection(&dxgi_cs);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
d3d10core_register_layers = (void *)GetProcAddress(mod, "D3D10CoreRegisterLayers");
|
||||
hr = d3d10core_register_layers();
|
||||
if (FAILED(hr))
|
||||
{
|
||||
ERR("Failed to register d3d10core layers, returning %#x\n", hr);
|
||||
LeaveCriticalSection(&dxgi_cs);
|
||||
return hr;
|
||||
}
|
||||
|
||||
dxgi_main.d3d10core = mod;
|
||||
}
|
||||
|
||||
LeaveCriticalSection(&dxgi_cs);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI DXGID3D10CreateDevice(HMODULE d3d10core, IDXGIFactory *factory, IDXGIAdapter *adapter,
|
||||
UINT flags, void *unknown0, void **device)
|
||||
{
|
||||
struct layer_get_size_args get_size_args;
|
||||
struct dxgi_device *dxgi_device;
|
||||
struct dxgi_device_layer d3d10_layer;
|
||||
UINT device_size;
|
||||
DWORD count;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("d3d10core %p, factory %p, adapter %p, flags %#x, unknown0 %p, device %p.\n",
|
||||
d3d10core, factory, adapter, flags, unknown0, device);
|
||||
|
||||
hr = register_d3d10core_layers(d3d10core);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
ERR("Failed to register d3d10core layers, returning %#x\n", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
if (!get_layer(DXGI_DEVICE_LAYER_D3D10_DEVICE, &d3d10_layer))
|
||||
{
|
||||
ERR("Failed to get D3D10 device layer\n");
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
count = 0;
|
||||
hr = d3d10_layer.init(d3d10_layer.id, &count, NULL);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize D3D10 device layer\n");
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
get_size_args.unknown0 = 0;
|
||||
get_size_args.unknown1 = 0;
|
||||
get_size_args.unknown2 = NULL;
|
||||
get_size_args.unknown3 = NULL;
|
||||
get_size_args.adapter = adapter;
|
||||
get_size_args.interface_major = 10;
|
||||
get_size_args.interface_minor = 1;
|
||||
get_size_args.version_build = 4;
|
||||
get_size_args.version_revision = 6000;
|
||||
|
||||
device_size = d3d10_layer.get_size(d3d10_layer.id, &get_size_args, 0);
|
||||
device_size += sizeof(*dxgi_device);
|
||||
|
||||
dxgi_device = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, device_size);
|
||||
if (!dxgi_device)
|
||||
{
|
||||
ERR("Failed to allocate device memory\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
hr = dxgi_device_init(dxgi_device, &d3d10_layer, factory, adapter);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize device, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, dxgi_device);
|
||||
*device = NULL;
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created device %p.\n", dxgi_device);
|
||||
*device = dxgi_device;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI DXGID3D10RegisterLayers(const struct dxgi_device_layer *layers, UINT layer_count)
|
||||
{
|
||||
UINT i;
|
||||
struct dxgi_device_layer *new_layers;
|
||||
|
||||
TRACE("layers %p, layer_count %u\n", layers, layer_count);
|
||||
|
||||
EnterCriticalSection(&dxgi_cs);
|
||||
|
||||
if (!dxgi_main.layer_count)
|
||||
new_layers = HeapAlloc(GetProcessHeap(), 0, layer_count * sizeof(*new_layers));
|
||||
else
|
||||
new_layers = HeapReAlloc(GetProcessHeap(), 0, dxgi_main.device_layers,
|
||||
(dxgi_main.layer_count + layer_count) * sizeof(*new_layers));
|
||||
|
||||
if (!new_layers)
|
||||
{
|
||||
LeaveCriticalSection(&dxgi_cs);
|
||||
ERR("Failed to allocate layer memory\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
for (i = 0; i < layer_count; ++i)
|
||||
{
|
||||
const struct dxgi_device_layer *layer = &layers[i];
|
||||
|
||||
TRACE("layer %d: id %#x, init %p, get_size %p, create %p\n",
|
||||
i, layer->id, layer->init, layer->get_size, layer->create);
|
||||
|
||||
new_layers[dxgi_main.layer_count + i] = *layer;
|
||||
}
|
||||
|
||||
dxgi_main.device_layers = new_layers;
|
||||
dxgi_main.layer_count += layer_count;
|
||||
|
||||
LeaveCriticalSection(&dxgi_cs);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -1,176 +0,0 @@
|
||||
/*
|
||||
* Copyright 2008 Henri Verbeet for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef __WINE_DXGI_PRIVATE_H
|
||||
#define __WINE_DXGI_PRIVATE_H
|
||||
|
||||
#include <wine/config.h>
|
||||
#include <wine/port.h>
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#define WIN32_NO_STATUS
|
||||
#define _INC_WINDOWS
|
||||
#define COM_NO_WINDOWS_H
|
||||
|
||||
#define COBJMACROS
|
||||
|
||||
#include <windef.h>
|
||||
#include <winbase.h>
|
||||
#include <wingdi.h>
|
||||
#include <winuser.h>
|
||||
#include <objbase.h>
|
||||
#include <winnls.h>
|
||||
|
||||
#include <wine/debug.h>
|
||||
#include <wine/wined3d.h>
|
||||
#include <wine/winedxgi.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(dxgi);
|
||||
|
||||
extern CRITICAL_SECTION dxgi_cs DECLSPEC_HIDDEN;
|
||||
|
||||
/* Layered device */
|
||||
enum dxgi_device_layer_id
|
||||
{
|
||||
DXGI_DEVICE_LAYER_DEBUG1 = 0x8,
|
||||
DXGI_DEVICE_LAYER_THREAD_SAFE = 0x10,
|
||||
DXGI_DEVICE_LAYER_DEBUG2 = 0x20,
|
||||
DXGI_DEVICE_LAYER_SWITCH_TO_REF = 0x30,
|
||||
DXGI_DEVICE_LAYER_D3D10_DEVICE = 0xffffffff,
|
||||
};
|
||||
|
||||
struct layer_get_size_args
|
||||
{
|
||||
DWORD unknown0;
|
||||
DWORD unknown1;
|
||||
DWORD *unknown2;
|
||||
DWORD *unknown3;
|
||||
IDXGIAdapter *adapter;
|
||||
WORD interface_major;
|
||||
WORD interface_minor;
|
||||
WORD version_build;
|
||||
WORD version_revision;
|
||||
};
|
||||
|
||||
struct dxgi_device_layer
|
||||
{
|
||||
enum dxgi_device_layer_id id;
|
||||
HRESULT (WINAPI *init)(enum dxgi_device_layer_id id, DWORD *count, DWORD *values);
|
||||
UINT (WINAPI *get_size)(enum dxgi_device_layer_id id, struct layer_get_size_args *args, DWORD unknown0);
|
||||
HRESULT (WINAPI *create)(enum dxgi_device_layer_id id, void **layer_base, DWORD unknown0,
|
||||
void *device_object, REFIID riid, void **device_layer);
|
||||
};
|
||||
|
||||
/* TRACE helper functions */
|
||||
const char *debug_dxgi_format(DXGI_FORMAT format) DECLSPEC_HIDDEN;
|
||||
|
||||
DXGI_FORMAT dxgi_format_from_wined3dformat(enum wined3d_format_id format) DECLSPEC_HIDDEN;
|
||||
enum wined3d_format_id wined3dformat_from_dxgi_format(DXGI_FORMAT format) DECLSPEC_HIDDEN;
|
||||
HRESULT dxgi_get_private_data(struct wined3d_private_store *store,
|
||||
REFGUID guid, UINT *data_size, void *data) DECLSPEC_HIDDEN;
|
||||
HRESULT dxgi_set_private_data(struct wined3d_private_store *store,
|
||||
REFGUID guid, UINT data_size, const void *data) DECLSPEC_HIDDEN;
|
||||
HRESULT dxgi_set_private_data_interface(struct wined3d_private_store *store,
|
||||
REFGUID guid, const IUnknown *object) DECLSPEC_HIDDEN;
|
||||
|
||||
/* IDXGIFactory */
|
||||
struct dxgi_factory
|
||||
{
|
||||
IDXGIFactory1 IDXGIFactory1_iface;
|
||||
LONG refcount;
|
||||
struct wined3d_private_store private_store;
|
||||
struct wined3d *wined3d;
|
||||
UINT adapter_count;
|
||||
IDXGIAdapter1 **adapters;
|
||||
BOOL extended;
|
||||
HWND device_window;
|
||||
};
|
||||
|
||||
HRESULT dxgi_factory_create(REFIID riid, void **factory, BOOL extended) DECLSPEC_HIDDEN;
|
||||
HWND dxgi_factory_get_device_window(struct dxgi_factory *factory) DECLSPEC_HIDDEN;
|
||||
struct dxgi_factory *unsafe_impl_from_IDXGIFactory1(IDXGIFactory1 *iface) DECLSPEC_HIDDEN;
|
||||
|
||||
/* IDXGIDevice */
|
||||
struct dxgi_device
|
||||
{
|
||||
IWineDXGIDevice IWineDXGIDevice_iface;
|
||||
IUnknown *child_layer;
|
||||
LONG refcount;
|
||||
struct wined3d_private_store private_store;
|
||||
struct wined3d_device *wined3d_device;
|
||||
IDXGIFactory1 *factory;
|
||||
};
|
||||
|
||||
HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *layer,
|
||||
IDXGIFactory *factory, IDXGIAdapter *adapter) DECLSPEC_HIDDEN;
|
||||
|
||||
/* IDXGIOutput */
|
||||
struct dxgi_output
|
||||
{
|
||||
IDXGIOutput IDXGIOutput_iface;
|
||||
LONG refcount;
|
||||
struct wined3d_private_store private_store;
|
||||
struct dxgi_adapter *adapter;
|
||||
};
|
||||
|
||||
void dxgi_output_init(struct dxgi_output *output, struct dxgi_adapter *adapter) DECLSPEC_HIDDEN;
|
||||
|
||||
/* IDXGIAdapter */
|
||||
struct dxgi_adapter
|
||||
{
|
||||
IDXGIAdapter1 IDXGIAdapter1_iface;
|
||||
struct dxgi_factory *parent;
|
||||
LONG refcount;
|
||||
struct wined3d_private_store private_store;
|
||||
UINT ordinal;
|
||||
IDXGIOutput *output;
|
||||
};
|
||||
|
||||
HRESULT dxgi_adapter_init(struct dxgi_adapter *adapter, struct dxgi_factory *parent, UINT ordinal) DECLSPEC_HIDDEN;
|
||||
struct dxgi_adapter *unsafe_impl_from_IDXGIAdapter1(IDXGIAdapter1 *iface) DECLSPEC_HIDDEN;
|
||||
|
||||
/* IDXGISwapChain */
|
||||
struct dxgi_swapchain
|
||||
{
|
||||
IDXGISwapChain IDXGISwapChain_iface;
|
||||
LONG refcount;
|
||||
struct wined3d_private_store private_store;
|
||||
struct wined3d_swapchain *wined3d_swapchain;
|
||||
};
|
||||
|
||||
HRESULT dxgi_swapchain_init(struct dxgi_swapchain *swapchain, struct dxgi_device *device,
|
||||
struct wined3d_swapchain_desc *desc) DECLSPEC_HIDDEN;
|
||||
|
||||
/* IDXGISurface */
|
||||
struct dxgi_surface
|
||||
{
|
||||
IDXGISurface IDXGISurface_iface;
|
||||
IUnknown IUnknown_iface;
|
||||
IUnknown *outer_unknown;
|
||||
LONG refcount;
|
||||
struct wined3d_private_store private_store;
|
||||
IDXGIDevice *device;
|
||||
|
||||
DXGI_SURFACE_DESC desc;
|
||||
};
|
||||
|
||||
HRESULT dxgi_surface_init(struct dxgi_surface *surface, IDXGIDevice *device,
|
||||
IUnknown *outer, const DXGI_SURFACE_DESC *desc) DECLSPEC_HIDDEN;
|
||||
|
||||
#endif /* __WINE_DXGI_PRIVATE_H */
|
||||
@@ -1,402 +0,0 @@
|
||||
/*
|
||||
* Copyright 2008 Henri Verbeet for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*
|
||||
*/
|
||||
|
||||
#include "dxgi_private.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
static inline struct dxgi_factory *impl_from_IDXGIFactory1(IDXGIFactory1 *iface)
|
||||
{
|
||||
return CONTAINING_RECORD(iface, struct dxgi_factory, IDXGIFactory1_iface);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_factory_QueryInterface(IDXGIFactory1 *iface, REFIID iid, void **out)
|
||||
{
|
||||
struct dxgi_factory *factory = impl_from_IDXGIFactory1(iface);
|
||||
|
||||
TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out);
|
||||
|
||||
if ((factory->extended && IsEqualGUID(iid, &IID_IDXGIFactory1))
|
||||
|| IsEqualGUID(iid, &IID_IDXGIFactory)
|
||||
|| IsEqualGUID(iid, &IID_IDXGIObject)
|
||||
|| IsEqualGUID(iid, &IID_IUnknown))
|
||||
{
|
||||
IUnknown_AddRef(iface);
|
||||
*out = iface;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid));
|
||||
|
||||
*out = NULL;
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE dxgi_factory_AddRef(IDXGIFactory1 *iface)
|
||||
{
|
||||
struct dxgi_factory *factory = impl_from_IDXGIFactory1(iface);
|
||||
ULONG refcount = InterlockedIncrement(&factory->refcount);
|
||||
|
||||
TRACE("%p increasing refcount to %u.\n", iface, refcount);
|
||||
|
||||
return refcount;
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE dxgi_factory_Release(IDXGIFactory1 *iface)
|
||||
{
|
||||
struct dxgi_factory *factory = impl_from_IDXGIFactory1(iface);
|
||||
ULONG refcount = InterlockedDecrement(&factory->refcount);
|
||||
|
||||
TRACE("%p decreasing refcount to %u.\n", iface, refcount);
|
||||
|
||||
if (!refcount)
|
||||
{
|
||||
UINT i;
|
||||
|
||||
if (factory->device_window)
|
||||
DestroyWindow(factory->device_window);
|
||||
for (i = 0; i < factory->adapter_count; ++i)
|
||||
{
|
||||
IDXGIAdapter1_Release(factory->adapters[i]);
|
||||
}
|
||||
HeapFree(GetProcessHeap(), 0, factory->adapters);
|
||||
|
||||
EnterCriticalSection(&dxgi_cs);
|
||||
wined3d_decref(factory->wined3d);
|
||||
LeaveCriticalSection(&dxgi_cs);
|
||||
wined3d_private_store_cleanup(&factory->private_store);
|
||||
HeapFree(GetProcessHeap(), 0, factory);
|
||||
}
|
||||
|
||||
return refcount;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_factory_SetPrivateData(IDXGIFactory1 *iface,
|
||||
REFGUID guid, UINT data_size, const void *data)
|
||||
{
|
||||
struct dxgi_factory *factory = impl_from_IDXGIFactory1(iface);
|
||||
|
||||
TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
|
||||
|
||||
return dxgi_set_private_data(&factory->private_store, guid, data_size, data);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_factory_SetPrivateDataInterface(IDXGIFactory1 *iface,
|
||||
REFGUID guid, const IUnknown *object)
|
||||
{
|
||||
struct dxgi_factory *factory = impl_from_IDXGIFactory1(iface);
|
||||
|
||||
TRACE("iface %p, guid %s, object %p.\n", iface, debugstr_guid(guid), object);
|
||||
|
||||
return dxgi_set_private_data_interface(&factory->private_store, guid, object);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_factory_GetPrivateData(IDXGIFactory1 *iface,
|
||||
REFGUID guid, UINT *data_size, void *data)
|
||||
{
|
||||
struct dxgi_factory *factory = impl_from_IDXGIFactory1(iface);
|
||||
|
||||
TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
|
||||
|
||||
return dxgi_get_private_data(&factory->private_store, guid, data_size, data);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_factory_GetParent(IDXGIFactory1 *iface, REFIID iid, void **parent)
|
||||
{
|
||||
WARN("iface %p, iid %s, parent %p.\n", iface, debugstr_guid(iid), parent);
|
||||
|
||||
*parent = NULL;
|
||||
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_factory_EnumAdapters1(IDXGIFactory1 *iface,
|
||||
UINT adapter_idx, IDXGIAdapter1 **adapter)
|
||||
{
|
||||
struct dxgi_factory *factory = impl_from_IDXGIFactory1(iface);
|
||||
|
||||
TRACE("iface %p, adapter_idx %u, adapter %p.\n", iface, adapter_idx, adapter);
|
||||
|
||||
if (!adapter)
|
||||
return DXGI_ERROR_INVALID_CALL;
|
||||
|
||||
if (adapter_idx >= factory->adapter_count)
|
||||
{
|
||||
*adapter = NULL;
|
||||
return DXGI_ERROR_NOT_FOUND;
|
||||
}
|
||||
|
||||
*adapter = (IDXGIAdapter1 *)factory->adapters[adapter_idx];
|
||||
IDXGIAdapter1_AddRef(*adapter);
|
||||
|
||||
TRACE("Returning adapter %p.\n", *adapter);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_factory_EnumAdapters(IDXGIFactory1 *iface,
|
||||
UINT adapter_idx, IDXGIAdapter **adapter)
|
||||
{
|
||||
TRACE("iface %p, adapter_idx %u, adapter %p.\n", iface, adapter_idx, adapter);
|
||||
|
||||
return dxgi_factory_EnumAdapters1(iface, adapter_idx, (IDXGIAdapter1 **)adapter);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_factory_MakeWindowAssociation(IDXGIFactory1 *iface, HWND window, UINT flags)
|
||||
{
|
||||
FIXME("iface %p, window %p, flags %#x stub!\n", iface, window, flags);
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_factory_GetWindowAssociation(IDXGIFactory1 *iface, HWND *window)
|
||||
{
|
||||
FIXME("iface %p, window %p stub!\n", iface, window);
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static UINT dxgi_rational_to_uint(const DXGI_RATIONAL *rational)
|
||||
{
|
||||
if (rational->Denominator)
|
||||
return rational->Numerator / rational->Denominator;
|
||||
else
|
||||
return rational->Numerator;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSwapChain(IDXGIFactory1 *iface,
|
||||
IUnknown *device, DXGI_SWAP_CHAIN_DESC *desc, IDXGISwapChain **swapchain)
|
||||
{
|
||||
struct wined3d_swapchain *wined3d_swapchain;
|
||||
struct wined3d_swapchain_desc wined3d_desc;
|
||||
IWineDXGIDevice *dxgi_device;
|
||||
HRESULT hr;
|
||||
|
||||
FIXME("iface %p, device %p, desc %p, swapchain %p partial stub!\n", iface, device, desc, swapchain);
|
||||
|
||||
hr = IUnknown_QueryInterface(device, &IID_IWineDXGIDevice, (void **)&dxgi_device);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
ERR("This is not the device we're looking for\n");
|
||||
return hr;
|
||||
}
|
||||
|
||||
if (!desc->OutputWindow)
|
||||
{
|
||||
FIXME("No output window, should use factory output window\n");
|
||||
}
|
||||
|
||||
FIXME("Ignoring SwapEffect and Flags\n");
|
||||
|
||||
wined3d_desc.backbuffer_width = desc->BufferDesc.Width;
|
||||
wined3d_desc.backbuffer_height = desc->BufferDesc.Height;
|
||||
wined3d_desc.backbuffer_format = wined3dformat_from_dxgi_format(desc->BufferDesc.Format);
|
||||
wined3d_desc.backbuffer_count = desc->BufferCount;
|
||||
if (desc->SampleDesc.Count > 1)
|
||||
{
|
||||
wined3d_desc.multisample_type = desc->SampleDesc.Count;
|
||||
wined3d_desc.multisample_quality = desc->SampleDesc.Quality;
|
||||
}
|
||||
else
|
||||
{
|
||||
wined3d_desc.multisample_type = WINED3D_MULTISAMPLE_NONE;
|
||||
wined3d_desc.multisample_quality = 0;
|
||||
}
|
||||
wined3d_desc.swap_effect = WINED3D_SWAP_EFFECT_DISCARD;
|
||||
wined3d_desc.device_window = desc->OutputWindow;
|
||||
wined3d_desc.windowed = desc->Windowed;
|
||||
wined3d_desc.enable_auto_depth_stencil = FALSE;
|
||||
wined3d_desc.auto_depth_stencil_format = 0;
|
||||
wined3d_desc.flags = 0; /* WINED3DPRESENTFLAG_DISCARD_DEPTHSTENCIL? */
|
||||
wined3d_desc.refresh_rate = dxgi_rational_to_uint(&desc->BufferDesc.RefreshRate);
|
||||
wined3d_desc.swap_interval = WINED3DPRESENT_INTERVAL_DEFAULT;
|
||||
wined3d_desc.auto_restore_display_mode = TRUE;
|
||||
|
||||
hr = IWineDXGIDevice_create_swapchain(dxgi_device, &wined3d_desc, &wined3d_swapchain);
|
||||
IWineDXGIDevice_Release(dxgi_device);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to create swapchain, hr %#x.\n", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
*swapchain = wined3d_swapchain_get_parent(wined3d_swapchain);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSoftwareAdapter(IDXGIFactory1 *iface,
|
||||
HMODULE swrast, IDXGIAdapter **adapter)
|
||||
{
|
||||
FIXME("iface %p, swrast %p, adapter %p stub!\n", iface, swrast, adapter);
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static BOOL STDMETHODCALLTYPE dxgi_factory_IsCurrent(IDXGIFactory1 *iface)
|
||||
{
|
||||
FIXME("iface %p stub!\n", iface);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static const struct IDXGIFactory1Vtbl dxgi_factory_vtbl =
|
||||
{
|
||||
dxgi_factory_QueryInterface,
|
||||
dxgi_factory_AddRef,
|
||||
dxgi_factory_Release,
|
||||
dxgi_factory_SetPrivateData,
|
||||
dxgi_factory_SetPrivateDataInterface,
|
||||
dxgi_factory_GetPrivateData,
|
||||
dxgi_factory_GetParent,
|
||||
dxgi_factory_EnumAdapters,
|
||||
dxgi_factory_MakeWindowAssociation,
|
||||
dxgi_factory_GetWindowAssociation,
|
||||
dxgi_factory_CreateSwapChain,
|
||||
dxgi_factory_CreateSoftwareAdapter,
|
||||
dxgi_factory_EnumAdapters1,
|
||||
dxgi_factory_IsCurrent,
|
||||
};
|
||||
|
||||
struct dxgi_factory *unsafe_impl_from_IDXGIFactory1(IDXGIFactory1 *iface)
|
||||
{
|
||||
if (!iface)
|
||||
return NULL;
|
||||
assert(iface->lpVtbl == &dxgi_factory_vtbl);
|
||||
return CONTAINING_RECORD(iface, struct dxgi_factory, IDXGIFactory1_iface);
|
||||
}
|
||||
|
||||
static HRESULT dxgi_factory_init(struct dxgi_factory *factory, BOOL extended)
|
||||
{
|
||||
HRESULT hr;
|
||||
UINT i;
|
||||
|
||||
factory->IDXGIFactory1_iface.lpVtbl = &dxgi_factory_vtbl;
|
||||
factory->refcount = 1;
|
||||
wined3d_private_store_init(&factory->private_store);
|
||||
|
||||
EnterCriticalSection(&dxgi_cs);
|
||||
factory->wined3d = wined3d_create(0);
|
||||
if (!factory->wined3d)
|
||||
{
|
||||
LeaveCriticalSection(&dxgi_cs);
|
||||
wined3d_private_store_cleanup(&factory->private_store);
|
||||
return DXGI_ERROR_UNSUPPORTED;
|
||||
}
|
||||
|
||||
factory->adapter_count = wined3d_get_adapter_count(factory->wined3d);
|
||||
LeaveCriticalSection(&dxgi_cs);
|
||||
factory->adapters = HeapAlloc(GetProcessHeap(), 0, factory->adapter_count * sizeof(*factory->adapters));
|
||||
if (!factory->adapters)
|
||||
{
|
||||
ERR("Failed to allocate DXGI adapter array memory.\n");
|
||||
hr = E_OUTOFMEMORY;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
for (i = 0; i < factory->adapter_count; ++i)
|
||||
{
|
||||
struct dxgi_adapter *adapter = HeapAlloc(GetProcessHeap(), 0, sizeof(*adapter));
|
||||
if (!adapter)
|
||||
{
|
||||
UINT j;
|
||||
|
||||
ERR("Failed to allocate DXGI adapter memory.\n");
|
||||
|
||||
for (j = 0; j < i; ++j)
|
||||
{
|
||||
IDXGIAdapter1_Release(factory->adapters[j]);
|
||||
}
|
||||
hr = E_OUTOFMEMORY;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (FAILED(hr = dxgi_adapter_init(adapter, factory, i)))
|
||||
{
|
||||
UINT j;
|
||||
|
||||
ERR("Failed to initialize adapter, hr %#x.\n", hr);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, adapter);
|
||||
for (j = 0; j < i; ++j)
|
||||
{
|
||||
IDXGIAdapter1_Release(factory->adapters[j]);
|
||||
}
|
||||
goto fail;
|
||||
}
|
||||
|
||||
factory->adapters[i] = &adapter->IDXGIAdapter1_iface;
|
||||
}
|
||||
|
||||
factory->extended = extended;
|
||||
|
||||
return S_OK;
|
||||
|
||||
fail:
|
||||
HeapFree(GetProcessHeap(), 0, factory->adapters);
|
||||
EnterCriticalSection(&dxgi_cs);
|
||||
wined3d_decref(factory->wined3d);
|
||||
LeaveCriticalSection(&dxgi_cs);
|
||||
wined3d_private_store_cleanup(&factory->private_store);
|
||||
return hr;
|
||||
}
|
||||
|
||||
HRESULT dxgi_factory_create(REFIID riid, void **factory, BOOL extended)
|
||||
{
|
||||
struct dxgi_factory *object;
|
||||
HRESULT hr;
|
||||
|
||||
if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
if (FAILED(hr = dxgi_factory_init(object, extended)))
|
||||
{
|
||||
WARN("Failed to initialize factory, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created factory %p.\n", object);
|
||||
|
||||
hr = IDXGIFactory1_QueryInterface(&object->IDXGIFactory1_iface, riid, factory);
|
||||
IDXGIFactory1_Release(&object->IDXGIFactory1_iface);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
HWND dxgi_factory_get_device_window(struct dxgi_factory *factory)
|
||||
{
|
||||
EnterCriticalSection(&dxgi_cs);
|
||||
|
||||
if (!factory->device_window)
|
||||
{
|
||||
if (!(factory->device_window = CreateWindowA("static", "DXGI device window",
|
||||
WS_DISABLED, 0, 0, 0, 0, NULL, NULL, NULL, NULL)))
|
||||
{
|
||||
LeaveCriticalSection(&dxgi_cs);
|
||||
ERR("Failed to create a window.\n");
|
||||
return NULL;
|
||||
}
|
||||
TRACE("Created device window %p for factory %p.\n", factory->device_window, factory);
|
||||
}
|
||||
|
||||
LeaveCriticalSection(&dxgi_cs);
|
||||
|
||||
return factory->device_window;
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
/* DO NOT USE THE PRECOMPILED HEADER FOR THIS FILE! */
|
||||
|
||||
#include <wine/config.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#define WIN32_NO_STATUS
|
||||
#define _INC_WINDOWS
|
||||
#define COM_NO_WINDOWS_H
|
||||
#define COBJMACROS
|
||||
|
||||
#include <windef.h>
|
||||
#include <winbase.h>
|
||||
#include <wingdi.h>
|
||||
#include <objbase.h>
|
||||
#include <wine/wined3d.h>
|
||||
#include <initguid.h>
|
||||
#include <wine/winedxgi.h>
|
||||
|
||||
/* NO CODE HERE, THIS IS JUST REQUIRED FOR THE GUID DEFINITIONS */
|
||||
@@ -1,321 +0,0 @@
|
||||
/*
|
||||
* Copyright 2009 Henri Verbeet for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "dxgi_private.h"
|
||||
|
||||
static inline struct dxgi_output *impl_from_IDXGIOutput(IDXGIOutput *iface)
|
||||
{
|
||||
return CONTAINING_RECORD(iface, struct dxgi_output, IDXGIOutput_iface);
|
||||
}
|
||||
|
||||
/* IUnknown methods */
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_output_QueryInterface(IDXGIOutput *iface, REFIID riid, void **object)
|
||||
{
|
||||
TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
|
||||
|
||||
if (IsEqualGUID(riid, &IID_IDXGIOutput)
|
||||
|| IsEqualGUID(riid, &IID_IDXGIObject)
|
||||
|| IsEqualGUID(riid, &IID_IUnknown))
|
||||
{
|
||||
IUnknown_AddRef(iface);
|
||||
*object = iface;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
|
||||
|
||||
*object = NULL;
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE dxgi_output_AddRef(IDXGIOutput *iface)
|
||||
{
|
||||
struct dxgi_output *This = impl_from_IDXGIOutput(iface);
|
||||
ULONG refcount = InterlockedIncrement(&This->refcount);
|
||||
|
||||
TRACE("%p increasing refcount to %u.\n", This, refcount);
|
||||
|
||||
return refcount;
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE dxgi_output_Release(IDXGIOutput *iface)
|
||||
{
|
||||
struct dxgi_output *This = impl_from_IDXGIOutput(iface);
|
||||
ULONG refcount = InterlockedDecrement(&This->refcount);
|
||||
|
||||
TRACE("%p decreasing refcount to %u.\n", This, refcount);
|
||||
|
||||
if (!refcount)
|
||||
{
|
||||
wined3d_private_store_cleanup(&This->private_store);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
}
|
||||
|
||||
return refcount;
|
||||
}
|
||||
|
||||
/* IDXGIObject methods */
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_output_SetPrivateData(IDXGIOutput *iface,
|
||||
REFGUID guid, UINT data_size, const void *data)
|
||||
{
|
||||
struct dxgi_output *output = impl_from_IDXGIOutput(iface);
|
||||
|
||||
TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
|
||||
|
||||
return dxgi_set_private_data(&output->private_store, guid, data_size, data);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_output_SetPrivateDataInterface(IDXGIOutput *iface,
|
||||
REFGUID guid, const IUnknown *object)
|
||||
{
|
||||
struct dxgi_output *output = impl_from_IDXGIOutput(iface);
|
||||
|
||||
TRACE("iface %p, guid %s, object %p.\n", iface, debugstr_guid(guid), object);
|
||||
|
||||
return dxgi_set_private_data_interface(&output->private_store, guid, object);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_output_GetPrivateData(IDXGIOutput *iface,
|
||||
REFGUID guid, UINT *data_size, void *data)
|
||||
{
|
||||
struct dxgi_output *output = impl_from_IDXGIOutput(iface);
|
||||
|
||||
TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
|
||||
|
||||
return dxgi_get_private_data(&output->private_store, guid, data_size, data);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_output_GetParent(IDXGIOutput *iface,
|
||||
REFIID riid, void **parent)
|
||||
{
|
||||
struct dxgi_output *This = impl_from_IDXGIOutput(iface);
|
||||
|
||||
TRACE("iface %p, riid %s, parent %p.\n", iface, debugstr_guid(riid), parent);
|
||||
|
||||
return IDXGIAdapter_QueryInterface((IDXGIAdapter *)This->adapter, riid, parent);
|
||||
}
|
||||
|
||||
/* IDXGIOutput methods */
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_output_GetDesc(IDXGIOutput *iface, DXGI_OUTPUT_DESC *desc)
|
||||
{
|
||||
struct dxgi_output *This = impl_from_IDXGIOutput(iface);
|
||||
struct wined3d *wined3d;
|
||||
MONITORINFOEXW monitor_info;
|
||||
|
||||
FIXME("iface %p, desc %p semi-stub!\n", iface, desc);
|
||||
|
||||
if (!desc)
|
||||
return DXGI_ERROR_INVALID_CALL;
|
||||
|
||||
wined3d = This->adapter->parent->wined3d;
|
||||
|
||||
EnterCriticalSection(&dxgi_cs);
|
||||
desc->Monitor = wined3d_get_adapter_monitor(wined3d, This->adapter->ordinal);
|
||||
LeaveCriticalSection(&dxgi_cs);
|
||||
|
||||
if (!desc->Monitor)
|
||||
return DXGI_ERROR_INVALID_CALL;
|
||||
|
||||
monitor_info.cbSize = sizeof(monitor_info);
|
||||
if (!GetMonitorInfoW(desc->Monitor, (MONITORINFO *)&monitor_info))
|
||||
return DXGI_ERROR_INVALID_CALL;
|
||||
|
||||
memcpy(&desc->DeviceName, &monitor_info.szDevice, sizeof(desc->DeviceName));
|
||||
memcpy(&desc->DesktopCoordinates, &monitor_info.rcMonitor, sizeof(RECT));
|
||||
desc->AttachedToDesktop = TRUE;
|
||||
desc->Rotation = DXGI_MODE_ROTATION_IDENTITY;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_output_GetDisplayModeList(IDXGIOutput *iface,
|
||||
DXGI_FORMAT format, UINT flags, UINT *mode_count, DXGI_MODE_DESC *desc)
|
||||
{
|
||||
struct dxgi_output *This = impl_from_IDXGIOutput(iface);
|
||||
enum wined3d_format_id wined3d_format;
|
||||
struct wined3d *wined3d;
|
||||
UINT i;
|
||||
UINT max_count;
|
||||
|
||||
FIXME("iface %p, format %s, flags %#x, mode_count %p, desc %p partial stub!\n",
|
||||
iface, debug_dxgi_format(format), flags, mode_count, desc);
|
||||
|
||||
if (!mode_count)
|
||||
return DXGI_ERROR_INVALID_CALL;
|
||||
|
||||
if (format == DXGI_FORMAT_UNKNOWN)
|
||||
{
|
||||
*mode_count = 0;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
wined3d = This->adapter->parent->wined3d;
|
||||
wined3d_format = wined3dformat_from_dxgi_format(format);
|
||||
|
||||
EnterCriticalSection(&dxgi_cs);
|
||||
max_count = wined3d_get_adapter_mode_count(wined3d, This->adapter->ordinal,
|
||||
wined3d_format, WINED3D_SCANLINE_ORDERING_UNKNOWN);
|
||||
|
||||
if (!desc)
|
||||
{
|
||||
LeaveCriticalSection(&dxgi_cs);
|
||||
*mode_count = max_count;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
if (max_count > *mode_count)
|
||||
{
|
||||
LeaveCriticalSection(&dxgi_cs);
|
||||
return DXGI_ERROR_MORE_DATA;
|
||||
}
|
||||
|
||||
*mode_count = max_count;
|
||||
|
||||
for (i = 0; i < *mode_count; ++i)
|
||||
{
|
||||
struct wined3d_display_mode mode;
|
||||
HRESULT hr;
|
||||
|
||||
hr = wined3d_enum_adapter_modes(wined3d, This->adapter->ordinal, wined3d_format,
|
||||
WINED3D_SCANLINE_ORDERING_UNKNOWN, i, &mode);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("EnumAdapterModes failed, hr %#x.\n", hr);
|
||||
LeaveCriticalSection(&dxgi_cs);
|
||||
return hr;
|
||||
}
|
||||
|
||||
desc[i].Width = mode.width;
|
||||
desc[i].Height = mode.height;
|
||||
desc[i].RefreshRate.Numerator = mode.refresh_rate;
|
||||
desc[i].RefreshRate.Denominator = 1;
|
||||
desc[i].Format = format;
|
||||
desc[i].ScanlineOrdering = mode.scanline_ordering;
|
||||
desc[i].Scaling = DXGI_MODE_SCALING_UNSPECIFIED; /* FIXME */
|
||||
}
|
||||
LeaveCriticalSection(&dxgi_cs);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_output_FindClosestMatchingMode(IDXGIOutput *iface,
|
||||
const DXGI_MODE_DESC *mode, DXGI_MODE_DESC *closest_match, IUnknown *device)
|
||||
{
|
||||
FIXME("iface %p, mode %p, closest_match %p, device %p stub!\n", iface, mode, closest_match, device);
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_output_WaitForVBlank(IDXGIOutput *iface)
|
||||
{
|
||||
FIXME("iface %p stub!\n", iface);
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_output_TakeOwnership(IDXGIOutput *iface, IUnknown *device, BOOL exclusive)
|
||||
{
|
||||
FIXME("iface %p, device %p, exclusive %d stub!\n", iface, device, exclusive);
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static void STDMETHODCALLTYPE dxgi_output_ReleaseOwnership(IDXGIOutput *iface)
|
||||
{
|
||||
FIXME("iface %p stub!\n", iface);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_output_GetGammaControlCapabilities(IDXGIOutput *iface,
|
||||
DXGI_GAMMA_CONTROL_CAPABILITIES *gamma_caps)
|
||||
{
|
||||
FIXME("iface %p, gamma_caps %p stub!\n", iface, gamma_caps);
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_output_SetGammaControl(IDXGIOutput *iface,
|
||||
const DXGI_GAMMA_CONTROL *gamma_control)
|
||||
{
|
||||
FIXME("iface %p, gamma_control %p stub!\n", iface, gamma_control);
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_output_GetGammaControl(IDXGIOutput *iface, DXGI_GAMMA_CONTROL *gamma_control)
|
||||
{
|
||||
FIXME("iface %p, gamma_control %p stub!\n", iface, gamma_control);
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_output_SetDisplaySurface(IDXGIOutput *iface, IDXGISurface *surface)
|
||||
{
|
||||
FIXME("iface %p, surface %p stub!\n", iface, surface);
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_output_GetDisplaySurfaceData(IDXGIOutput *iface, IDXGISurface *surface)
|
||||
{
|
||||
FIXME("iface %p, surface %p stub!\n", iface, surface);
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_output_GetFrameStatistics(IDXGIOutput *iface, DXGI_FRAME_STATISTICS *stats)
|
||||
{
|
||||
FIXME("iface %p, stats %p stub!\n", iface, stats);
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static const struct IDXGIOutputVtbl dxgi_output_vtbl =
|
||||
{
|
||||
dxgi_output_QueryInterface,
|
||||
dxgi_output_AddRef,
|
||||
dxgi_output_Release,
|
||||
/* IDXGIObject methods */
|
||||
dxgi_output_SetPrivateData,
|
||||
dxgi_output_SetPrivateDataInterface,
|
||||
dxgi_output_GetPrivateData,
|
||||
dxgi_output_GetParent,
|
||||
/* IDXGIOutput methods */
|
||||
dxgi_output_GetDesc,
|
||||
dxgi_output_GetDisplayModeList,
|
||||
dxgi_output_FindClosestMatchingMode,
|
||||
dxgi_output_WaitForVBlank,
|
||||
dxgi_output_TakeOwnership,
|
||||
dxgi_output_ReleaseOwnership,
|
||||
dxgi_output_GetGammaControlCapabilities,
|
||||
dxgi_output_SetGammaControl,
|
||||
dxgi_output_GetGammaControl,
|
||||
dxgi_output_SetDisplaySurface,
|
||||
dxgi_output_GetDisplaySurfaceData,
|
||||
dxgi_output_GetFrameStatistics,
|
||||
};
|
||||
|
||||
void dxgi_output_init(struct dxgi_output *output, struct dxgi_adapter *adapter)
|
||||
{
|
||||
output->IDXGIOutput_iface.lpVtbl = &dxgi_output_vtbl;
|
||||
output->refcount = 1;
|
||||
wined3d_private_store_init(&output->private_store);
|
||||
output->adapter = adapter;
|
||||
}
|
||||
@@ -1,223 +0,0 @@
|
||||
/*
|
||||
* Copyright 2009 Henri Verbeet for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*
|
||||
*/
|
||||
|
||||
#include "dxgi_private.h"
|
||||
|
||||
/* Inner IUnknown methods */
|
||||
|
||||
static inline struct dxgi_surface *impl_from_IUnknown(IUnknown *iface)
|
||||
{
|
||||
return CONTAINING_RECORD(iface, struct dxgi_surface, IUnknown_iface);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_surface_inner_QueryInterface(IUnknown *iface, REFIID riid, void **out)
|
||||
{
|
||||
struct dxgi_surface *surface = impl_from_IUnknown(iface);
|
||||
|
||||
TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
|
||||
|
||||
if (IsEqualGUID(riid, &IID_IDXGISurface)
|
||||
|| IsEqualGUID(riid, &IID_IDXGIDeviceSubObject)
|
||||
|| IsEqualGUID(riid, &IID_IDXGIObject)
|
||||
|| IsEqualGUID(riid, &IID_IUnknown))
|
||||
{
|
||||
IDXGISurface_AddRef(&surface->IDXGISurface_iface);
|
||||
*out = &surface->IDXGISurface_iface;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
|
||||
|
||||
*out = NULL;
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE dxgi_surface_inner_AddRef(IUnknown *iface)
|
||||
{
|
||||
struct dxgi_surface *surface = impl_from_IUnknown(iface);
|
||||
ULONG refcount = InterlockedIncrement(&surface->refcount);
|
||||
|
||||
TRACE("%p increasing refcount to %u.\n", surface, refcount);
|
||||
|
||||
return refcount;
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE dxgi_surface_inner_Release(IUnknown *iface)
|
||||
{
|
||||
struct dxgi_surface *surface = impl_from_IUnknown(iface);
|
||||
ULONG refcount = InterlockedDecrement(&surface->refcount);
|
||||
|
||||
TRACE("%p decreasing refcount to %u.\n", surface, refcount);
|
||||
|
||||
if (!refcount)
|
||||
{
|
||||
wined3d_private_store_cleanup(&surface->private_store);
|
||||
HeapFree(GetProcessHeap(), 0, surface);
|
||||
}
|
||||
|
||||
return refcount;
|
||||
}
|
||||
|
||||
static inline struct dxgi_surface *impl_from_IDXGISurface(IDXGISurface *iface)
|
||||
{
|
||||
return CONTAINING_RECORD(iface, struct dxgi_surface, IDXGISurface_iface);
|
||||
}
|
||||
|
||||
/* IUnknown methods */
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_surface_QueryInterface(IDXGISurface *iface, REFIID riid,
|
||||
void **object)
|
||||
{
|
||||
struct dxgi_surface *This = impl_from_IDXGISurface(iface);
|
||||
TRACE("Forwarding to outer IUnknown\n");
|
||||
return IUnknown_QueryInterface(This->outer_unknown, riid, object);
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE dxgi_surface_AddRef(IDXGISurface *iface)
|
||||
{
|
||||
struct dxgi_surface *This = impl_from_IDXGISurface(iface);
|
||||
TRACE("Forwarding to outer IUnknown\n");
|
||||
return IUnknown_AddRef(This->outer_unknown);
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE dxgi_surface_Release(IDXGISurface *iface)
|
||||
{
|
||||
struct dxgi_surface *This = impl_from_IDXGISurface(iface);
|
||||
TRACE("Forwarding to outer IUnknown\n");
|
||||
return IUnknown_Release(This->outer_unknown);
|
||||
}
|
||||
|
||||
/* IDXGIObject methods */
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_surface_SetPrivateData(IDXGISurface *iface,
|
||||
REFGUID guid, UINT data_size, const void *data)
|
||||
{
|
||||
struct dxgi_surface *surface = impl_from_IDXGISurface(iface);
|
||||
|
||||
TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
|
||||
|
||||
return dxgi_set_private_data(&surface->private_store, guid, data_size, data);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_surface_SetPrivateDataInterface(IDXGISurface *iface,
|
||||
REFGUID guid, const IUnknown *object)
|
||||
{
|
||||
struct dxgi_surface *surface = impl_from_IDXGISurface(iface);
|
||||
|
||||
TRACE("iface %p, guid %s, object %p.\n", iface, debugstr_guid(guid), object);
|
||||
|
||||
return dxgi_set_private_data_interface(&surface->private_store, guid, object);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_surface_GetPrivateData(IDXGISurface *iface,
|
||||
REFGUID guid, UINT *data_size, void *data)
|
||||
{
|
||||
struct dxgi_surface *surface = impl_from_IDXGISurface(iface);
|
||||
|
||||
TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
|
||||
|
||||
return dxgi_get_private_data(&surface->private_store, guid, data_size, data);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_surface_GetParent(IDXGISurface *iface, REFIID riid, void **parent)
|
||||
{
|
||||
struct dxgi_surface *This = impl_from_IDXGISurface(iface);
|
||||
|
||||
TRACE("iface %p, riid %s, parent %p.\n", iface, debugstr_guid(riid), parent);
|
||||
|
||||
return IDXGIDevice_QueryInterface(This->device, riid, parent);
|
||||
}
|
||||
|
||||
/* IDXGIDeviceSubObject methods */
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_surface_GetDevice(IDXGISurface *iface, REFIID riid, void **device)
|
||||
{
|
||||
struct dxgi_surface *This = impl_from_IDXGISurface(iface);
|
||||
|
||||
TRACE("iface %p, riid %s, device %p.\n", iface, debugstr_guid(riid), device);
|
||||
|
||||
return IDXGIDevice_QueryInterface(This->device, riid, device);
|
||||
}
|
||||
|
||||
/* IDXGISurface methods */
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_surface_GetDesc(IDXGISurface *iface, DXGI_SURFACE_DESC *desc)
|
||||
{
|
||||
struct dxgi_surface *surface = impl_from_IDXGISurface(iface);
|
||||
|
||||
TRACE("iface %p, desc %p.\n", iface, desc);
|
||||
|
||||
*desc = surface->desc;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_surface_Map(IDXGISurface *iface, DXGI_MAPPED_RECT *mapped_rect, UINT flags)
|
||||
{
|
||||
FIXME("iface %p, mapped_rect %p, flags %#x stub!\n", iface, mapped_rect, flags);
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_surface_Unmap(IDXGISurface *iface)
|
||||
{
|
||||
FIXME("iface %p stub!\n", iface);
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static const struct IDXGISurfaceVtbl dxgi_surface_vtbl =
|
||||
{
|
||||
/* IUnknown methods */
|
||||
dxgi_surface_QueryInterface,
|
||||
dxgi_surface_AddRef,
|
||||
dxgi_surface_Release,
|
||||
/* IDXGIObject methods */
|
||||
dxgi_surface_SetPrivateData,
|
||||
dxgi_surface_SetPrivateDataInterface,
|
||||
dxgi_surface_GetPrivateData,
|
||||
dxgi_surface_GetParent,
|
||||
/* IDXGIDeviceSubObject methods */
|
||||
dxgi_surface_GetDevice,
|
||||
/* IDXGISurface methods */
|
||||
dxgi_surface_GetDesc,
|
||||
dxgi_surface_Map,
|
||||
dxgi_surface_Unmap,
|
||||
};
|
||||
|
||||
static const struct IUnknownVtbl dxgi_surface_inner_unknown_vtbl =
|
||||
{
|
||||
/* IUnknown methods */
|
||||
dxgi_surface_inner_QueryInterface,
|
||||
dxgi_surface_inner_AddRef,
|
||||
dxgi_surface_inner_Release,
|
||||
};
|
||||
|
||||
HRESULT dxgi_surface_init(struct dxgi_surface *surface, IDXGIDevice *device,
|
||||
IUnknown *outer, const DXGI_SURFACE_DESC *desc)
|
||||
{
|
||||
surface->IDXGISurface_iface.lpVtbl = &dxgi_surface_vtbl;
|
||||
surface->IUnknown_iface.lpVtbl = &dxgi_surface_inner_unknown_vtbl;
|
||||
surface->refcount = 1;
|
||||
wined3d_private_store_init(&surface->private_store);
|
||||
surface->outer_unknown = outer ? outer : &surface->IUnknown_iface;
|
||||
surface->device = device;
|
||||
surface->desc = *desc;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -1,309 +0,0 @@
|
||||
/*
|
||||
* Copyright 2008 Henri Verbeet for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*
|
||||
*/
|
||||
|
||||
#include "dxgi_private.h"
|
||||
|
||||
static inline struct dxgi_swapchain *impl_from_IDXGISwapChain(IDXGISwapChain *iface)
|
||||
{
|
||||
return CONTAINING_RECORD(iface, struct dxgi_swapchain, IDXGISwapChain_iface);
|
||||
}
|
||||
|
||||
/* IUnknown methods */
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_QueryInterface(IDXGISwapChain *iface, REFIID riid, void **object)
|
||||
{
|
||||
TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object);
|
||||
|
||||
if (IsEqualGUID(riid, &IID_IUnknown)
|
||||
|| IsEqualGUID(riid, &IID_IDXGIObject)
|
||||
|| IsEqualGUID(riid, &IID_IDXGIDeviceSubObject)
|
||||
|| IsEqualGUID(riid, &IID_IDXGISwapChain))
|
||||
{
|
||||
IUnknown_AddRef(iface);
|
||||
*object = iface;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
|
||||
|
||||
*object = NULL;
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE dxgi_swapchain_AddRef(IDXGISwapChain *iface)
|
||||
{
|
||||
struct dxgi_swapchain *This = impl_from_IDXGISwapChain(iface);
|
||||
ULONG refcount = InterlockedIncrement(&This->refcount);
|
||||
|
||||
TRACE("%p increasing refcount to %u\n", This, refcount);
|
||||
|
||||
if (refcount == 1)
|
||||
wined3d_swapchain_incref(This->wined3d_swapchain);
|
||||
|
||||
return refcount;
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE dxgi_swapchain_Release(IDXGISwapChain *iface)
|
||||
{
|
||||
struct dxgi_swapchain *This = impl_from_IDXGISwapChain(iface);
|
||||
ULONG refcount = InterlockedDecrement(&This->refcount);
|
||||
|
||||
TRACE("%p decreasing refcount to %u\n", This, refcount);
|
||||
|
||||
if (!refcount)
|
||||
wined3d_swapchain_decref(This->wined3d_swapchain);
|
||||
|
||||
return refcount;
|
||||
}
|
||||
|
||||
/* IDXGIObject methods */
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_SetPrivateData(IDXGISwapChain *iface,
|
||||
REFGUID guid, UINT data_size, const void *data)
|
||||
{
|
||||
struct dxgi_swapchain *swapchain = impl_from_IDXGISwapChain(iface);
|
||||
|
||||
TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
|
||||
|
||||
return dxgi_set_private_data(&swapchain->private_store, guid, data_size, data);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_SetPrivateDataInterface(IDXGISwapChain *iface,
|
||||
REFGUID guid, const IUnknown *object)
|
||||
{
|
||||
struct dxgi_swapchain *swapchain = impl_from_IDXGISwapChain(iface);
|
||||
|
||||
TRACE("iface %p, guid %s, object %p.\n", iface, debugstr_guid(guid), object);
|
||||
|
||||
return dxgi_set_private_data_interface(&swapchain->private_store, guid, object);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetPrivateData(IDXGISwapChain *iface,
|
||||
REFGUID guid, UINT *data_size, void *data)
|
||||
{
|
||||
struct dxgi_swapchain *swapchain = impl_from_IDXGISwapChain(iface);
|
||||
|
||||
TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
|
||||
|
||||
return dxgi_get_private_data(&swapchain->private_store, guid, data_size, data);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetParent(IDXGISwapChain *iface, REFIID riid, void **parent)
|
||||
{
|
||||
FIXME("iface %p, riid %s, parent %p stub!\n", iface, debugstr_guid(riid), parent);
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
/* IDXGIDeviceSubObject methods */
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetDevice(IDXGISwapChain *iface, REFIID riid, void **device)
|
||||
{
|
||||
FIXME("iface %p, riid %s, device %p stub!\n", iface, debugstr_guid(riid), device);
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
/* IDXGISwapChain methods */
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_Present(IDXGISwapChain *iface, UINT sync_interval, UINT flags)
|
||||
{
|
||||
struct dxgi_swapchain *This = impl_from_IDXGISwapChain(iface);
|
||||
|
||||
TRACE("iface %p, sync_interval %u, flags %#x\n", iface, sync_interval, flags);
|
||||
|
||||
if (sync_interval) FIXME("Unimplemented sync interval %u\n", sync_interval);
|
||||
if (flags) FIXME("Unimplemented flags %#x\n", flags);
|
||||
|
||||
return wined3d_swapchain_present(This->wined3d_swapchain, NULL, NULL, NULL, NULL, 0);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetBuffer(IDXGISwapChain *iface,
|
||||
UINT buffer_idx, REFIID riid, void **surface)
|
||||
{
|
||||
struct dxgi_swapchain *This = impl_from_IDXGISwapChain(iface);
|
||||
struct wined3d_surface *backbuffer;
|
||||
IUnknown *parent;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, buffer_idx %u, riid %s, surface %p\n",
|
||||
iface, buffer_idx, debugstr_guid(riid), surface);
|
||||
|
||||
EnterCriticalSection(&dxgi_cs);
|
||||
|
||||
if (!(backbuffer = wined3d_swapchain_get_back_buffer(This->wined3d_swapchain,
|
||||
buffer_idx, WINED3D_BACKBUFFER_TYPE_MONO)))
|
||||
{
|
||||
LeaveCriticalSection(&dxgi_cs);
|
||||
return DXGI_ERROR_INVALID_CALL;
|
||||
}
|
||||
|
||||
parent = wined3d_surface_get_parent(backbuffer);
|
||||
hr = IUnknown_QueryInterface(parent, riid, surface);
|
||||
LeaveCriticalSection(&dxgi_cs);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_SetFullscreenState(IDXGISwapChain *iface,
|
||||
BOOL fullscreen, IDXGIOutput *target)
|
||||
{
|
||||
FIXME("iface %p, fullscreen %u, target %p stub!\n", iface, fullscreen, target);
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetFullscreenState(IDXGISwapChain *iface,
|
||||
BOOL *fullscreen, IDXGIOutput **target)
|
||||
{
|
||||
FIXME("iface %p, fullscreen %p, target %p stub!\n", iface, fullscreen, target);
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetDesc(IDXGISwapChain *iface, DXGI_SWAP_CHAIN_DESC *desc)
|
||||
{
|
||||
struct dxgi_swapchain *swapchain = impl_from_IDXGISwapChain(iface);
|
||||
struct wined3d_swapchain_desc wined3d_desc;
|
||||
|
||||
FIXME("iface %p, desc %p partial stub!\n", iface, desc);
|
||||
|
||||
if (desc == NULL)
|
||||
return E_INVALIDARG;
|
||||
|
||||
EnterCriticalSection(&dxgi_cs);
|
||||
wined3d_swapchain_get_desc(swapchain->wined3d_swapchain, &wined3d_desc);
|
||||
LeaveCriticalSection(&dxgi_cs);
|
||||
|
||||
FIXME("Ignoring ScanlineOrdering, Scaling, SwapEffect and Flags\n");
|
||||
|
||||
desc->BufferDesc.Width = wined3d_desc.backbuffer_width;
|
||||
desc->BufferDesc.Height = wined3d_desc.backbuffer_height;
|
||||
desc->BufferDesc.RefreshRate.Numerator = wined3d_desc.refresh_rate;
|
||||
desc->BufferDesc.RefreshRate.Denominator = 1;
|
||||
desc->BufferDesc.Format = dxgi_format_from_wined3dformat(wined3d_desc.backbuffer_format);
|
||||
desc->BufferDesc.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED;
|
||||
desc->BufferDesc.Scaling = DXGI_MODE_SCALING_UNSPECIFIED;
|
||||
desc->SampleDesc.Count = wined3d_desc.multisample_type;
|
||||
desc->SampleDesc.Quality = wined3d_desc.multisample_quality;
|
||||
desc->BufferCount = wined3d_desc.backbuffer_count;
|
||||
desc->OutputWindow = wined3d_desc.device_window;
|
||||
desc->Windowed = wined3d_desc.windowed;
|
||||
desc->SwapEffect = DXGI_SWAP_EFFECT_DISCARD;
|
||||
desc->Flags = 0;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_ResizeBuffers(IDXGISwapChain *iface,
|
||||
UINT buffer_count, UINT width, UINT height, DXGI_FORMAT format, UINT flags)
|
||||
{
|
||||
FIXME("iface %p, buffer_count %u, width %u, height %u, format %s, flags %#x stub!\n",
|
||||
iface, buffer_count, width, height, debug_dxgi_format(format), flags);
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_ResizeTarget(IDXGISwapChain *iface,
|
||||
const DXGI_MODE_DESC *target_mode_desc)
|
||||
{
|
||||
FIXME("iface %p, target_mode_desc %p stub!\n", iface, target_mode_desc);
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetContainingOutput(IDXGISwapChain *iface, IDXGIOutput **output)
|
||||
{
|
||||
FIXME("iface %p, output %p stub!\n", iface, output);
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetFrameStatistics(IDXGISwapChain *iface, DXGI_FRAME_STATISTICS *stats)
|
||||
{
|
||||
FIXME("iface %p, stats %p stub!\n", iface, stats);
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetLastPresentCount(IDXGISwapChain *iface, UINT *last_present_count)
|
||||
{
|
||||
FIXME("iface %p, last_present_count %p stub!\n", iface, last_present_count);
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static const struct IDXGISwapChainVtbl dxgi_swapchain_vtbl =
|
||||
{
|
||||
/* IUnknown methods */
|
||||
dxgi_swapchain_QueryInterface,
|
||||
dxgi_swapchain_AddRef,
|
||||
dxgi_swapchain_Release,
|
||||
/* IDXGIObject methods */
|
||||
dxgi_swapchain_SetPrivateData,
|
||||
dxgi_swapchain_SetPrivateDataInterface,
|
||||
dxgi_swapchain_GetPrivateData,
|
||||
dxgi_swapchain_GetParent,
|
||||
/* IDXGIDeviceSubObject methods */
|
||||
dxgi_swapchain_GetDevice,
|
||||
/* IDXGISwapChain methods */
|
||||
dxgi_swapchain_Present,
|
||||
dxgi_swapchain_GetBuffer,
|
||||
dxgi_swapchain_SetFullscreenState,
|
||||
dxgi_swapchain_GetFullscreenState,
|
||||
dxgi_swapchain_GetDesc,
|
||||
dxgi_swapchain_ResizeBuffers,
|
||||
dxgi_swapchain_ResizeTarget,
|
||||
dxgi_swapchain_GetContainingOutput,
|
||||
dxgi_swapchain_GetFrameStatistics,
|
||||
dxgi_swapchain_GetLastPresentCount,
|
||||
};
|
||||
|
||||
static void STDMETHODCALLTYPE dxgi_swapchain_wined3d_object_released(void *parent)
|
||||
{
|
||||
struct dxgi_swapchain *swapchain = parent;
|
||||
|
||||
wined3d_private_store_cleanup(&swapchain->private_store);
|
||||
HeapFree(GetProcessHeap(), 0, parent);
|
||||
}
|
||||
|
||||
static const struct wined3d_parent_ops dxgi_swapchain_wined3d_parent_ops =
|
||||
{
|
||||
dxgi_swapchain_wined3d_object_released,
|
||||
};
|
||||
|
||||
HRESULT dxgi_swapchain_init(struct dxgi_swapchain *swapchain, struct dxgi_device *device,
|
||||
struct wined3d_swapchain_desc *desc)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
swapchain->IDXGISwapChain_iface.lpVtbl = &dxgi_swapchain_vtbl;
|
||||
swapchain->refcount = 1;
|
||||
wined3d_private_store_init(&swapchain->private_store);
|
||||
|
||||
if (FAILED(hr = wined3d_swapchain_create(device->wined3d_device, desc, swapchain,
|
||||
&dxgi_swapchain_wined3d_parent_ops, &swapchain->wined3d_swapchain)))
|
||||
{
|
||||
WARN("Failed to create wined3d swapchain, hr %#x.\n", hr);
|
||||
wined3d_private_store_cleanup(&swapchain->private_store);
|
||||
return hr;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -1,407 +0,0 @@
|
||||
/*
|
||||
* Copyright 2008 Henri Verbeet for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*
|
||||
*/
|
||||
|
||||
#include "dxgi_private.h"
|
||||
|
||||
#define WINE_DXGI_TO_STR(x) case x: return #x
|
||||
|
||||
const char *debug_dxgi_format(DXGI_FORMAT format)
|
||||
{
|
||||
switch(format)
|
||||
{
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_UNKNOWN);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R32G32B32A32_TYPELESS);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R32G32B32A32_FLOAT);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R32G32B32A32_UINT);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R32G32B32A32_SINT);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R32G32B32_TYPELESS);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R32G32B32_FLOAT);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R32G32B32_UINT);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R32G32B32_SINT);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R16G16B16A16_TYPELESS);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R16G16B16A16_FLOAT);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R16G16B16A16_UNORM);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R16G16B16A16_UINT);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R16G16B16A16_SNORM);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R16G16B16A16_SINT);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R32G32_TYPELESS);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R32G32_FLOAT);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R32G32_UINT);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R32G32_SINT);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R32G8X24_TYPELESS);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_D32_FLOAT_S8X24_UINT);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_X32_TYPELESS_G8X24_UINT);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R10G10B10A2_TYPELESS);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R10G10B10A2_UNORM);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R10G10B10A2_UINT);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R11G11B10_FLOAT);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R8G8B8A8_TYPELESS);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R8G8B8A8_UNORM);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R8G8B8A8_UNORM_SRGB);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R8G8B8A8_UINT);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R8G8B8A8_SNORM);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R8G8B8A8_SINT);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R16G16_TYPELESS);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R16G16_FLOAT);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R16G16_UNORM);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R16G16_UINT);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R16G16_SNORM);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R16G16_SINT);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R32_TYPELESS);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_D32_FLOAT);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R32_FLOAT);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R32_UINT);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R32_SINT);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R24G8_TYPELESS);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_D24_UNORM_S8_UINT);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R24_UNORM_X8_TYPELESS);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_X24_TYPELESS_G8_UINT);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R8G8_TYPELESS);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R8G8_UNORM);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R8G8_UINT);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R8G8_SNORM);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R8G8_SINT);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R16_TYPELESS);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R16_FLOAT);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_D16_UNORM);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R16_UNORM);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R16_UINT);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R16_SNORM);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R16_SINT);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R8_TYPELESS);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R8_UNORM);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R8_UINT);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R8_SNORM);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R8_SINT);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_A8_UNORM);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R1_UNORM);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R9G9B9E5_SHAREDEXP);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_R8G8_B8G8_UNORM);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_G8R8_G8B8_UNORM);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_BC1_TYPELESS);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_BC1_UNORM);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_BC1_UNORM_SRGB);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_BC2_TYPELESS);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_BC2_UNORM);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_BC2_UNORM_SRGB);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_BC3_TYPELESS);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_BC3_UNORM);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_BC3_UNORM_SRGB);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_BC4_TYPELESS);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_BC4_UNORM);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_BC4_SNORM);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_BC5_TYPELESS);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_BC5_UNORM);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_BC5_SNORM);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_B5G6R5_UNORM);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_B5G5R5A1_UNORM);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_B8G8R8A8_UNORM);
|
||||
WINE_DXGI_TO_STR(DXGI_FORMAT_B8G8R8X8_UNORM);
|
||||
default:
|
||||
FIXME("Unrecognized DXGI_FORMAT %#x\n", format);
|
||||
return "unrecognized";
|
||||
}
|
||||
}
|
||||
|
||||
#undef WINE_DXGI_TO_STR
|
||||
|
||||
DXGI_FORMAT dxgi_format_from_wined3dformat(enum wined3d_format_id format)
|
||||
{
|
||||
switch(format)
|
||||
{
|
||||
case WINED3DFMT_UNKNOWN: return DXGI_FORMAT_UNKNOWN;
|
||||
case WINED3DFMT_R32G32B32A32_TYPELESS: return DXGI_FORMAT_R32G32B32A32_TYPELESS;
|
||||
case WINED3DFMT_R32G32B32A32_FLOAT: return DXGI_FORMAT_R32G32B32A32_FLOAT;
|
||||
case WINED3DFMT_R32G32B32A32_UINT: return DXGI_FORMAT_R32G32B32A32_UINT;
|
||||
case WINED3DFMT_R32G32B32A32_SINT: return DXGI_FORMAT_R32G32B32A32_SINT;
|
||||
case WINED3DFMT_R32G32B32_TYPELESS: return DXGI_FORMAT_R32G32B32_TYPELESS;
|
||||
case WINED3DFMT_R32G32B32_FLOAT: return DXGI_FORMAT_R32G32B32_FLOAT;
|
||||
case WINED3DFMT_R32G32B32_UINT: return DXGI_FORMAT_R32G32B32_UINT;
|
||||
case WINED3DFMT_R32G32B32_SINT: return DXGI_FORMAT_R32G32B32_SINT;
|
||||
case WINED3DFMT_R16G16B16A16_TYPELESS: return DXGI_FORMAT_R16G16B16A16_TYPELESS;
|
||||
case WINED3DFMT_R16G16B16A16_FLOAT: return DXGI_FORMAT_R16G16B16A16_FLOAT;
|
||||
case WINED3DFMT_R16G16B16A16_UNORM: return DXGI_FORMAT_R16G16B16A16_UNORM;
|
||||
case WINED3DFMT_R16G16B16A16_UINT: return DXGI_FORMAT_R16G16B16A16_UINT;
|
||||
case WINED3DFMT_R16G16B16A16_SNORM: return DXGI_FORMAT_R16G16B16A16_SNORM;
|
||||
case WINED3DFMT_R16G16B16A16_SINT: return DXGI_FORMAT_R16G16B16A16_SINT;
|
||||
case WINED3DFMT_R32G32_TYPELESS: return DXGI_FORMAT_R32G32_TYPELESS;
|
||||
case WINED3DFMT_R32G32_FLOAT: return DXGI_FORMAT_R32G32_FLOAT;
|
||||
case WINED3DFMT_R32G32_UINT: return DXGI_FORMAT_R32G32_UINT;
|
||||
case WINED3DFMT_R32G32_SINT: return DXGI_FORMAT_R32G32_SINT;
|
||||
case WINED3DFMT_R32G8X24_TYPELESS: return DXGI_FORMAT_R32G8X24_TYPELESS;
|
||||
case WINED3DFMT_D32_FLOAT_S8X24_UINT: return DXGI_FORMAT_D32_FLOAT_S8X24_UINT;
|
||||
case WINED3DFMT_R32_FLOAT_X8X24_TYPELESS: return DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS;
|
||||
case WINED3DFMT_X32_TYPELESS_G8X24_UINT: return DXGI_FORMAT_X32_TYPELESS_G8X24_UINT;
|
||||
case WINED3DFMT_R10G10B10A2_TYPELESS: return DXGI_FORMAT_R10G10B10A2_TYPELESS;
|
||||
case WINED3DFMT_R10G10B10A2_UNORM: return DXGI_FORMAT_R10G10B10A2_UNORM;
|
||||
case WINED3DFMT_R10G10B10A2_UINT: return DXGI_FORMAT_R10G10B10A2_UINT;
|
||||
case WINED3DFMT_R11G11B10_FLOAT: return DXGI_FORMAT_R11G11B10_FLOAT;
|
||||
case WINED3DFMT_R8G8B8A8_TYPELESS: return DXGI_FORMAT_R8G8B8A8_TYPELESS;
|
||||
case WINED3DFMT_R8G8B8A8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM;
|
||||
case WINED3DFMT_R8G8B8A8_UNORM_SRGB: return DXGI_FORMAT_R8G8B8A8_UNORM_SRGB;
|
||||
case WINED3DFMT_R8G8B8A8_UINT: return DXGI_FORMAT_R8G8B8A8_UINT;
|
||||
case WINED3DFMT_R8G8B8A8_SNORM: return DXGI_FORMAT_R8G8B8A8_SNORM;
|
||||
case WINED3DFMT_R8G8B8A8_SINT: return DXGI_FORMAT_R8G8B8A8_SINT;
|
||||
case WINED3DFMT_R16G16_TYPELESS: return DXGI_FORMAT_R16G16_TYPELESS;
|
||||
case WINED3DFMT_R16G16_FLOAT: return DXGI_FORMAT_R16G16_FLOAT;
|
||||
case WINED3DFMT_R16G16_UNORM: return DXGI_FORMAT_R16G16_UNORM;
|
||||
case WINED3DFMT_R16G16_UINT: return DXGI_FORMAT_R16G16_UINT;
|
||||
case WINED3DFMT_R16G16_SNORM: return DXGI_FORMAT_R16G16_SNORM;
|
||||
case WINED3DFMT_R16G16_SINT: return DXGI_FORMAT_R16G16_SINT;
|
||||
case WINED3DFMT_R32_TYPELESS: return DXGI_FORMAT_R32_TYPELESS;
|
||||
case WINED3DFMT_D32_FLOAT: return DXGI_FORMAT_D32_FLOAT;
|
||||
case WINED3DFMT_R32_FLOAT: return DXGI_FORMAT_R32_FLOAT;
|
||||
case WINED3DFMT_R32_UINT: return DXGI_FORMAT_R32_UINT;
|
||||
case WINED3DFMT_R32_SINT: return DXGI_FORMAT_R32_SINT;
|
||||
case WINED3DFMT_R24G8_TYPELESS: return DXGI_FORMAT_R24G8_TYPELESS;
|
||||
case WINED3DFMT_D24_UNORM_S8_UINT: return DXGI_FORMAT_D24_UNORM_S8_UINT;
|
||||
case WINED3DFMT_R24_UNORM_X8_TYPELESS: return DXGI_FORMAT_R24_UNORM_X8_TYPELESS;
|
||||
case WINED3DFMT_X24_TYPELESS_G8_UINT: return DXGI_FORMAT_X24_TYPELESS_G8_UINT;
|
||||
case WINED3DFMT_R8G8_TYPELESS: return DXGI_FORMAT_R8G8_TYPELESS;
|
||||
case WINED3DFMT_R8G8_UNORM: return DXGI_FORMAT_R8G8_UNORM;
|
||||
case WINED3DFMT_R8G8_UINT: return DXGI_FORMAT_R8G8_UINT;
|
||||
case WINED3DFMT_R8G8_SNORM: return DXGI_FORMAT_R8G8_SNORM;
|
||||
case WINED3DFMT_R8G8_SINT: return DXGI_FORMAT_R8G8_SINT;
|
||||
case WINED3DFMT_R16_TYPELESS: return DXGI_FORMAT_R16_TYPELESS;
|
||||
case WINED3DFMT_R16_FLOAT: return DXGI_FORMAT_R16_FLOAT;
|
||||
case WINED3DFMT_D16_UNORM: return DXGI_FORMAT_D16_UNORM;
|
||||
case WINED3DFMT_R16_UNORM: return DXGI_FORMAT_R16_UNORM;
|
||||
case WINED3DFMT_R16_UINT: return DXGI_FORMAT_R16_UINT;
|
||||
case WINED3DFMT_R16_SNORM: return DXGI_FORMAT_R16_SNORM;
|
||||
case WINED3DFMT_R16_SINT: return DXGI_FORMAT_R16_SINT;
|
||||
case WINED3DFMT_R8_TYPELESS: return DXGI_FORMAT_R8_TYPELESS;
|
||||
case WINED3DFMT_R8_UNORM: return DXGI_FORMAT_R8_UNORM;
|
||||
case WINED3DFMT_R8_UINT: return DXGI_FORMAT_R8_UINT;
|
||||
case WINED3DFMT_R8_SNORM: return DXGI_FORMAT_R8_SNORM;
|
||||
case WINED3DFMT_R8_SINT: return DXGI_FORMAT_R8_SINT;
|
||||
case WINED3DFMT_A8_UNORM: return DXGI_FORMAT_A8_UNORM;
|
||||
case WINED3DFMT_R1_UNORM: return DXGI_FORMAT_R1_UNORM;
|
||||
case WINED3DFMT_R9G9B9E5_SHAREDEXP: return DXGI_FORMAT_R9G9B9E5_SHAREDEXP;
|
||||
case WINED3DFMT_R8G8_B8G8_UNORM: return DXGI_FORMAT_R8G8_B8G8_UNORM;
|
||||
case WINED3DFMT_G8R8_G8B8_UNORM: return DXGI_FORMAT_G8R8_G8B8_UNORM;
|
||||
case WINED3DFMT_BC1_TYPELESS: return DXGI_FORMAT_BC1_TYPELESS;
|
||||
case WINED3DFMT_BC1_UNORM: return DXGI_FORMAT_BC1_UNORM;
|
||||
case WINED3DFMT_BC1_UNORM_SRGB: return DXGI_FORMAT_BC1_UNORM_SRGB;
|
||||
case WINED3DFMT_BC2_TYPELESS: return DXGI_FORMAT_BC2_TYPELESS;
|
||||
case WINED3DFMT_BC2_UNORM: return DXGI_FORMAT_BC2_UNORM;
|
||||
case WINED3DFMT_BC2_UNORM_SRGB: return DXGI_FORMAT_BC2_UNORM_SRGB;
|
||||
case WINED3DFMT_BC3_TYPELESS: return DXGI_FORMAT_BC3_TYPELESS;
|
||||
case WINED3DFMT_BC3_UNORM: return DXGI_FORMAT_BC3_UNORM;
|
||||
case WINED3DFMT_BC3_UNORM_SRGB: return DXGI_FORMAT_BC3_UNORM_SRGB;
|
||||
case WINED3DFMT_BC4_TYPELESS: return DXGI_FORMAT_BC4_TYPELESS;
|
||||
case WINED3DFMT_BC4_UNORM: return DXGI_FORMAT_BC4_UNORM;
|
||||
case WINED3DFMT_BC4_SNORM: return DXGI_FORMAT_BC4_SNORM;
|
||||
case WINED3DFMT_BC5_TYPELESS: return DXGI_FORMAT_BC5_TYPELESS;
|
||||
case WINED3DFMT_BC5_UNORM: return DXGI_FORMAT_BC5_UNORM;
|
||||
case WINED3DFMT_BC5_SNORM: return DXGI_FORMAT_BC5_SNORM;
|
||||
case WINED3DFMT_B5G6R5_UNORM: return DXGI_FORMAT_B5G6R5_UNORM;
|
||||
case WINED3DFMT_B5G5R5A1_UNORM: return DXGI_FORMAT_B5G5R5A1_UNORM;
|
||||
case WINED3DFMT_B8G8R8A8_UNORM: return DXGI_FORMAT_B8G8R8A8_UNORM;
|
||||
case WINED3DFMT_B8G8R8X8_UNORM: return DXGI_FORMAT_B8G8R8X8_UNORM;
|
||||
default:
|
||||
FIXME("Unhandled wined3d format %#x.\n", format);
|
||||
return DXGI_FORMAT_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
enum wined3d_format_id wined3dformat_from_dxgi_format(DXGI_FORMAT format)
|
||||
{
|
||||
switch(format)
|
||||
{
|
||||
case DXGI_FORMAT_UNKNOWN: return WINED3DFMT_UNKNOWN;
|
||||
case DXGI_FORMAT_R32G32B32A32_TYPELESS: return WINED3DFMT_R32G32B32A32_TYPELESS;
|
||||
case DXGI_FORMAT_R32G32B32A32_FLOAT: return WINED3DFMT_R32G32B32A32_FLOAT;
|
||||
case DXGI_FORMAT_R32G32B32A32_UINT: return WINED3DFMT_R32G32B32A32_UINT;
|
||||
case DXGI_FORMAT_R32G32B32A32_SINT: return WINED3DFMT_R32G32B32A32_SINT;
|
||||
case DXGI_FORMAT_R32G32B32_TYPELESS: return WINED3DFMT_R32G32B32_TYPELESS;
|
||||
case DXGI_FORMAT_R32G32B32_FLOAT: return WINED3DFMT_R32G32B32_FLOAT;
|
||||
case DXGI_FORMAT_R32G32B32_UINT: return WINED3DFMT_R32G32B32_UINT;
|
||||
case DXGI_FORMAT_R32G32B32_SINT: return WINED3DFMT_R32G32B32_SINT;
|
||||
case DXGI_FORMAT_R16G16B16A16_TYPELESS: return WINED3DFMT_R16G16B16A16_TYPELESS;
|
||||
case DXGI_FORMAT_R16G16B16A16_FLOAT: return WINED3DFMT_R16G16B16A16_FLOAT;
|
||||
case DXGI_FORMAT_R16G16B16A16_UNORM: return WINED3DFMT_R16G16B16A16_UNORM;
|
||||
case DXGI_FORMAT_R16G16B16A16_UINT: return WINED3DFMT_R16G16B16A16_UINT;
|
||||
case DXGI_FORMAT_R16G16B16A16_SNORM: return WINED3DFMT_R16G16B16A16_SNORM;
|
||||
case DXGI_FORMAT_R16G16B16A16_SINT: return WINED3DFMT_R16G16B16A16_SINT;
|
||||
case DXGI_FORMAT_R32G32_TYPELESS: return WINED3DFMT_R32G32_TYPELESS;
|
||||
case DXGI_FORMAT_R32G32_FLOAT: return WINED3DFMT_R32G32_FLOAT;
|
||||
case DXGI_FORMAT_R32G32_UINT: return WINED3DFMT_R32G32_UINT;
|
||||
case DXGI_FORMAT_R32G32_SINT: return WINED3DFMT_R32G32_SINT;
|
||||
case DXGI_FORMAT_R32G8X24_TYPELESS: return WINED3DFMT_R32G8X24_TYPELESS;
|
||||
case DXGI_FORMAT_D32_FLOAT_S8X24_UINT: return WINED3DFMT_D32_FLOAT_S8X24_UINT;
|
||||
case DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS: return WINED3DFMT_R32_FLOAT_X8X24_TYPELESS;
|
||||
case DXGI_FORMAT_X32_TYPELESS_G8X24_UINT: return WINED3DFMT_X32_TYPELESS_G8X24_UINT;
|
||||
case DXGI_FORMAT_R10G10B10A2_TYPELESS: return WINED3DFMT_R10G10B10A2_TYPELESS;
|
||||
case DXGI_FORMAT_R10G10B10A2_UNORM: return WINED3DFMT_R10G10B10A2_UNORM;
|
||||
case DXGI_FORMAT_R10G10B10A2_UINT: return WINED3DFMT_R10G10B10A2_UINT;
|
||||
case DXGI_FORMAT_R11G11B10_FLOAT: return WINED3DFMT_R11G11B10_FLOAT;
|
||||
case DXGI_FORMAT_R8G8B8A8_TYPELESS: return WINED3DFMT_R8G8B8A8_TYPELESS;
|
||||
case DXGI_FORMAT_R8G8B8A8_UNORM: return WINED3DFMT_R8G8B8A8_UNORM;
|
||||
case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB: return WINED3DFMT_R8G8B8A8_UNORM_SRGB;
|
||||
case DXGI_FORMAT_R8G8B8A8_UINT: return WINED3DFMT_R8G8B8A8_UINT;
|
||||
case DXGI_FORMAT_R8G8B8A8_SNORM: return WINED3DFMT_R8G8B8A8_SNORM;
|
||||
case DXGI_FORMAT_R8G8B8A8_SINT: return WINED3DFMT_R8G8B8A8_SINT;
|
||||
case DXGI_FORMAT_R16G16_TYPELESS: return WINED3DFMT_R16G16_TYPELESS;
|
||||
case DXGI_FORMAT_R16G16_FLOAT: return WINED3DFMT_R16G16_FLOAT;
|
||||
case DXGI_FORMAT_R16G16_UNORM: return WINED3DFMT_R16G16_UNORM;
|
||||
case DXGI_FORMAT_R16G16_UINT: return WINED3DFMT_R16G16_UINT;
|
||||
case DXGI_FORMAT_R16G16_SNORM: return WINED3DFMT_R16G16_SNORM;
|
||||
case DXGI_FORMAT_R16G16_SINT: return WINED3DFMT_R16G16_SINT;
|
||||
case DXGI_FORMAT_R32_TYPELESS: return WINED3DFMT_R32_TYPELESS;
|
||||
case DXGI_FORMAT_D32_FLOAT: return WINED3DFMT_D32_FLOAT;
|
||||
case DXGI_FORMAT_R32_FLOAT: return WINED3DFMT_R32_FLOAT;
|
||||
case DXGI_FORMAT_R32_UINT: return WINED3DFMT_R32_UINT;
|
||||
case DXGI_FORMAT_R32_SINT: return WINED3DFMT_R32_SINT;
|
||||
case DXGI_FORMAT_R24G8_TYPELESS: return WINED3DFMT_R24G8_TYPELESS;
|
||||
case DXGI_FORMAT_D24_UNORM_S8_UINT: return WINED3DFMT_D24_UNORM_S8_UINT;
|
||||
case DXGI_FORMAT_R24_UNORM_X8_TYPELESS: return WINED3DFMT_R24_UNORM_X8_TYPELESS;
|
||||
case DXGI_FORMAT_X24_TYPELESS_G8_UINT: return WINED3DFMT_X24_TYPELESS_G8_UINT;
|
||||
case DXGI_FORMAT_R8G8_TYPELESS: return WINED3DFMT_R8G8_TYPELESS;
|
||||
case DXGI_FORMAT_R8G8_UNORM: return WINED3DFMT_R8G8_UNORM;
|
||||
case DXGI_FORMAT_R8G8_UINT: return WINED3DFMT_R8G8_UINT;
|
||||
case DXGI_FORMAT_R8G8_SNORM: return WINED3DFMT_R8G8_SNORM;
|
||||
case DXGI_FORMAT_R8G8_SINT: return WINED3DFMT_R8G8_SINT;
|
||||
case DXGI_FORMAT_R16_TYPELESS: return WINED3DFMT_R16_TYPELESS;
|
||||
case DXGI_FORMAT_R16_FLOAT: return WINED3DFMT_R16_FLOAT;
|
||||
case DXGI_FORMAT_D16_UNORM: return WINED3DFMT_D16_UNORM;
|
||||
case DXGI_FORMAT_R16_UNORM: return WINED3DFMT_R16_UNORM;
|
||||
case DXGI_FORMAT_R16_UINT: return WINED3DFMT_R16_UINT;
|
||||
case DXGI_FORMAT_R16_SNORM: return WINED3DFMT_R16_SNORM;
|
||||
case DXGI_FORMAT_R16_SINT: return WINED3DFMT_R16_SINT;
|
||||
case DXGI_FORMAT_R8_TYPELESS: return WINED3DFMT_R8_TYPELESS;
|
||||
case DXGI_FORMAT_R8_UNORM: return WINED3DFMT_R8_UNORM;
|
||||
case DXGI_FORMAT_R8_UINT: return WINED3DFMT_R8_UINT;
|
||||
case DXGI_FORMAT_R8_SNORM: return WINED3DFMT_R8_SNORM;
|
||||
case DXGI_FORMAT_R8_SINT: return WINED3DFMT_R8_SINT;
|
||||
case DXGI_FORMAT_A8_UNORM: return WINED3DFMT_A8_UNORM;
|
||||
case DXGI_FORMAT_R1_UNORM: return WINED3DFMT_R1_UNORM;
|
||||
case DXGI_FORMAT_R9G9B9E5_SHAREDEXP: return WINED3DFMT_R9G9B9E5_SHAREDEXP;
|
||||
case DXGI_FORMAT_R8G8_B8G8_UNORM: return WINED3DFMT_R8G8_B8G8_UNORM;
|
||||
case DXGI_FORMAT_G8R8_G8B8_UNORM: return WINED3DFMT_G8R8_G8B8_UNORM;
|
||||
case DXGI_FORMAT_BC1_TYPELESS: return WINED3DFMT_BC1_TYPELESS;
|
||||
case DXGI_FORMAT_BC1_UNORM: return WINED3DFMT_BC1_UNORM;
|
||||
case DXGI_FORMAT_BC1_UNORM_SRGB: return WINED3DFMT_BC1_UNORM_SRGB;
|
||||
case DXGI_FORMAT_BC2_TYPELESS: return WINED3DFMT_BC2_TYPELESS;
|
||||
case DXGI_FORMAT_BC2_UNORM: return WINED3DFMT_BC2_UNORM;
|
||||
case DXGI_FORMAT_BC2_UNORM_SRGB: return WINED3DFMT_BC2_UNORM_SRGB;
|
||||
case DXGI_FORMAT_BC3_TYPELESS: return WINED3DFMT_BC3_TYPELESS;
|
||||
case DXGI_FORMAT_BC3_UNORM: return WINED3DFMT_BC3_UNORM;
|
||||
case DXGI_FORMAT_BC3_UNORM_SRGB: return WINED3DFMT_BC3_UNORM_SRGB;
|
||||
case DXGI_FORMAT_BC4_TYPELESS: return WINED3DFMT_BC4_TYPELESS;
|
||||
case DXGI_FORMAT_BC4_UNORM: return WINED3DFMT_BC4_UNORM;
|
||||
case DXGI_FORMAT_BC4_SNORM: return WINED3DFMT_BC4_SNORM;
|
||||
case DXGI_FORMAT_BC5_TYPELESS: return WINED3DFMT_BC5_TYPELESS;
|
||||
case DXGI_FORMAT_BC5_UNORM: return WINED3DFMT_BC5_UNORM;
|
||||
case DXGI_FORMAT_BC5_SNORM: return WINED3DFMT_BC5_SNORM;
|
||||
case DXGI_FORMAT_B5G6R5_UNORM: return WINED3DFMT_B5G6R5_UNORM;
|
||||
case DXGI_FORMAT_B5G5R5A1_UNORM: return WINED3DFMT_B5G5R5A1_UNORM;
|
||||
case DXGI_FORMAT_B8G8R8A8_UNORM: return WINED3DFMT_B8G8R8A8_UNORM;
|
||||
case DXGI_FORMAT_B8G8R8X8_UNORM: return WINED3DFMT_B8G8R8X8_UNORM;
|
||||
default:
|
||||
FIXME("Unhandled DXGI_FORMAT %#x\n", format);
|
||||
return WINED3DFMT_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT dxgi_get_private_data(struct wined3d_private_store *store,
|
||||
REFGUID guid, UINT *data_size, void *data)
|
||||
{
|
||||
const struct wined3d_private_data *stored_data;
|
||||
DWORD size_in;
|
||||
HRESULT hr;
|
||||
|
||||
if (!data_size)
|
||||
return E_INVALIDARG;
|
||||
|
||||
EnterCriticalSection(&dxgi_cs);
|
||||
if (!(stored_data = wined3d_private_store_get_private_data(store, guid)))
|
||||
{
|
||||
hr = DXGI_ERROR_NOT_FOUND;
|
||||
*data_size = 0;
|
||||
goto done;
|
||||
}
|
||||
|
||||
size_in = *data_size;
|
||||
*data_size = stored_data->size;
|
||||
if (!data)
|
||||
{
|
||||
hr = S_OK;
|
||||
goto done;
|
||||
}
|
||||
if (size_in < stored_data->size)
|
||||
{
|
||||
hr = DXGI_ERROR_MORE_DATA;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (stored_data->flags & WINED3DSPD_IUNKNOWN)
|
||||
IUnknown_AddRef(stored_data->content.object);
|
||||
memcpy(data, stored_data->content.data, stored_data->size);
|
||||
hr = S_OK;
|
||||
|
||||
done:
|
||||
LeaveCriticalSection(&dxgi_cs);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
HRESULT dxgi_set_private_data(struct wined3d_private_store *store,
|
||||
REFGUID guid, UINT data_size, const void *data)
|
||||
{
|
||||
struct wined3d_private_data *entry;
|
||||
HRESULT hr;
|
||||
|
||||
if (!data)
|
||||
{
|
||||
EnterCriticalSection(&dxgi_cs);
|
||||
if (!(entry = wined3d_private_store_get_private_data(store, guid)))
|
||||
{
|
||||
LeaveCriticalSection(&dxgi_cs);
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
wined3d_private_store_free_private_data(store, entry);
|
||||
LeaveCriticalSection(&dxgi_cs);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
EnterCriticalSection(&dxgi_cs);
|
||||
hr = wined3d_private_store_set_private_data(store, guid, data, data_size, 0);
|
||||
LeaveCriticalSection(&dxgi_cs);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
HRESULT dxgi_set_private_data_interface(struct wined3d_private_store *store,
|
||||
REFGUID guid, const IUnknown *object)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
if (!object)
|
||||
return dxgi_set_private_data(store, guid, sizeof(object), &object);
|
||||
|
||||
EnterCriticalSection(&dxgi_cs);
|
||||
hr = wined3d_private_store_set_private_data(store,
|
||||
guid, object, sizeof(object), WINED3DSPD_IUNKNOWN);
|
||||
LeaveCriticalSection(&dxgi_cs);
|
||||
|
||||
return hr;
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
/*
|
||||
* Copyright 2008 Henri Verbeet for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#define WINE_FILEDESCRIPTION_STR "Wine DXGI"
|
||||
#define WINE_FILENAME_STR "dxgi.dll"
|
||||
#define WINE_FILEVERSION 6,0,6000,16386
|
||||
#define WINE_FILEVERSION_STR "6.0.6000.16386"
|
||||
#define WINE_PRODUCTVERSION 6,0,6000,16386
|
||||
#define WINE_PRODUCTVERSION_STR "6.0.6000.16386"
|
||||
|
||||
#include <wine/wine_common_ver.rc>
|
||||
@@ -31,7 +31,7 @@ add_library(wbemprox SHARED
|
||||
set_source_files_properties(wbemprox.rc PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/wbemprox.rgs)
|
||||
set_module_type(wbemprox win32dll)
|
||||
target_link_libraries(wbemprox uuid wine)
|
||||
add_importlibs(wbemprox iphlpapi dxgi oleaut32 advapi32 user32 gdi32 version winspool ws2_32 msvcrt kernel32 ntdll)
|
||||
add_importlibs(wbemprox iphlpapi oleaut32 advapi32 user32 gdi32 version winspool ws2_32 msvcrt kernel32 ntdll)
|
||||
add_dependencies(wbemprox d3d_idl_headers)
|
||||
add_pch(wbemprox wbemprox_private.h SOURCE)
|
||||
add_cd_file(TARGET wbemprox DESTINATION reactos/system32/wbem FOR all)
|
||||
|
||||
@@ -30,9 +30,6 @@
|
||||
#include <winspool.h>
|
||||
#include <sddl.h>
|
||||
|
||||
#include <initguid.h>
|
||||
#include <d3d10.h>
|
||||
|
||||
static const WCHAR class_baseboardW[] =
|
||||
{'W','i','n','3','2','_','B','a','s','e','B','o','a','r','d',0};
|
||||
static const WCHAR class_biosW[] =
|
||||
@@ -2752,6 +2749,8 @@ static enum fill_status fill_sid( struct table *table, const struct expr *cond )
|
||||
return FILL_STATUS_FILTERED;
|
||||
}
|
||||
|
||||
#ifndef __REACTOS__
|
||||
|
||||
static UINT32 get_bits_per_pixel( UINT *hres, UINT *vres )
|
||||
{
|
||||
HDC hdc = GetDC( NULL );
|
||||
@@ -2836,6 +2835,8 @@ done:
|
||||
return status;
|
||||
}
|
||||
|
||||
#endif /* !__REACTOS__ */
|
||||
|
||||
static struct table builtin_classes[] =
|
||||
{
|
||||
{ class_baseboardW, SIZEOF(col_baseboard), col_baseboard, SIZEOF(data_baseboard), 0, (BYTE *)data_baseboard },
|
||||
@@ -2866,7 +2867,10 @@ static struct table builtin_classes[] =
|
||||
{ class_stdregprovW, SIZEOF(col_stdregprov), col_stdregprov, SIZEOF(data_stdregprov), 0, (BYTE *)data_stdregprov },
|
||||
{ class_systemsecurityW, SIZEOF(col_systemsecurity), col_systemsecurity, SIZEOF(data_systemsecurity), 0, (BYTE *)data_systemsecurity },
|
||||
{ class_systemenclosureW, SIZEOF(col_systemenclosure), col_systemenclosure, SIZEOF(data_systemenclosure), 0, (BYTE *)data_systemenclosure },
|
||||
#ifndef __REACTOS__
|
||||
/* Requires dxgi.dll */
|
||||
{ class_videocontrollerW, SIZEOF(col_videocontroller), col_videocontroller, 0, 0, NULL, fill_videocontroller }
|
||||
#endif
|
||||
};
|
||||
|
||||
void init_table_list( void )
|
||||
|
||||
@@ -43,7 +43,6 @@ list(APPEND SOURCE
|
||||
docobj.idl
|
||||
docobjectservice.idl
|
||||
downloadmgr.idl
|
||||
dxgi.idl
|
||||
# dyngraph.idl
|
||||
endpointvolume.idl
|
||||
exdisp.idl
|
||||
@@ -142,7 +141,6 @@ add_custom_target(stdole2 DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/stdole2.tlb)
|
||||
|
||||
add_idl_headers(d3d_idl_headers d3d10.idl d3dcommon.idl)
|
||||
|
||||
add_iid_library(dxgi_uuids dxgi.idl)
|
||||
add_iid_library(wuguid wuapi.idl)
|
||||
add_iid_library(xml_uuids msxml2.idl)
|
||||
|
||||
|
||||
@@ -1,446 +0,0 @@
|
||||
/*
|
||||
* Copyright 2007 Andras Kovacs
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
import "oaidl.idl";
|
||||
import "ocidl.idl";
|
||||
import "dxgitype.h";
|
||||
|
||||
const UINT _FACDXGI = 0x87a;
|
||||
|
||||
cpp_quote("#define MAKE_DXGI_STATUS(x) MAKE_HRESULT(0, _FACDXGI, x)")
|
||||
cpp_quote("#define DXGI_STATUS_OCCLUDED MAKE_DXGI_STATUS(1)")
|
||||
cpp_quote("#define DXGI_STATUS_CLIPPED MAKE_DXGI_STATUS(2)")
|
||||
cpp_quote("#define DXGI_STATUS_NO_REDIRECTION MAKE_DXGI_STATUS(4)")
|
||||
cpp_quote("#define DXGI_STATUS_NO_DESKTOP_ACCESS MAKE_DXGI_STATUS(5)")
|
||||
cpp_quote("#define DXGI_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE MAKE_DXGI_STATUS(6)")
|
||||
cpp_quote("#define DXGI_STATUS_MODE_CHANGED MAKE_DXGI_STATUS(7)")
|
||||
cpp_quote("#define DXGI_STATUS_MODE_CHANGE_IN_PROGRESS MAKE_DXGI_STATUS(8)")
|
||||
|
||||
cpp_quote("#define MAKE_DXGI_HRESULT(x) MAKE_HRESULT(1, _FACDXGI, x)")
|
||||
cpp_quote("#define DXGI_ERROR_INVALID_CALL MAKE_DXGI_HRESULT(1)")
|
||||
cpp_quote("#define DXGI_ERROR_NOT_FOUND MAKE_DXGI_HRESULT(2)")
|
||||
cpp_quote("#define DXGI_ERROR_MORE_DATA MAKE_DXGI_HRESULT(3)")
|
||||
cpp_quote("#define DXGI_ERROR_UNSUPPORTED MAKE_DXGI_HRESULT(4)")
|
||||
cpp_quote("#define DXGI_ERROR_DEVICE_REMOVED MAKE_DXGI_HRESULT(5)")
|
||||
cpp_quote("#define DXGI_ERROR_DEVICE_HUNG MAKE_DXGI_HRESULT(6)")
|
||||
cpp_quote("#define DXGI_ERROR_DEVICE_RESET MAKE_DXGI_HRESULT(7)")
|
||||
cpp_quote("#define DXGI_ERROR_WAS_STILL_DRAWING MAKE_DXGI_HRESULT(10)")
|
||||
cpp_quote("#define DXGI_ERROR_FRAME_STATISTICS_DISJOINT MAKE_DXGI_HRESULT(11)")
|
||||
cpp_quote("#define DXGI_ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE MAKE_DXGI_HRESULT(12)")
|
||||
cpp_quote("#define DXGI_ERROR_DRIVER_INTERNAL_ERROR MAKE_DXGI_HRESULT(32)")
|
||||
cpp_quote("#define DXGI_ERROR_NONEXCLUSIVE MAKE_DXGI_HRESULT(33)")
|
||||
cpp_quote("#define DXGI_ERROR_NOT_CURRENTLY_AVAILABLE MAKE_DXGI_HRESULT(34)")
|
||||
|
||||
cpp_quote("#if 0")
|
||||
typedef HANDLE HMONITOR;
|
||||
typedef struct _LUID {
|
||||
DWORD LowPart;
|
||||
LONG HighPart;
|
||||
} LUID, *PLUID;
|
||||
cpp_quote("#endif")
|
||||
|
||||
typedef UINT DXGI_USAGE;
|
||||
const DXGI_USAGE DXGI_USAGE_SHADER_INPUT = 0x10L;
|
||||
const DXGI_USAGE DXGI_USAGE_RENDER_TARGET_OUTPUT = 0x20L;
|
||||
const DXGI_USAGE DXGI_USAGE_BACK_BUFFER = 0x40L;
|
||||
const DXGI_USAGE DXGI_USAGE_SHARED = 0x80L;
|
||||
const DXGI_USAGE DXGI_USAGE_READ_ONLY = 0x100L;
|
||||
|
||||
const UINT DXGI_ENUM_MODES_INTERLACED = 1;
|
||||
const UINT DXGI_ENUM_MODES_SCALING = 2;
|
||||
|
||||
typedef enum DXGI_SWAP_EFFECT {
|
||||
DXGI_SWAP_EFFECT_DISCARD = 0,
|
||||
DXGI_SWAP_EFFECT_SEQUENTIAL = 1,
|
||||
} DXGI_SWAP_EFFECT;
|
||||
|
||||
typedef enum DXGI_RESIDENCY {
|
||||
DXGI_RESIDENCY_FULLY_RESIDENT = 1,
|
||||
DXGI_RESIDENCY_RESIDENT_IN_SHARED_MEMORY = 2,
|
||||
DXGI_RESIDENCY_EVICTED_TO_DISK = 3,
|
||||
} DXGI_RESIDENCY;
|
||||
|
||||
typedef struct DXGI_SURFACE_DESC {
|
||||
UINT Width;
|
||||
UINT Height;
|
||||
DXGI_FORMAT Format;
|
||||
DXGI_SAMPLE_DESC SampleDesc;
|
||||
} DXGI_SURFACE_DESC;
|
||||
|
||||
typedef struct DXGI_MAPPED_RECT {
|
||||
INT Pitch;
|
||||
BYTE *pBits;
|
||||
} DXGI_MAPPED_RECT;
|
||||
|
||||
typedef struct DXGI_OUTPUT_DESC {
|
||||
WCHAR DeviceName[32];
|
||||
RECT DesktopCoordinates;
|
||||
BOOL AttachedToDesktop;
|
||||
DXGI_MODE_ROTATION Rotation;
|
||||
HMONITOR Monitor;
|
||||
} DXGI_OUTPUT_DESC;
|
||||
|
||||
typedef struct DXGI_FRAME_STATISTICS {
|
||||
UINT PresentCount;
|
||||
UINT PresentRefreshCount;
|
||||
UINT SyncRefreshCount;
|
||||
LARGE_INTEGER SyncQPCTime;
|
||||
LARGE_INTEGER SyncGPUTime;
|
||||
} DXGI_FRAME_STATISTICS;
|
||||
|
||||
typedef struct DXGI_ADAPTER_DESC {
|
||||
WCHAR Description[128];
|
||||
UINT VendorId;
|
||||
UINT DeviceId;
|
||||
UINT SubSysId;
|
||||
UINT Revision;
|
||||
SIZE_T DedicatedVideoMemory;
|
||||
SIZE_T DedicatedSystemMemory;
|
||||
SIZE_T SharedSystemMemory;
|
||||
LUID AdapterLuid;
|
||||
} DXGI_ADAPTER_DESC;
|
||||
|
||||
typedef enum DXGI_SWAP_CHAIN_FLAG {
|
||||
DXGI_SWAP_CHAIN_FLAG_NONPREROTATED = 1,
|
||||
DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH = 2,
|
||||
DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE = 4
|
||||
} DXGI_SWAP_CHAIN_FLAG;
|
||||
|
||||
typedef struct DXGI_SWAP_CHAIN_DESC {
|
||||
DXGI_MODE_DESC BufferDesc;
|
||||
DXGI_SAMPLE_DESC SampleDesc;
|
||||
DXGI_USAGE BufferUsage;
|
||||
UINT BufferCount;
|
||||
HWND OutputWindow;
|
||||
BOOL Windowed;
|
||||
DXGI_SWAP_EFFECT SwapEffect;
|
||||
UINT Flags;
|
||||
} DXGI_SWAP_CHAIN_DESC;
|
||||
|
||||
typedef struct DXGI_SHARED_RESOURCE {
|
||||
HANDLE Handle;
|
||||
} DXGI_SHARED_RESOURCE;
|
||||
|
||||
[
|
||||
object,
|
||||
local,
|
||||
uuid(aec22fb8-76f3-4639-9be0-28eb43a67a2e)
|
||||
]
|
||||
interface IDXGIObject : IUnknown
|
||||
{
|
||||
HRESULT SetPrivateData(
|
||||
[in] REFGUID guid,
|
||||
[in] UINT data_size,
|
||||
[in] const void *data
|
||||
);
|
||||
HRESULT SetPrivateDataInterface(
|
||||
[in] REFGUID guid,
|
||||
[in] const IUnknown *object
|
||||
);
|
||||
HRESULT GetPrivateData(
|
||||
[in] REFGUID guid,
|
||||
[in, out] UINT *data_size,
|
||||
[out] void *data
|
||||
);
|
||||
HRESULT GetParent(
|
||||
[in] REFIID riid,
|
||||
[out] void **parent
|
||||
);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
local,
|
||||
uuid(3d3e0379-f9de-4d58-bb6c-18d62992f1a6)
|
||||
]
|
||||
interface IDXGIDeviceSubObject : IDXGIObject
|
||||
{
|
||||
HRESULT GetDevice(
|
||||
[in] REFIID riid,
|
||||
[out] void **device
|
||||
);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(035f3ab4-482e-4e50-b41f-8a7f8bd8960b),
|
||||
local,
|
||||
pointer_default(unique)
|
||||
]
|
||||
interface IDXGIResource : IDXGIDeviceSubObject
|
||||
{
|
||||
HRESULT GetSharedHandle([out] HANDLE *pSharedHandle);
|
||||
HRESULT GetUsage([out] DXGI_USAGE *pUsage);
|
||||
HRESULT SetEvictionPriority([in] UINT EvictionPriority);
|
||||
HRESULT GetEvictionPriority([out, retval] UINT *pEvictionPriority);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(9d8e1289-d7b3-465f-8126-250e349af85d),
|
||||
local,
|
||||
pointer_default(unique)
|
||||
]
|
||||
interface IDXGIKeyedMutex : IDXGIDeviceSubObject
|
||||
{
|
||||
HRESULT AcquireSync([in] UINT64 Key, [in] DWORD dwMilliseconds);
|
||||
HRESULT ReleaseSync([in] UINT64 Key);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
local,
|
||||
uuid(cafcb56c-6ac3-4889-bf47-9e23bbd260ec)
|
||||
]
|
||||
interface IDXGISurface : IDXGIDeviceSubObject
|
||||
{
|
||||
HRESULT GetDesc(
|
||||
[out] DXGI_SURFACE_DESC *desc
|
||||
);
|
||||
HRESULT Map(
|
||||
[out] DXGI_MAPPED_RECT *mapped_rect,
|
||||
[in] UINT flags
|
||||
);
|
||||
HRESULT Unmap(
|
||||
);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
local,
|
||||
uuid(ae02eedb-c735-4690-8d52-5a8dc20213aa)
|
||||
]
|
||||
interface IDXGIOutput : IDXGIObject
|
||||
{
|
||||
HRESULT GetDesc(
|
||||
[out] DXGI_OUTPUT_DESC *desc
|
||||
);
|
||||
HRESULT GetDisplayModeList(
|
||||
[in] DXGI_FORMAT format,
|
||||
[in] UINT flags,
|
||||
[in, out] UINT *mode_count,
|
||||
[out] DXGI_MODE_DESC *desc
|
||||
);
|
||||
HRESULT FindClosestMatchingMode(
|
||||
[in] const DXGI_MODE_DESC *mode,
|
||||
[out] DXGI_MODE_DESC *closest_match,
|
||||
[in] IUnknown *device
|
||||
);
|
||||
HRESULT WaitForVBlank(
|
||||
);
|
||||
HRESULT TakeOwnership(
|
||||
[in] IUnknown *device,
|
||||
[in] BOOL exclusive
|
||||
);
|
||||
void ReleaseOwnership(
|
||||
);
|
||||
HRESULT GetGammaControlCapabilities(
|
||||
[out] DXGI_GAMMA_CONTROL_CAPABILITIES *gamma_caps
|
||||
);
|
||||
HRESULT SetGammaControl(
|
||||
[in] const DXGI_GAMMA_CONTROL *gamma_control
|
||||
);
|
||||
HRESULT GetGammaControl(
|
||||
[out] DXGI_GAMMA_CONTROL *gamma_control
|
||||
);
|
||||
HRESULT SetDisplaySurface(
|
||||
[in] IDXGISurface *surface
|
||||
);
|
||||
HRESULT GetDisplaySurfaceData(
|
||||
[in] IDXGISurface *surface
|
||||
);
|
||||
HRESULT GetFrameStatistics(
|
||||
[out] DXGI_FRAME_STATISTICS *stats
|
||||
);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
local,
|
||||
uuid(2411e7e1-12ac-4ccf-bd14-9798e8534dc0)
|
||||
]
|
||||
interface IDXGIAdapter : IDXGIObject
|
||||
{
|
||||
HRESULT EnumOutputs(
|
||||
[in] UINT output_idx,
|
||||
[in, out] IDXGIOutput **output
|
||||
);
|
||||
HRESULT GetDesc(
|
||||
[out] DXGI_ADAPTER_DESC *desc
|
||||
);
|
||||
HRESULT CheckInterfaceSupport(
|
||||
[in] REFGUID guid,
|
||||
[out] LARGE_INTEGER *umd_version
|
||||
);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
local,
|
||||
uuid(310d36a0-d2e7-4c0a-aa04-6a9d23b8886a)
|
||||
]
|
||||
interface IDXGISwapChain : IDXGIDeviceSubObject
|
||||
{
|
||||
HRESULT Present(
|
||||
[in] UINT sync_interval,
|
||||
[in] UINT flags
|
||||
);
|
||||
HRESULT GetBuffer(
|
||||
[in] UINT buffer_idx,
|
||||
[in] REFIID riid,
|
||||
[in, out] void **surface
|
||||
);
|
||||
HRESULT SetFullscreenState(
|
||||
[in] BOOL fullscreen,
|
||||
[in] IDXGIOutput *target
|
||||
);
|
||||
HRESULT GetFullscreenState(
|
||||
[out] BOOL *fullscreen,
|
||||
[out] IDXGIOutput **target
|
||||
);
|
||||
HRESULT GetDesc(
|
||||
[out] DXGI_SWAP_CHAIN_DESC *desc
|
||||
);
|
||||
HRESULT ResizeBuffers(
|
||||
[in] UINT buffer_count,
|
||||
[in] UINT width,
|
||||
[in] UINT height,
|
||||
[in] DXGI_FORMAT format,
|
||||
[in] UINT flags
|
||||
);
|
||||
HRESULT ResizeTarget(
|
||||
[in] const DXGI_MODE_DESC *target_mode_desc
|
||||
);
|
||||
HRESULT GetContainingOutput(
|
||||
[out] IDXGIOutput **output
|
||||
);
|
||||
HRESULT GetFrameStatistics(
|
||||
[out] DXGI_FRAME_STATISTICS *stats
|
||||
);
|
||||
HRESULT GetLastPresentCount(
|
||||
[out] UINT *last_present_count
|
||||
);
|
||||
}
|
||||
|
||||
cpp_quote("#define DXGI_MWA_NO_WINDOW_CHANGES 0x1")
|
||||
cpp_quote("#define DXGI_MWA_NO_ALT_ENTER 0x2")
|
||||
cpp_quote("#define DXGI_MWA_NO_PRINT_SCREEN 0x4")
|
||||
cpp_quote("#define DXGI_MWA_VALID 0x7")
|
||||
|
||||
[
|
||||
object,
|
||||
local,
|
||||
uuid(7b7166ec-21c7-44ae-b21a-c9ae321ae369)
|
||||
]
|
||||
interface IDXGIFactory : IDXGIObject
|
||||
{
|
||||
HRESULT EnumAdapters(
|
||||
[in] UINT adapter_idx,
|
||||
[out] IDXGIAdapter **adapter
|
||||
);
|
||||
HRESULT MakeWindowAssociation(
|
||||
[in] HWND window,
|
||||
[in] UINT flags
|
||||
);
|
||||
HRESULT GetWindowAssociation(
|
||||
[in] HWND *window
|
||||
);
|
||||
HRESULT CreateSwapChain(
|
||||
[in] IUnknown *device,
|
||||
[in] DXGI_SWAP_CHAIN_DESC *desc,
|
||||
[out] IDXGISwapChain **swapchain
|
||||
);
|
||||
HRESULT CreateSoftwareAdapter(
|
||||
[in] HMODULE swrast,
|
||||
[out] IDXGIAdapter **adapter
|
||||
);
|
||||
}
|
||||
|
||||
[local] HRESULT __stdcall CreateDXGIFactory(REFIID riid, void **factory);
|
||||
|
||||
[
|
||||
object,
|
||||
local,
|
||||
uuid(54ec77fa-1377-44e6-8c32-88fd5f44c84c)
|
||||
]
|
||||
interface IDXGIDevice : IDXGIObject
|
||||
{
|
||||
HRESULT GetAdapter(
|
||||
[out] IDXGIAdapter **adapter
|
||||
);
|
||||
HRESULT CreateSurface(
|
||||
[in] const DXGI_SURFACE_DESC *desc,
|
||||
[in] UINT surface_count,
|
||||
[in] DXGI_USAGE usage,
|
||||
[in] const DXGI_SHARED_RESOURCE *shared_resource,
|
||||
[out] IDXGISurface **surface
|
||||
);
|
||||
HRESULT QueryResourceResidency(
|
||||
[in] IUnknown *const *resources,
|
||||
[out] DXGI_RESIDENCY *residency,
|
||||
[in] UINT resource_count
|
||||
);
|
||||
HRESULT SetGPUThreadPriority(
|
||||
[in] INT priority
|
||||
);
|
||||
HRESULT GetGPUThreadPriority(
|
||||
[out] INT *priority
|
||||
);
|
||||
}
|
||||
|
||||
typedef enum DXGI_ADAPTER_FLAG {
|
||||
DXGI_ADAPTER_FLAG_NONE = 0,
|
||||
DXGI_ADAPTER_FLAG_REMOTE = 1,
|
||||
DXGI_ADAPTER_FLAG_FORCE_DWORD = 0xFFFFFFFF
|
||||
} DXGI_ADAPTER_FLAG;
|
||||
|
||||
typedef struct DXGI_ADAPTER_DESC1 {
|
||||
WCHAR Description[128];
|
||||
UINT VendorId;
|
||||
UINT DeviceId;
|
||||
UINT SubSysId;
|
||||
UINT Revision;
|
||||
SIZE_T DedicatedVideoMemory;
|
||||
SIZE_T DedicatedSystemMemory;
|
||||
SIZE_T SharedSystemMemory;
|
||||
LUID AdapterLuid;
|
||||
UINT Flags;
|
||||
} DXGI_ADAPTER_DESC1;
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(29038f61-3839-4626-91fd-086879011a05),
|
||||
local,
|
||||
pointer_default(unique)
|
||||
]
|
||||
interface IDXGIAdapter1 : IDXGIAdapter
|
||||
{
|
||||
HRESULT GetDesc1([out] DXGI_ADAPTER_DESC1 *pDesc);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(770aae78-f26f-4dba-a829-253c83d1b387),
|
||||
local,
|
||||
pointer_default(unique)
|
||||
]
|
||||
interface IDXGIFactory1 : IDXGIFactory
|
||||
{
|
||||
HRESULT EnumAdapters1([in] UINT Adapter, [out] IDXGIAdapter1 **ppAdapter);
|
||||
BOOL IsCurrent();
|
||||
}
|
||||
@@ -1,117 +0,0 @@
|
||||
/*
|
||||
* Copyright 2007 Andras Kovacs
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef __dxgiformat_h__
|
||||
#define __dxgiformat_h__
|
||||
|
||||
#define DXGI_FORMAT_DEFINED 1
|
||||
|
||||
typedef enum DXGI_FORMAT {
|
||||
DXGI_FORMAT_UNKNOWN = 0,
|
||||
DXGI_FORMAT_R32G32B32A32_TYPELESS = 1,
|
||||
DXGI_FORMAT_R32G32B32A32_FLOAT = 2,
|
||||
DXGI_FORMAT_R32G32B32A32_UINT = 3,
|
||||
DXGI_FORMAT_R32G32B32A32_SINT = 4,
|
||||
DXGI_FORMAT_R32G32B32_TYPELESS = 5,
|
||||
DXGI_FORMAT_R32G32B32_FLOAT = 6,
|
||||
DXGI_FORMAT_R32G32B32_UINT = 7,
|
||||
DXGI_FORMAT_R32G32B32_SINT = 8,
|
||||
DXGI_FORMAT_R16G16B16A16_TYPELESS = 9,
|
||||
DXGI_FORMAT_R16G16B16A16_FLOAT = 10,
|
||||
DXGI_FORMAT_R16G16B16A16_UNORM = 11,
|
||||
DXGI_FORMAT_R16G16B16A16_UINT = 12,
|
||||
DXGI_FORMAT_R16G16B16A16_SNORM = 13,
|
||||
DXGI_FORMAT_R16G16B16A16_SINT = 14,
|
||||
DXGI_FORMAT_R32G32_TYPELESS = 15,
|
||||
DXGI_FORMAT_R32G32_FLOAT = 16,
|
||||
DXGI_FORMAT_R32G32_UINT = 17,
|
||||
DXGI_FORMAT_R32G32_SINT = 18,
|
||||
DXGI_FORMAT_R32G8X24_TYPELESS = 19,
|
||||
DXGI_FORMAT_D32_FLOAT_S8X24_UINT = 20,
|
||||
DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS= 21,
|
||||
DXGI_FORMAT_X32_TYPELESS_G8X24_UINT = 22,
|
||||
DXGI_FORMAT_R10G10B10A2_TYPELESS = 23,
|
||||
DXGI_FORMAT_R10G10B10A2_UNORM = 24,
|
||||
DXGI_FORMAT_R10G10B10A2_UINT = 25,
|
||||
DXGI_FORMAT_R11G11B10_FLOAT = 26,
|
||||
DXGI_FORMAT_R8G8B8A8_TYPELESS = 27,
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM = 28,
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM_SRGB = 29,
|
||||
DXGI_FORMAT_R8G8B8A8_UINT = 30,
|
||||
DXGI_FORMAT_R8G8B8A8_SNORM = 31,
|
||||
DXGI_FORMAT_R8G8B8A8_SINT = 32,
|
||||
DXGI_FORMAT_R16G16_TYPELESS = 33,
|
||||
DXGI_FORMAT_R16G16_FLOAT = 34,
|
||||
DXGI_FORMAT_R16G16_UNORM = 35,
|
||||
DXGI_FORMAT_R16G16_UINT = 36,
|
||||
DXGI_FORMAT_R16G16_SNORM = 37,
|
||||
DXGI_FORMAT_R16G16_SINT = 38,
|
||||
DXGI_FORMAT_R32_TYPELESS = 39,
|
||||
DXGI_FORMAT_D32_FLOAT = 40,
|
||||
DXGI_FORMAT_R32_FLOAT = 41,
|
||||
DXGI_FORMAT_R32_UINT = 42,
|
||||
DXGI_FORMAT_R32_SINT = 43,
|
||||
DXGI_FORMAT_R24G8_TYPELESS = 44,
|
||||
DXGI_FORMAT_D24_UNORM_S8_UINT = 45,
|
||||
DXGI_FORMAT_R24_UNORM_X8_TYPELESS = 46,
|
||||
DXGI_FORMAT_X24_TYPELESS_G8_UINT = 47,
|
||||
DXGI_FORMAT_R8G8_TYPELESS = 48,
|
||||
DXGI_FORMAT_R8G8_UNORM = 49,
|
||||
DXGI_FORMAT_R8G8_UINT = 50,
|
||||
DXGI_FORMAT_R8G8_SNORM = 51,
|
||||
DXGI_FORMAT_R8G8_SINT = 52,
|
||||
DXGI_FORMAT_R16_TYPELESS = 53,
|
||||
DXGI_FORMAT_R16_FLOAT = 54,
|
||||
DXGI_FORMAT_D16_UNORM = 55,
|
||||
DXGI_FORMAT_R16_UNORM = 56,
|
||||
DXGI_FORMAT_R16_UINT = 57,
|
||||
DXGI_FORMAT_R16_SNORM = 58,
|
||||
DXGI_FORMAT_R16_SINT = 59,
|
||||
DXGI_FORMAT_R8_TYPELESS = 60,
|
||||
DXGI_FORMAT_R8_UNORM = 61,
|
||||
DXGI_FORMAT_R8_UINT = 62,
|
||||
DXGI_FORMAT_R8_SNORM = 63,
|
||||
DXGI_FORMAT_R8_SINT = 64,
|
||||
DXGI_FORMAT_A8_UNORM = 65,
|
||||
DXGI_FORMAT_R1_UNORM = 66,
|
||||
DXGI_FORMAT_R9G9B9E5_SHAREDEXP = 67,
|
||||
DXGI_FORMAT_R8G8_B8G8_UNORM = 68,
|
||||
DXGI_FORMAT_G8R8_G8B8_UNORM = 69,
|
||||
DXGI_FORMAT_BC1_TYPELESS = 70,
|
||||
DXGI_FORMAT_BC1_UNORM = 71,
|
||||
DXGI_FORMAT_BC1_UNORM_SRGB = 72,
|
||||
DXGI_FORMAT_BC2_TYPELESS = 73,
|
||||
DXGI_FORMAT_BC2_UNORM = 74,
|
||||
DXGI_FORMAT_BC2_UNORM_SRGB = 75,
|
||||
DXGI_FORMAT_BC3_TYPELESS = 76,
|
||||
DXGI_FORMAT_BC3_UNORM = 77,
|
||||
DXGI_FORMAT_BC3_UNORM_SRGB = 78,
|
||||
DXGI_FORMAT_BC4_TYPELESS = 79,
|
||||
DXGI_FORMAT_BC4_UNORM = 80,
|
||||
DXGI_FORMAT_BC4_SNORM = 81,
|
||||
DXGI_FORMAT_BC5_TYPELESS = 82,
|
||||
DXGI_FORMAT_BC5_UNORM = 83,
|
||||
DXGI_FORMAT_BC5_SNORM = 84,
|
||||
DXGI_FORMAT_B5G6R5_UNORM = 85,
|
||||
DXGI_FORMAT_B5G5R5A1_UNORM = 86,
|
||||
DXGI_FORMAT_B8G8R8A8_UNORM = 87,
|
||||
DXGI_FORMAT_B8G8R8X8_UNORM = 88,
|
||||
DXGI_FORMAT_FORCE_UINT = 0xffffffff
|
||||
} DXGI_FORMAT;
|
||||
|
||||
#endif
|
||||
@@ -1,84 +0,0 @@
|
||||
/*
|
||||
* Copyright 2007 Andras Kovacs
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef __dxgitype_h__
|
||||
#define __dxgitype_h__
|
||||
|
||||
#include "dxgiformat.h"
|
||||
|
||||
typedef struct DXGI_SAMPLE_DESC {
|
||||
UINT Count;
|
||||
UINT Quality;
|
||||
} DXGI_SAMPLE_DESC;
|
||||
|
||||
typedef enum DXGI_MODE_ROTATION {
|
||||
DXGI_MODE_ROTATION_UNSPECIFIED = 0,
|
||||
DXGI_MODE_ROTATION_IDENTITY = 1,
|
||||
DXGI_MODE_ROTATION_ROTATE90 = 2,
|
||||
DXGI_MODE_ROTATION_ROTATE180 = 3,
|
||||
DXGI_MODE_ROTATION_ROTATE270 = 4,
|
||||
} DXGI_MODE_ROTATION;
|
||||
|
||||
typedef enum DXGI_MODE_SCANLINE_ORDER {
|
||||
DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED = 0,
|
||||
DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE = 1,
|
||||
DXGI_MODE_SCANLINE_ORDER_UPPER_FIELD_FIRST = 2,
|
||||
DXGI_MODE_SCANLINE_ORDER_LOWER_FIELD_FIRST = 3,
|
||||
} DXGI_MODE_SCANLINE_ORDER;
|
||||
|
||||
typedef enum DXGI_MODE_SCALING {
|
||||
DXGI_MODE_SCALING_UNSPECIFIED = 0,
|
||||
DXGI_MODE_SCALING_CENTERED = 1,
|
||||
DXGI_MODE_SCALING_STRETCHED = 2,
|
||||
} DXGI_MODE_SCALING;
|
||||
|
||||
typedef struct DXGI_RATIONAL {
|
||||
UINT Numerator;
|
||||
UINT Denominator;
|
||||
} DXGI_RATIONAL;
|
||||
|
||||
typedef struct DXGI_MODE_DESC {
|
||||
UINT Width;
|
||||
UINT Height;
|
||||
DXGI_RATIONAL RefreshRate;
|
||||
DXGI_FORMAT Format;
|
||||
DXGI_MODE_SCANLINE_ORDER ScanlineOrdering;
|
||||
DXGI_MODE_SCALING Scaling;
|
||||
} DXGI_MODE_DESC;
|
||||
|
||||
typedef struct DXGI_GAMMA_CONTROL_CAPABILITIES {
|
||||
BOOL ScaleAndOffsetSupported;
|
||||
float MaxConvertedValue;
|
||||
float MinConvertedValue;
|
||||
UINT NumGammaControlPoints;
|
||||
float ControlPointPositions[1025];
|
||||
} DXGI_GAMMA_CONTROL_CAPABILITIES;
|
||||
|
||||
typedef struct DXGI_RGB {
|
||||
float Red;
|
||||
float Green;
|
||||
float Blue;
|
||||
} DXGI_RGB;
|
||||
|
||||
typedef struct DXGI_GAMMA_CONTROL {
|
||||
DXGI_RGB Scale;
|
||||
DXGI_RGB Offset;
|
||||
DXGI_RGB GammaCurve[1025];
|
||||
} DXGI_GAMMA_CONTROL;
|
||||
|
||||
#endif
|
||||
@@ -1,2 +1,2 @@
|
||||
|
||||
add_idl_headers(wineheaders itss.idl winedxgi.idl)
|
||||
add_idl_headers(wineheaders itss.idl)
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
/*
|
||||
* Copyright 2008-2009 Henri Verbeet for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
import "dxgi.idl";
|
||||
|
||||
[
|
||||
object,
|
||||
local,
|
||||
uuid(3e1ff30b-c951-48c3-b010-0fb49f3dca71)
|
||||
]
|
||||
interface IWineDXGIDevice : IDXGIDevice
|
||||
{
|
||||
HRESULT create_surface(
|
||||
[in] const DXGI_SURFACE_DESC *desc,
|
||||
[in] DXGI_USAGE usage,
|
||||
[in] const DXGI_SHARED_RESOURCE *shared_resource,
|
||||
[in] IUnknown *outer,
|
||||
[out] void **surface
|
||||
);
|
||||
HRESULT create_swapchain(
|
||||
[in] struct wined3d_swapchain_desc *desc,
|
||||
[out] struct wined3d_swapchain **wined3d_swapchain
|
||||
);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
local,
|
||||
uuid(f2b918f3-603f-430a-9ccd-55872b6e85df)
|
||||
]
|
||||
interface IWineDXGIDeviceParent : IUnknown
|
||||
{
|
||||
struct wined3d_device_parent *get_wined3d_device_parent();
|
||||
}
|
||||
@@ -37,7 +37,6 @@ reactos/dll/directx/wine/dplay # Synced to WineStaging-1.7.47
|
||||
reactos/dll/directx/wine/dplayx # Synced to WineStaging-1.7.47
|
||||
reactos/dll/directx/wine/dsound # Synced to Wine-1.3.29
|
||||
reactos/dll/directx/wine/dxdiagn # Synced to WineStaging-1.7.47
|
||||
reactos/dll/directx/wine/dxgi # Synced to WineStaging-1.7.47
|
||||
reactos/dll/directx/wine/msdmo # Synced to WineStaging-1.7.47
|
||||
reactos/dll/directx/wine/qedit # Synced to WineStaging-1.7.37
|
||||
reactos/dll/directx/wine/quartz # Synced to WineStaging-1.7.47
|
||||
|
||||
Reference in New Issue
Block a user