"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "dlls/dxgi/swapchain.c" between
wine-5.12.tar.xz and wine-5.13.tar.xz

About: Wine is an Open Source implementation of the MS Windows API on top of X, OpenGL, and Unix. Think of Wine as a compatibility layer for running Windows programs. Development release.

swapchain.c  (wine-5.12.tar.xz):swapchain.c  (wine-5.13.tar.xz)
skipping to change at line 1035 skipping to change at line 1035
default: default:
FIXME("Unhandled VkResult %d.\n", vr); FIXME("Unhandled VkResult %d.\n", vr);
return E_FAIL; return E_FAIL;
} }
} }
#define INVALID_VK_IMAGE_INDEX (~(uint32_t)0) #define INVALID_VK_IMAGE_INDEX (~(uint32_t)0)
struct d3d12_swapchain struct d3d12_swapchain
{ {
IDXGISwapChain3 IDXGISwapChain3_iface; IDXGISwapChain4 IDXGISwapChain4_iface;
LONG refcount; LONG refcount;
struct wined3d_private_store private_store; struct wined3d_private_store private_store;
struct wined3d_swapchain_state *state; struct wined3d_swapchain_state *state;
VkSwapchainKHR vk_swapchain; VkSwapchainKHR vk_swapchain;
VkSurfaceKHR vk_surface; VkSurfaceKHR vk_surface;
VkFence vk_fence; VkFence vk_fence;
VkInstance vk_instance; VkInstance vk_instance;
VkDevice vk_device; VkDevice vk_device;
skipping to change at line 1823 skipping to change at line 1823
hr = hresult_from_vk_result(vr); hr = hresult_from_vk_result(vr);
} }
else else
{ {
ERR("Failed to recreate Vulkan swapchain, hr %#x.\n", hr); ERR("Failed to recreate Vulkan swapchain, hr %#x.\n", hr);
} }
return hr; return hr;
} }
static inline struct d3d12_swapchain *d3d12_swapchain_from_IDXGISwapChain3(IDXGI SwapChain3 *iface) static inline struct d3d12_swapchain *d3d12_swapchain_from_IDXGISwapChain4(IDXGI SwapChain4 *iface)
{ {
return CONTAINING_RECORD(iface, struct d3d12_swapchain, IDXGISwapChain3_ifac e); return CONTAINING_RECORD(iface, struct d3d12_swapchain, IDXGISwapChain4_ifac e);
} }
/* IUnknown methods */ /* IUnknown methods */
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_QueryInterface(IDXGISwapChain3 *iface, REFIID iid, void **object) static HRESULT STDMETHODCALLTYPE d3d12_swapchain_QueryInterface(IDXGISwapChain4 *iface, REFIID iid, void **object)
{ {
TRACE("iface %p, iid %s, object %p.\n", iface, debugstr_guid(iid), object); TRACE("iface %p, iid %s, object %p.\n", iface, debugstr_guid(iid), object);
if (IsEqualGUID(iid, &IID_IUnknown) if (IsEqualGUID(iid, &IID_IUnknown)
|| IsEqualGUID(iid, &IID_IDXGIObject) || IsEqualGUID(iid, &IID_IDXGIObject)
|| IsEqualGUID(iid, &IID_IDXGIDeviceSubObject) || IsEqualGUID(iid, &IID_IDXGIDeviceSubObject)
|| IsEqualGUID(iid, &IID_IDXGISwapChain) || IsEqualGUID(iid, &IID_IDXGISwapChain)
|| IsEqualGUID(iid, &IID_IDXGISwapChain1) || IsEqualGUID(iid, &IID_IDXGISwapChain1)
|| IsEqualGUID(iid, &IID_IDXGISwapChain2) || IsEqualGUID(iid, &IID_IDXGISwapChain2)
|| IsEqualGUID(iid, &IID_IDXGISwapChain3)) || IsEqualGUID(iid, &IID_IDXGISwapChain3)
|| IsEqualGUID(iid, &IID_IDXGISwapChain4))
{ {
IUnknown_AddRef(iface); IUnknown_AddRef(iface);
*object = iface; *object = iface;
return S_OK; return S_OK;
} }
WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid));
*object = NULL; *object = NULL;
return E_NOINTERFACE; return E_NOINTERFACE;
} }
static ULONG STDMETHODCALLTYPE d3d12_swapchain_AddRef(IDXGISwapChain3 *iface) static ULONG STDMETHODCALLTYPE d3d12_swapchain_AddRef(IDXGISwapChain4 *iface)
{ {
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(ifa ce); struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(ifa ce);
ULONG refcount = InterlockedIncrement(&swapchain->refcount); ULONG refcount = InterlockedIncrement(&swapchain->refcount);
TRACE("%p increasing refcount to %u.\n", swapchain, refcount); TRACE("%p increasing refcount to %u.\n", swapchain, refcount);
return refcount; return refcount;
} }
static void d3d12_swapchain_destroy(struct d3d12_swapchain *swapchain) static void d3d12_swapchain_destroy(struct d3d12_swapchain *swapchain)
{ {
const struct dxgi_vk_funcs *vk_funcs = &swapchain->vk_funcs; const struct dxgi_vk_funcs *vk_funcs = &swapchain->vk_funcs;
skipping to change at line 1907 skipping to change at line 1908
ID3D12Device_Release(swapchain->device); ID3D12Device_Release(swapchain->device);
if (swapchain->factory) if (swapchain->factory)
IWineDXGIFactory_Release(swapchain->factory); IWineDXGIFactory_Release(swapchain->factory);
close_library(vulkan_module); close_library(vulkan_module);
wined3d_swapchain_state_destroy(swapchain->state); wined3d_swapchain_state_destroy(swapchain->state);
} }
static ULONG STDMETHODCALLTYPE d3d12_swapchain_Release(IDXGISwapChain3 *iface) static ULONG STDMETHODCALLTYPE d3d12_swapchain_Release(IDXGISwapChain4 *iface)
{ {
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(ifa ce); struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(ifa ce);
ULONG refcount = InterlockedDecrement(&swapchain->refcount); ULONG refcount = InterlockedDecrement(&swapchain->refcount);
TRACE("%p decreasing refcount to %u.\n", swapchain, refcount); TRACE("%p decreasing refcount to %u.\n", swapchain, refcount);
if (!refcount) if (!refcount)
{ {
d3d12_swapchain_destroy(swapchain); d3d12_swapchain_destroy(swapchain);
heap_free(swapchain); heap_free(swapchain);
} }
return refcount; return refcount;
} }
/* IDXGIObject methods */ /* IDXGIObject methods */
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetPrivateData(IDXGISwapChain3 *iface, static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetPrivateData(IDXGISwapChain4 *iface,
REFGUID guid, UINT data_size, const void *data) REFGUID guid, UINT data_size, const void *data)
{ {
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(ifa ce); struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(ifa ce);
TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(gu id), data_size, data); TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(gu id), data_size, data);
return dxgi_set_private_data(&swapchain->private_store, guid, data_size, dat a); return dxgi_set_private_data(&swapchain->private_store, guid, data_size, dat a);
} }
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetPrivateDataInterface(IDXGISw apChain3 *iface, static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetPrivateDataInterface(IDXGISw apChain4 *iface,
REFGUID guid, const IUnknown *object) REFGUID guid, const IUnknown *object)
{ {
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(ifa ce); struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(ifa ce);
TRACE("iface %p, guid %s, object %p.\n", iface, debugstr_guid(guid), object) ; TRACE("iface %p, guid %s, object %p.\n", iface, debugstr_guid(guid), object) ;
return dxgi_set_private_data_interface(&swapchain->private_store, guid, obje ct); return dxgi_set_private_data_interface(&swapchain->private_store, guid, obje ct);
} }
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetPrivateData(IDXGISwapChain3 *iface, static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetPrivateData(IDXGISwapChain4 *iface,
REFGUID guid, UINT *data_size, void *data) REFGUID guid, UINT *data_size, void *data)
{ {
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(ifa ce); struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(ifa ce);
TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(gu id), data_size, data); TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(gu id), data_size, data);
return dxgi_get_private_data(&swapchain->private_store, guid, data_size, dat a); return dxgi_get_private_data(&swapchain->private_store, guid, data_size, dat a);
} }
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetParent(IDXGISwapChain3 *ifac e, REFIID iid, void **parent) static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetParent(IDXGISwapChain4 *ifac e, REFIID iid, void **parent)
{ {
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(ifa ce); struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(ifa ce);
TRACE("iface %p, iid %s, parent %p.\n", iface, debugstr_guid(iid), parent); TRACE("iface %p, iid %s, parent %p.\n", iface, debugstr_guid(iid), parent);
return IWineDXGIFactory_QueryInterface(swapchain->factory, iid, parent); return IWineDXGIFactory_QueryInterface(swapchain->factory, iid, parent);
} }
/* IDXGIDeviceSubObject methods */ /* IDXGIDeviceSubObject methods */
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetDevice(IDXGISwapChain3 *ifac e, REFIID iid, void **device) static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetDevice(IDXGISwapChain4 *ifac e, REFIID iid, void **device)
{ {
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(ifa ce); struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(ifa ce);
TRACE("iface %p, iid %s, device %p.\n", iface, debugstr_guid(iid), device); TRACE("iface %p, iid %s, device %p.\n", iface, debugstr_guid(iid), device);
return ID3D12Device_QueryInterface(swapchain->device, iid, device); return ID3D12Device_QueryInterface(swapchain->device, iid, device);
} }
/* IDXGISwapChain methods */ /* IDXGISwapChain methods */
static HRESULT d3d12_swapchain_set_sync_interval(struct d3d12_swapchain *swapcha in, static HRESULT d3d12_swapchain_set_sync_interval(struct d3d12_swapchain *swapcha in,
unsigned int sync_interval) unsigned int sync_interval)
skipping to change at line 2186 skipping to change at line 2187
TRACE("Recreating Vulkan swapchain.\n"); TRACE("Recreating Vulkan swapchain.\n");
d3d12_swapchain_destroy_buffers(swapchain, FALSE); d3d12_swapchain_destroy_buffers(swapchain, FALSE);
return d3d12_swapchain_recreate_vulkan_swapchain(swapchain); return d3d12_swapchain_recreate_vulkan_swapchain(swapchain);
} }
if (vr < 0) if (vr < 0)
ERR("Failed to acquire next Vulkan image, vr %d.\n", vr); ERR("Failed to acquire next Vulkan image, vr %d.\n", vr);
return hresult_from_vk_result(vr); return hresult_from_vk_result(vr);
} }
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_Present(IDXGISwapChain3 *iface, UINT sync_interval, UINT flags) static HRESULT STDMETHODCALLTYPE d3d12_swapchain_Present(IDXGISwapChain4 *iface, UINT sync_interval, UINT flags)
{ {
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(ifa ce); struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(ifa ce);
TRACE("iface %p, sync_interval %u, flags %#x.\n", iface, sync_interval, flag s); TRACE("iface %p, sync_interval %u, flags %#x.\n", iface, sync_interval, flag s);
return d3d12_swapchain_present(swapchain, sync_interval, flags); return d3d12_swapchain_present(swapchain, sync_interval, flags);
} }
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetBuffer(IDXGISwapChain3 *ifac e, static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetBuffer(IDXGISwapChain4 *ifac e,
UINT buffer_idx, REFIID iid, void **surface) UINT buffer_idx, REFIID iid, void **surface)
{ {
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(ifa ce); struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(ifa ce);
TRACE("iface %p, buffer_idx %u, iid %s, surface %p.\n", TRACE("iface %p, buffer_idx %u, iid %s, surface %p.\n",
iface, buffer_idx, debugstr_guid(iid), surface); iface, buffer_idx, debugstr_guid(iid), surface);
if (buffer_idx >= swapchain->desc.BufferCount) if (buffer_idx >= swapchain->desc.BufferCount)
{ {
WARN("Invalid buffer index %u.\n", buffer_idx); WARN("Invalid buffer index %u.\n", buffer_idx);
return DXGI_ERROR_INVALID_CALL; return DXGI_ERROR_INVALID_CALL;
} }
assert(swapchain->buffers[buffer_idx]); assert(swapchain->buffers[buffer_idx]);
return ID3D12Resource_QueryInterface(swapchain->buffers[buffer_idx], iid, su rface); return ID3D12Resource_QueryInterface(swapchain->buffers[buffer_idx], iid, su rface);
} }
static HRESULT STDMETHODCALLTYPE DECLSPEC_HOTPATCH d3d12_swapchain_SetFullscreen State(IDXGISwapChain3 *iface, static HRESULT STDMETHODCALLTYPE DECLSPEC_HOTPATCH d3d12_swapchain_SetFullscreen State(IDXGISwapChain4 *iface,
BOOL fullscreen, IDXGIOutput *target) BOOL fullscreen, IDXGIOutput *target)
{ {
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(ifa ce); struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(ifa ce);
DXGI_SWAP_CHAIN_FULLSCREEN_DESC *fullscreen_desc = &swapchain->fullscreen_de sc; DXGI_SWAP_CHAIN_FULLSCREEN_DESC *fullscreen_desc = &swapchain->fullscreen_de sc;
const DXGI_SWAP_CHAIN_DESC1 *swapchain_desc = &swapchain->desc; const DXGI_SWAP_CHAIN_DESC1 *swapchain_desc = &swapchain->desc;
struct wined3d_swapchain_desc wined3d_desc; struct wined3d_swapchain_desc wined3d_desc;
HWND window = swapchain->window; HWND window = swapchain->window;
HRESULT hr; HRESULT hr;
TRACE("iface %p, fullscreen %#x, target %p.\n", iface, fullscreen, target); TRACE("iface %p, fullscreen %#x, target %p.\n", iface, fullscreen, target);
if (!fullscreen && target) if (!fullscreen && target)
{ {
WARN("Invalid call.\n"); WARN("Invalid call.\n");
return DXGI_ERROR_INVALID_CALL; return DXGI_ERROR_INVALID_CALL;
} }
if (target) if (target)
{ {
IDXGIOutput_AddRef(target); IDXGIOutput_AddRef(target);
} }
else if (FAILED(hr = IDXGISwapChain3_GetContainingOutput(iface, &target))) else if (FAILED(hr = IDXGISwapChain4_GetContainingOutput(iface, &target)))
{ {
WARN("Failed to get target output for swapchain, hr %#x.\n", hr); WARN("Failed to get target output for swapchain, hr %#x.\n", hr);
return hr; return hr;
} }
if (FAILED(hr = wined3d_swapchain_desc_from_dxgi(&wined3d_desc, target, wind ow, swapchain_desc, if (FAILED(hr = wined3d_swapchain_desc_from_dxgi(&wined3d_desc, target, wind ow, swapchain_desc,
fullscreen_desc))) fullscreen_desc)))
goto fail; goto fail;
wined3d_mutex_lock(); wined3d_mutex_lock();
wined3d_desc.windowed = !fullscreen; wined3d_desc.windowed = !fullscreen;
skipping to change at line 2270 skipping to change at line 2271
swapchain->target = target; swapchain->target = target;
return S_OK; return S_OK;
fail: fail:
IDXGIOutput_Release(target); IDXGIOutput_Release(target);
return DXGI_ERROR_NOT_CURRENTLY_AVAILABLE; return DXGI_ERROR_NOT_CURRENTLY_AVAILABLE;
} }
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetFullscreenState(IDXGISwapCha in3 *iface, static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetFullscreenState(IDXGISwapCha in4 *iface,
BOOL *fullscreen, IDXGIOutput **target) BOOL *fullscreen, IDXGIOutput **target)
{ {
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(ifa ce); struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(ifa ce);
TRACE("iface %p, fullscreen %p, target %p.\n", iface, fullscreen, target); TRACE("iface %p, fullscreen %p, target %p.\n", iface, fullscreen, target);
if (fullscreen) if (fullscreen)
*fullscreen = !swapchain->fullscreen_desc.Windowed; *fullscreen = !swapchain->fullscreen_desc.Windowed;
if (target && (*target = swapchain->target)) if (target && (*target = swapchain->target))
IDXGIOutput_AddRef(*target); IDXGIOutput_AddRef(*target);
return S_OK; return S_OK;
} }
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetDesc(IDXGISwapChain3 *iface, DXGI_SWAP_CHAIN_DESC *desc) static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetDesc(IDXGISwapChain4 *iface, DXGI_SWAP_CHAIN_DESC *desc)
{ {
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(ifa ce); struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(ifa ce);
const DXGI_SWAP_CHAIN_FULLSCREEN_DESC *fullscreen_desc = &swapchain->fullscr een_desc; const DXGI_SWAP_CHAIN_FULLSCREEN_DESC *fullscreen_desc = &swapchain->fullscr een_desc;
const DXGI_SWAP_CHAIN_DESC1 *swapchain_desc = &swapchain->desc; const DXGI_SWAP_CHAIN_DESC1 *swapchain_desc = &swapchain->desc;
TRACE("iface %p, desc %p.\n", iface, desc); TRACE("iface %p, desc %p.\n", iface, desc);
if (!desc) if (!desc)
{ {
WARN("Invalid pointer.\n"); WARN("Invalid pointer.\n");
return E_INVALIDARG; return E_INVALIDARG;
} }
skipping to change at line 2375 skipping to change at line 2376
if (desc->Width == new_desc.Width && desc->Height == new_desc.Height if (desc->Width == new_desc.Width && desc->Height == new_desc.Height
&& desc->Format == new_desc.Format && desc->BufferCount == new_desc. BufferCount) && desc->Format == new_desc.Format && desc->BufferCount == new_desc. BufferCount)
return S_OK; return S_OK;
d3d12_swapchain_destroy_buffers(swapchain, TRUE); d3d12_swapchain_destroy_buffers(swapchain, TRUE);
swapchain->desc = new_desc; swapchain->desc = new_desc;
return d3d12_swapchain_recreate_vulkan_swapchain(swapchain); return d3d12_swapchain_recreate_vulkan_swapchain(swapchain);
} }
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_ResizeBuffers(IDXGISwapChain3 * iface, static HRESULT STDMETHODCALLTYPE d3d12_swapchain_ResizeBuffers(IDXGISwapChain4 * iface,
UINT buffer_count, UINT width, UINT height, DXGI_FORMAT format, UINT fla gs) UINT buffer_count, UINT width, UINT height, DXGI_FORMAT format, UINT fla gs)
{ {
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(ifa ce); struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(ifa ce);
TRACE("iface %p, buffer_count %u, width %u, height %u, format %s, flags %#x. \n", TRACE("iface %p, buffer_count %u, width %u, height %u, format %s, flags %#x. \n",
iface, buffer_count, width, height, debug_dxgi_format(format), flags ); iface, buffer_count, width, height, debug_dxgi_format(format), flags );
return d3d12_swapchain_resize_buffers(swapchain, buffer_count, width, height , format, flags); return d3d12_swapchain_resize_buffers(swapchain, buffer_count, width, height , format, flags);
} }
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_ResizeTarget(IDXGISwapChain3 *i face, static HRESULT STDMETHODCALLTYPE d3d12_swapchain_ResizeTarget(IDXGISwapChain4 *i face,
const DXGI_MODE_DESC *target_mode_desc) const DXGI_MODE_DESC *target_mode_desc)
{ {
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(ifa ce); struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(ifa ce);
TRACE("iface %p, target_mode_desc %p.\n", iface, target_mode_desc); TRACE("iface %p, target_mode_desc %p.\n", iface, target_mode_desc);
return dxgi_swapchain_resize_target(swapchain->state, target_mode_desc); return dxgi_swapchain_resize_target(swapchain->state, target_mode_desc);
} }
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetContainingOutput(IDXGISwapCh ain3 *iface, static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetContainingOutput(IDXGISwapCh ain4 *iface,
IDXGIOutput **output) IDXGIOutput **output)
{ {
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(ifa ce); struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(ifa ce);
IUnknown *device_parent; IUnknown *device_parent;
IDXGIFactory *factory; IDXGIFactory *factory;
IDXGIAdapter *adapter; IDXGIAdapter *adapter;
HRESULT hr; HRESULT hr;
TRACE("iface %p, output %p.\n", iface, output); TRACE("iface %p, output %p.\n", iface, output);
if (swapchain->target) if (swapchain->target)
{ {
IDXGIOutput_AddRef(*output = swapchain->target); IDXGIOutput_AddRef(*output = swapchain->target);
skipping to change at line 2434 skipping to change at line 2435
IDXGIAdapter_Release(adapter); IDXGIAdapter_Release(adapter);
return hr; return hr;
} }
hr = dxgi_get_output_from_window(factory, swapchain->window, output); hr = dxgi_get_output_from_window(factory, swapchain->window, output);
IDXGIFactory_Release(factory); IDXGIFactory_Release(factory);
IDXGIAdapter_Release(adapter); IDXGIAdapter_Release(adapter);
return hr; return hr;
} }
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetFrameStatistics(IDXGISwapCha in3 *iface, static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetFrameStatistics(IDXGISwapCha in4 *iface,
DXGI_FRAME_STATISTICS *stats) DXGI_FRAME_STATISTICS *stats)
{ {
FIXME("iface %p, stats %p stub!\n", iface, stats); FIXME("iface %p, stats %p stub!\n", iface, stats);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetLastPresentCount(IDXGISwapCh ain3 *iface, static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetLastPresentCount(IDXGISwapCh ain4 *iface,
UINT *last_present_count) UINT *last_present_count)
{ {
FIXME("iface %p, last_present_count %p stub!\n", iface, last_present_count); FIXME("iface %p, last_present_count %p stub!\n", iface, last_present_count);
return E_NOTIMPL; return E_NOTIMPL;
} }
/* IDXGISwapChain1 methods */ /* IDXGISwapChain1 methods */
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetDesc1(IDXGISwapChain3 *iface , DXGI_SWAP_CHAIN_DESC1 *desc) static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetDesc1(IDXGISwapChain4 *iface , DXGI_SWAP_CHAIN_DESC1 *desc)
{ {
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(ifa ce); struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(ifa ce);
TRACE("iface %p, desc %p.\n", iface, desc); TRACE("iface %p, desc %p.\n", iface, desc);
if (!desc) if (!desc)
{ {
WARN("Invalid pointer.\n"); WARN("Invalid pointer.\n");
return E_INVALIDARG; return E_INVALIDARG;
} }
*desc = swapchain->desc; *desc = swapchain->desc;
return S_OK; return S_OK;
} }
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetFullscreenDesc(IDXGISwapChai n3 *iface, static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetFullscreenDesc(IDXGISwapChai n4 *iface,
DXGI_SWAP_CHAIN_FULLSCREEN_DESC *desc) DXGI_SWAP_CHAIN_FULLSCREEN_DESC *desc)
{ {
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(ifa ce); struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(ifa ce);
TRACE("iface %p, desc %p.\n", iface, desc); TRACE("iface %p, desc %p.\n", iface, desc);
if (!desc) if (!desc)
{ {
WARN("Invalid pointer.\n"); WARN("Invalid pointer.\n");
return E_INVALIDARG; return E_INVALIDARG;
} }
*desc = swapchain->fullscreen_desc; *desc = swapchain->fullscreen_desc;
return S_OK; return S_OK;
} }
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetHwnd(IDXGISwapChain3 *iface, HWND *hwnd) static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetHwnd(IDXGISwapChain4 *iface, HWND *hwnd)
{ {
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(ifa ce); struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(ifa ce);
TRACE("iface %p, hwnd %p.\n", iface, hwnd); TRACE("iface %p, hwnd %p.\n", iface, hwnd);
if (!hwnd) if (!hwnd)
{ {
WARN("Invalid pointer.\n"); WARN("Invalid pointer.\n");
return DXGI_ERROR_INVALID_CALL; return DXGI_ERROR_INVALID_CALL;
} }
*hwnd = swapchain->window; *hwnd = swapchain->window;
return S_OK; return S_OK;
} }
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetCoreWindow(IDXGISwapChain3 * iface, static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetCoreWindow(IDXGISwapChain4 * iface,
REFIID iid, void **core_window) REFIID iid, void **core_window)
{ {
FIXME("iface %p, iid %s, core_window %p stub!\n", iface, debugstr_guid(iid), core_window); FIXME("iface %p, iid %s, core_window %p stub!\n", iface, debugstr_guid(iid), core_window);
if (core_window) if (core_window)
*core_window = NULL; *core_window = NULL;
return DXGI_ERROR_INVALID_CALL; return DXGI_ERROR_INVALID_CALL;
} }
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_Present1(IDXGISwapChain3 *iface , static HRESULT STDMETHODCALLTYPE d3d12_swapchain_Present1(IDXGISwapChain4 *iface ,
UINT sync_interval, UINT flags, const DXGI_PRESENT_PARAMETERS *present_p arameters) UINT sync_interval, UINT flags, const DXGI_PRESENT_PARAMETERS *present_p arameters)
{ {
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(ifa ce); struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(ifa ce);
TRACE("iface %p, sync_interval %u, flags %#x, present_parameters %p.\n", TRACE("iface %p, sync_interval %u, flags %#x, present_parameters %p.\n",
iface, sync_interval, flags, present_parameters); iface, sync_interval, flags, present_parameters);
if (present_parameters) if (present_parameters)
FIXME("Ignored present parameters %p.\n", present_parameters); FIXME("Ignored present parameters %p.\n", present_parameters);
return d3d12_swapchain_present(swapchain, sync_interval, flags); return d3d12_swapchain_present(swapchain, sync_interval, flags);
} }
static BOOL STDMETHODCALLTYPE d3d12_swapchain_IsTemporaryMonoSupported(IDXGISwap Chain3 *iface) static BOOL STDMETHODCALLTYPE d3d12_swapchain_IsTemporaryMonoSupported(IDXGISwap Chain4 *iface)
{ {
FIXME("iface %p stub!\n", iface); FIXME("iface %p stub!\n", iface);
return FALSE; return FALSE;
} }
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetRestrictToOutput(IDXGISwapCh ain3 *iface, IDXGIOutput **output) static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetRestrictToOutput(IDXGISwapCh ain4 *iface, IDXGIOutput **output)
{ {
FIXME("iface %p, output %p stub!\n", iface, output); FIXME("iface %p, output %p stub!\n", iface, output);
if (!output) if (!output)
{ {
WARN("Invalid pointer.\n"); WARN("Invalid pointer.\n");
return E_INVALIDARG; return E_INVALIDARG;
} }
*output = NULL; *output = NULL;
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetBackgroundColor(IDXGISwapCha in3 *iface, const DXGI_RGBA *color) static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetBackgroundColor(IDXGISwapCha in4 *iface, const DXGI_RGBA *color)
{ {
FIXME("iface %p, color %p stub!\n", iface, color); FIXME("iface %p, color %p stub!\n", iface, color);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetBackgroundColor(IDXGISwapCha in3 *iface, DXGI_RGBA *color) static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetBackgroundColor(IDXGISwapCha in4 *iface, DXGI_RGBA *color)
{ {
FIXME("iface %p, color %p stub!\n", iface, color); FIXME("iface %p, color %p stub!\n", iface, color);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetRotation(IDXGISwapChain3 *if ace, DXGI_MODE_ROTATION rotation) static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetRotation(IDXGISwapChain4 *if ace, DXGI_MODE_ROTATION rotation)
{ {
FIXME("iface %p, rotation %#x stub!\n", iface, rotation); FIXME("iface %p, rotation %#x stub!\n", iface, rotation);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetRotation(IDXGISwapChain3 *if ace, DXGI_MODE_ROTATION *rotation) static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetRotation(IDXGISwapChain4 *if ace, DXGI_MODE_ROTATION *rotation)
{ {
FIXME("iface %p, rotation %p stub!\n", iface, rotation); FIXME("iface %p, rotation %p stub!\n", iface, rotation);
return E_NOTIMPL; return E_NOTIMPL;
} }
/* IDXGISwapChain2 methods */ /* IDXGISwapChain2 methods */
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetSourceSize(IDXGISwapChain3 * iface, UINT width, UINT height) static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetSourceSize(IDXGISwapChain4 * iface, UINT width, UINT height)
{ {
FIXME("iface %p, width %u, height %u stub!\n", iface, width, height); FIXME("iface %p, width %u, height %u stub!\n", iface, width, height);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetSourceSize(IDXGISwapChain3 * iface, UINT *width, UINT *height) static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetSourceSize(IDXGISwapChain4 * iface, UINT *width, UINT *height)
{ {
FIXME("iface %p, width %p, height %p stub!\n", iface, width, height); FIXME("iface %p, width %p, height %p stub!\n", iface, width, height);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetMaximumFrameLatency(IDXGISwa pChain3 *iface, UINT max_latency) static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetMaximumFrameLatency(IDXGISwa pChain4 *iface, UINT max_latency)
{ {
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(ifa ce); struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(ifa ce);
TRACE("iface %p, max_latency %u.\n", iface, max_latency); TRACE("iface %p, max_latency %u.\n", iface, max_latency);
if (!(swapchain->desc.Flags & DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OB JECT)) if (!(swapchain->desc.Flags & DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OB JECT))
{ {
WARN("DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT not set for swa p chain %p.\n", iface); WARN("DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT not set for swa p chain %p.\n", iface);
return DXGI_ERROR_INVALID_CALL; return DXGI_ERROR_INVALID_CALL;
} }
if (!max_latency) if (!max_latency)
{ {
WARN("Invalid maximum frame latency %u.\n", max_latency); WARN("Invalid maximum frame latency %u.\n", max_latency);
return DXGI_ERROR_INVALID_CALL; return DXGI_ERROR_INVALID_CALL;
} }
swapchain->frame_latency = max_latency; swapchain->frame_latency = max_latency;
return S_OK; return S_OK;
} }
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetMaximumFrameLatency(IDXGISwa pChain3 *iface, UINT *max_latency) static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetMaximumFrameLatency(IDXGISwa pChain4 *iface, UINT *max_latency)
{ {
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(ifa ce); struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(ifa ce);
TRACE("iface %p, max_latency %p.\n", iface, max_latency); TRACE("iface %p, max_latency %p.\n", iface, max_latency);
if (!(swapchain->desc.Flags & DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OB JECT)) if (!(swapchain->desc.Flags & DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OB JECT))
{ {
WARN("DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT not set for swa p chain %p.\n", iface); WARN("DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT not set for swa p chain %p.\n", iface);
return DXGI_ERROR_INVALID_CALL; return DXGI_ERROR_INVALID_CALL;
} }
*max_latency = swapchain->frame_latency; *max_latency = swapchain->frame_latency;
return S_OK; return S_OK;
} }
static HANDLE STDMETHODCALLTYPE d3d12_swapchain_GetFrameLatencyWaitableObject(ID XGISwapChain3 *iface) static HANDLE STDMETHODCALLTYPE d3d12_swapchain_GetFrameLatencyWaitableObject(ID XGISwapChain4 *iface)
{ {
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(ifa ce); struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(ifa ce);
TRACE("iface %p.\n", iface); TRACE("iface %p.\n", iface);
return swapchain->frame_latency_event; return swapchain->frame_latency_event;
} }
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetMatrixTransform(IDXGISwapCha in3 *iface, static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetMatrixTransform(IDXGISwapCha in4 *iface,
const DXGI_MATRIX_3X2_F *matrix) const DXGI_MATRIX_3X2_F *matrix)
{ {
FIXME("iface %p, matrix %p stub!\n", iface, matrix); FIXME("iface %p, matrix %p stub!\n", iface, matrix);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetMatrixTransform(IDXGISwapCha in3 *iface, static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetMatrixTransform(IDXGISwapCha in4 *iface,
DXGI_MATRIX_3X2_F *matrix) DXGI_MATRIX_3X2_F *matrix)
{ {
FIXME("iface %p, matrix %p stub!\n", iface, matrix); FIXME("iface %p, matrix %p stub!\n", iface, matrix);
return E_NOTIMPL; return E_NOTIMPL;
} }
/* IDXGISwapChain3 methods */ /* IDXGISwapChain3 methods */
static UINT STDMETHODCALLTYPE d3d12_swapchain_GetCurrentBackBufferIndex(IDXGISwa pChain3 *iface) static UINT STDMETHODCALLTYPE d3d12_swapchain_GetCurrentBackBufferIndex(IDXGISwa pChain4 *iface)
{ {
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(ifa ce); struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(ifa ce);
TRACE("iface %p.\n", iface); TRACE("iface %p.\n", iface);
TRACE("Current back buffer index %u.\n", swapchain->current_buffer_index); TRACE("Current back buffer index %u.\n", swapchain->current_buffer_index);
assert(swapchain->current_buffer_index < swapchain->desc.BufferCount); assert(swapchain->current_buffer_index < swapchain->desc.BufferCount);
return swapchain->current_buffer_index; return swapchain->current_buffer_index;
} }
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_CheckColorSpaceSupport(IDXGISwa pChain3 *iface, static HRESULT STDMETHODCALLTYPE d3d12_swapchain_CheckColorSpaceSupport(IDXGISwa pChain4 *iface,
DXGI_COLOR_SPACE_TYPE colour_space, UINT *colour_space_support) DXGI_COLOR_SPACE_TYPE colour_space, UINT *colour_space_support)
{ {
UINT support_flags = 0; UINT support_flags = 0;
FIXME("iface %p, colour_space %#x, colour_space_support %p semi-stub!\n", FIXME("iface %p, colour_space %#x, colour_space_support %p semi-stub!\n",
iface, colour_space, colour_space_support); iface, colour_space, colour_space_support);
if (!colour_space_support) if (!colour_space_support)
return E_INVALIDARG; return E_INVALIDARG;
if (colour_space == DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709) if (colour_space == DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709)
support_flags |= DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG_PRESENT; support_flags |= DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG_PRESENT;
*colour_space_support = support_flags; *colour_space_support = support_flags;
return S_OK; return S_OK;
} }
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetColorSpace1(IDXGISwapChain3 *iface, static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetColorSpace1(IDXGISwapChain4 *iface,
DXGI_COLOR_SPACE_TYPE colour_space) DXGI_COLOR_SPACE_TYPE colour_space)
{ {
FIXME("iface %p, colour_space %#x semi-stub!\n", iface, colour_space); FIXME("iface %p, colour_space %#x semi-stub!\n", iface, colour_space);
if (colour_space != DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709) if (colour_space != DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709)
{ {
WARN("Colour space %u not supported.\n", colour_space); WARN("Colour space %u not supported.\n", colour_space);
return E_INVALIDARG; return E_INVALIDARG;
} }
return S_OK; return S_OK;
} }
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_ResizeBuffers1(IDXGISwapChain3 *iface, static HRESULT STDMETHODCALLTYPE d3d12_swapchain_ResizeBuffers1(IDXGISwapChain4 *iface,
UINT buffer_count, UINT width, UINT height, DXGI_FORMAT format, UINT fla gs, UINT buffer_count, UINT width, UINT height, DXGI_FORMAT format, UINT fla gs,
const UINT *node_mask, IUnknown * const *present_queue) const UINT *node_mask, IUnknown * const *present_queue)
{ {
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(ifa ce); struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(ifa ce);
size_t i, count; size_t i, count;
TRACE("iface %p, buffer_count %u, width %u, height %u, format %s, flags %#x, " TRACE("iface %p, buffer_count %u, width %u, height %u, format %s, flags %#x, "
"node_mask %p, present_queue %p.\n", "node_mask %p, present_queue %p.\n",
iface, buffer_count, width, height, debug_dxgi_format(format), flags , node_mask, present_queue); iface, buffer_count, width, height, debug_dxgi_format(format), flags , node_mask, present_queue);
if (!node_mask || !present_queue) if (!node_mask || !present_queue)
return DXGI_ERROR_INVALID_CALL; return DXGI_ERROR_INVALID_CALL;
count = buffer_count ? buffer_count : swapchain->desc.BufferCount; count = buffer_count ? buffer_count : swapchain->desc.BufferCount;
skipping to change at line 2725 skipping to change at line 2726
{ {
if (node_mask[i] > 1 || !present_queue[i]) if (node_mask[i] > 1 || !present_queue[i])
return DXGI_ERROR_INVALID_CALL; return DXGI_ERROR_INVALID_CALL;
if ((ID3D12CommandQueue*)present_queue[i] != swapchain->command_queue) if ((ID3D12CommandQueue*)present_queue[i] != swapchain->command_queue)
FIXME("Ignoring present queue %p.\n", present_queue[i]); FIXME("Ignoring present queue %p.\n", present_queue[i]);
} }
return d3d12_swapchain_resize_buffers(swapchain, buffer_count, width, height , format, flags); return d3d12_swapchain_resize_buffers(swapchain, buffer_count, width, height , format, flags);
} }
static const struct IDXGISwapChain3Vtbl d3d12_swapchain_vtbl = /* IDXGISwapChain4 methods */
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetHDRMetaData(IDXGISwapChain4
*iface,
DXGI_HDR_METADATA_TYPE type, UINT size, void *metadata)
{
FIXME("iface %p, type %#x, size %#x, metadata %p stub!\n", iface, type, size
, metadata);
return E_NOTIMPL;
}
static const struct IDXGISwapChain4Vtbl d3d12_swapchain_vtbl =
{ {
/* IUnknown methods */ /* IUnknown methods */
d3d12_swapchain_QueryInterface, d3d12_swapchain_QueryInterface,
d3d12_swapchain_AddRef, d3d12_swapchain_AddRef,
d3d12_swapchain_Release, d3d12_swapchain_Release,
/* IDXGIObject methods */ /* IDXGIObject methods */
d3d12_swapchain_SetPrivateData, d3d12_swapchain_SetPrivateData,
d3d12_swapchain_SetPrivateDataInterface, d3d12_swapchain_SetPrivateDataInterface,
d3d12_swapchain_GetPrivateData, d3d12_swapchain_GetPrivateData,
d3d12_swapchain_GetParent, d3d12_swapchain_GetParent,
skipping to change at line 2774 skipping to change at line 2785
d3d12_swapchain_SetMaximumFrameLatency, d3d12_swapchain_SetMaximumFrameLatency,
d3d12_swapchain_GetMaximumFrameLatency, d3d12_swapchain_GetMaximumFrameLatency,
d3d12_swapchain_GetFrameLatencyWaitableObject, d3d12_swapchain_GetFrameLatencyWaitableObject,
d3d12_swapchain_SetMatrixTransform, d3d12_swapchain_SetMatrixTransform,
d3d12_swapchain_GetMatrixTransform, d3d12_swapchain_GetMatrixTransform,
/* IDXGISwapChain3 methods */ /* IDXGISwapChain3 methods */
d3d12_swapchain_GetCurrentBackBufferIndex, d3d12_swapchain_GetCurrentBackBufferIndex,
d3d12_swapchain_CheckColorSpaceSupport, d3d12_swapchain_CheckColorSpaceSupport,
d3d12_swapchain_SetColorSpace1, d3d12_swapchain_SetColorSpace1,
d3d12_swapchain_ResizeBuffers1, d3d12_swapchain_ResizeBuffers1,
/* IDXGISwapChain4 methods */
d3d12_swapchain_SetHDRMetaData,
}; };
static BOOL load_vkd3d_functions(void *vkd3d_handle) static BOOL load_vkd3d_functions(void *vkd3d_handle)
{ {
#define LOAD_FUNCPTR(f) if (!(f = get_library_proc(vkd3d_handle, #f))) return FA LSE; #define LOAD_FUNCPTR(f) if (!(f = get_library_proc(vkd3d_handle, #f))) return FA LSE;
LOAD_FUNCPTR(vkd3d_acquire_vk_queue) LOAD_FUNCPTR(vkd3d_acquire_vk_queue)
LOAD_FUNCPTR(vkd3d_create_image_resource) LOAD_FUNCPTR(vkd3d_create_image_resource)
LOAD_FUNCPTR(vkd3d_get_device_parent) LOAD_FUNCPTR(vkd3d_get_device_parent)
LOAD_FUNCPTR(vkd3d_get_vk_device) LOAD_FUNCPTR(vkd3d_get_vk_device)
LOAD_FUNCPTR(vkd3d_get_vk_format) LOAD_FUNCPTR(vkd3d_get_vk_format)
skipping to change at line 2921 skipping to change at line 2934
VkFence vk_fence; VkFence vk_fence;
VkResult vr; VkResult vr;
HRESULT hr; HRESULT hr;
if (window == GetDesktopWindow()) if (window == GetDesktopWindow())
{ {
WARN("D3D12 swapchain cannot be created on desktop window.\n"); WARN("D3D12 swapchain cannot be created on desktop window.\n");
return E_ACCESSDENIED; return E_ACCESSDENIED;
} }
swapchain->IDXGISwapChain3_iface.lpVtbl = &d3d12_swapchain_vtbl; swapchain->IDXGISwapChain4_iface.lpVtbl = &d3d12_swapchain_vtbl;
swapchain->refcount = 1; swapchain->refcount = 1;
swapchain->window = window; swapchain->window = window;
swapchain->desc = *swapchain_desc; swapchain->desc = *swapchain_desc;
swapchain->fullscreen_desc = *fullscreen_desc; swapchain->fullscreen_desc = *fullscreen_desc;
swapchain->present_mode = VK_PRESENT_MODE_FIFO_KHR; swapchain->present_mode = VK_PRESENT_MODE_FIFO_KHR;
switch (swapchain_desc->SwapEffect) switch (swapchain_desc->SwapEffect)
{ {
skipping to change at line 3126 skipping to change at line 3139
hr = d3d12_swapchain_init(object, factory, device, queue, window, swapchain_ desc, fullscreen_desc); hr = d3d12_swapchain_init(object, factory, device, queue, window, swapchain_ desc, fullscreen_desc);
ID3D12Device_Release(device); ID3D12Device_Release(device);
if (FAILED(hr)) if (FAILED(hr))
{ {
heap_free(object); heap_free(object);
return hr; return hr;
} }
TRACE("Created swapchain %p.\n", object); TRACE("Created swapchain %p.\n", object);
*swapchain = (IDXGISwapChain1 *)&object->IDXGISwapChain3_iface; *swapchain = (IDXGISwapChain1 *)&object->IDXGISwapChain4_iface;
return S_OK; return S_OK;
} }
#else #else
HRESULT d3d12_swapchain_create(IWineDXGIFactory *factory, ID3D12CommandQueue *qu eue, HWND window, HRESULT d3d12_swapchain_create(IWineDXGIFactory *factory, ID3D12CommandQueue *qu eue, HWND window,
const DXGI_SWAP_CHAIN_DESC1 *swapchain_desc, const DXGI_SWAP_CHAIN_FULLS CREEN_DESC *fullscreen_desc, const DXGI_SWAP_CHAIN_DESC1 *swapchain_desc, const DXGI_SWAP_CHAIN_FULLS CREEN_DESC *fullscreen_desc,
IDXGISwapChain1 **swapchain) IDXGISwapChain1 **swapchain)
{ {
 End of changes. 73 change blocks. 
72 lines changed or deleted 87 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)