ReactOS 0.4.17-dev-934-g091855f
dxgi_private.h File Reference
#include "wine/debug.h"
#include <assert.h>
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "objbase.h"
#include "winnls.h"
#include "dxgi1_6.h"
#include "d3d10_1.h"
#include "d3d12.h"
#include "wine/wined3d.h"
#include "wine/winedxgi.h"
Include dependency graph for dxgi_private.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  layer_get_size_args
 
struct  dxgi_device_layer
 
struct  dxgi_factory
 
struct  dxgi_device
 
struct  dxgi_output
 
struct  dxgi_adapter
 
struct  d3d11_swapchain
 
struct  dxgi_resource
 

Macros

#define COBJMACROS
 

Enumerations

enum  dxgi_frame_latency { DXGI_FRAME_LATENCY_MAX = 16 }
 
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 , 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
}
 

Functions

const char * debug_dxgi_format (DXGI_FORMAT format)
 
const char * debug_dxgi_mode (const DXGI_MODE_DESC *desc)
 
const char * debug_dxgi_mode1 (const DXGI_MODE_DESC1 *desc)
 
void dump_feature_levels (const D3D_FEATURE_LEVEL *feature_levels, unsigned int level_count)
 
DXGI_FORMAT dxgi_format_from_wined3dformat (enum wined3d_format_id format)
 
enum wined3d_format_id wined3dformat_from_dxgi_format (DXGI_FORMAT format)
 
void dxgi_sample_desc_from_wined3d (DXGI_SAMPLE_DESC *desc, enum wined3d_multisample_type wined3d_type, unsigned int wined3d_quality)
 
void wined3d_sample_desc_from_dxgi (enum wined3d_multisample_type *wined3d_type, unsigned int *wined3d_quality, const DXGI_SAMPLE_DESC *dxgi_desc)
 
void wined3d_display_mode_from_dxgi (struct wined3d_display_mode *wined3d_mode, const DXGI_MODE_DESC *mode)
 
void wined3d_display_mode_from_dxgi1 (struct wined3d_display_mode *wined3d_mode, const DXGI_MODE_DESC1 *mode)
 
DXGI_USAGE dxgi_usage_from_wined3d_bind_flags (unsigned int wined3d_bind_flags)
 
unsigned int wined3d_bind_flags_from_dxgi_usage (DXGI_USAGE usage)
 
unsigned int dxgi_swapchain_flags_from_wined3d (unsigned int wined3d_flags)
 
HRESULT dxgi_get_output_from_window (IWineDXGIFactory *factory, HWND window, IDXGIOutput **dxgi_output)
 
HRESULT wined3d_swapchain_desc_from_dxgi (struct wined3d_swapchain_desc *wined3d_desc, IDXGIOutput *dxgi_containing_output, HWND window, const DXGI_SWAP_CHAIN_DESC1 *dxgi_desc, const DXGI_SWAP_CHAIN_FULLSCREEN_DESC *dxgi_fullscreen_desc)
 
HRESULT dxgi_get_private_data (struct wined3d_private_store *store, REFGUID guid, UINT *data_size, void *data)
 
HRESULT dxgi_set_private_data (struct wined3d_private_store *store, REFGUID guid, UINT data_size, const void *data)
 
HRESULT dxgi_set_private_data_interface (struct wined3d_private_store *store, REFGUID guid, const IUnknown *object)
 
HRESULT dxgi_factory_create (REFIID riid, void **factory, BOOL extended)
 
HWND dxgi_factory_get_device_window (struct dxgi_factory *factory)
 
struct dxgi_factory * unsafe_impl_from_IDXGIFactory (IDXGIFactory *iface)
 
HRESULT dxgi_device_init (struct dxgi_device *device, struct dxgi_device_layer *layer, IDXGIFactory *factory, IDXGIAdapter *adapter, const D3D_FEATURE_LEVEL *feature_levels, unsigned int level_count)
 
HRESULT dxgi_output_create (struct dxgi_adapter *adapter, unsigned int output_idx, struct dxgi_output **output)
 
struct dxgi_output * unsafe_impl_from_IDXGIOutput (IDXGIOutput *iface)
 
HRESULT dxgi_adapter_create (struct dxgi_factory *factory, UINT ordinal, struct dxgi_adapter **adapter)
 
struct dxgi_adapter * unsafe_impl_from_IDXGIAdapter (IDXGIAdapter *iface)
 
HRESULT d3d11_swapchain_init (struct d3d11_swapchain *swapchain, struct dxgi_device *device, struct wined3d_swapchain_desc *desc)
 
HRESULT d3d12_swapchain_create (IWineDXGIFactory *factory, ID3D12CommandQueue *queue, HWND window, const DXGI_SWAP_CHAIN_DESC1 *swapchain_desc, const DXGI_SWAP_CHAIN_FULLSCREEN_DESC *fullscreen_desc, IDXGISwapChain1 **swapchain)
 
BOOL dxgi_validate_swapchain_desc (const DXGI_SWAP_CHAIN_DESC1 *desc)
 
HRESULT dxgi_resource_init (struct dxgi_resource *resource, IDXGIDevice *device, IUnknown *outer, BOOL needs_surface, struct wined3d_resource *wined3d_resource)
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 26 of file dxgi_private.h.

Enumeration Type Documentation

◆ dxgi_device_layer_id

Enumerator
DXGI_DEVICE_LAYER_DEBUG1 
DXGI_DEVICE_LAYER_THREAD_SAFE 
DXGI_DEVICE_LAYER_DEBUG2 
DXGI_DEVICE_LAYER_SWITCH_TO_REF 
DXGI_DEVICE_LAYER_D3D10_DEVICE 
DXGI_DEVICE_LAYER_DEBUG1 
DXGI_DEVICE_LAYER_THREAD_SAFE 
DXGI_DEVICE_LAYER_DEBUG2 
DXGI_DEVICE_LAYER_SWITCH_TO_REF 
DXGI_DEVICE_LAYER_D3D10_DEVICE 

Definition at line 48 of file dxgi_private.h.

49{
55};
@ DXGI_DEVICE_LAYER_THREAD_SAFE
Definition: dxgi_private.h:51
@ DXGI_DEVICE_LAYER_D3D10_DEVICE
Definition: dxgi_private.h:54
@ DXGI_DEVICE_LAYER_DEBUG1
Definition: dxgi_private.h:50
@ DXGI_DEVICE_LAYER_SWITCH_TO_REF
Definition: dxgi_private.h:53
@ DXGI_DEVICE_LAYER_DEBUG2
Definition: dxgi_private.h:52

◆ dxgi_frame_latency

Enumerator
DXGI_FRAME_LATENCY_MAX 

Definition at line 42 of file dxgi_private.h.

43{
45};
@ DXGI_FRAME_LATENCY_MAX
Definition: dxgi_private.h:44

Function Documentation

◆ d3d11_swapchain_init()

HRESULT d3d11_swapchain_init ( struct d3d11_swapchain *  swapchain,
struct dxgi_device *  device,
struct wined3d_swapchain_desc *  desc 
)

Definition at line 991 of file swapchain.c.

993{
996 HRESULT hr;
997
998 if (desc->backbuffer_format == WINED3DFMT_UNKNOWN)
999 return E_INVALIDARG;
1000
1001 if (FAILED(hr = IWineDXGIAdapter_GetParent(device->adapter,
1002 &IID_IWineDXGIFactory, (void **)&swapchain->factory)))
1003 {
1004 WARN("Failed to get adapter parent, hr %#lx.\n", hr);
1005 return hr;
1006 }
1007 IWineDXGIDevice_AddRef(swapchain->device = &device->IWineDXGIDevice_iface);
1008
1009 swapchain->IDXGISwapChain4_iface.lpVtbl = &d3d11_swapchain_vtbl;
1011 swapchain->refcount = 1;
1014
1015 if (!desc->windowed && (!desc->backbuffer_width || !desc->backbuffer_height))
1016 FIXME("Fullscreen swapchain with back buffer width/height equal to 0 not supported properly.\n");
1017
1018 fullscreen = !desc->windowed;
1019 desc->windowed = TRUE;
1020 if (FAILED(hr = wined3d_swapchain_create(device->wined3d_device, desc, &swapchain->state_parent,
1021 swapchain, &d3d11_swapchain_wined3d_parent_ops, &swapchain->wined3d_swapchain)))
1022 {
1023 WARN("Failed to create wined3d swapchain, hr %#lx.\n", hr);
1025 hr = E_INVALIDARG;
1026 goto cleanup;
1027 }
1028
1030 wined3d_swapchain_state_get_size(state, &desc->backbuffer_width, &desc->backbuffer_height);
1031
1032 if (FAILED(hr = d3d11_swapchain_create_d3d11_textures(swapchain, &device->IWineDXGIDevice_iface, desc)))
1033 {
1034 ERR("Failed to create d3d11 textures, hr %#lx.\n", hr);
1035 goto cleanup;
1036 }
1037
1038 swapchain->target = NULL;
1039 if (fullscreen)
1040 {
1041 desc->windowed = FALSE;
1042
1043 if (FAILED(hr = IDXGISwapChain4_GetContainingOutput(&swapchain->IDXGISwapChain4_iface,
1044 &swapchain->target)))
1045 {
1046 WARN("Failed to get target output for fullscreen swapchain, hr %#lx.\n", hr);
1048 goto cleanup;
1049 }
1050
1052 {
1053 WARN("Failed to set fullscreen state, hr %#lx.\n", hr);
1054 IDXGIOutput_Release(swapchain->target);
1056 goto cleanup;
1057 }
1058
1059 }
1061
1062 return S_OK;
1063
1064cleanup:
1067 IWineDXGIFactory_Release(swapchain->factory);
1068 IWineDXGIDevice_Release(swapchain->device);
1069 return hr;
1070}
BOOL fullscreen
Definition: 3dtext.c:44
static int state
Definition: maze.c:121
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
#define E_INVALIDARG
Definition: ddrawi.h:101
HRESULT hr
Definition: delayimp.cpp:582
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static void cleanup(void)
Definition: main.c:1335
static const struct wined3d_parent_ops d3d11_swapchain_wined3d_parent_ops
Definition: swapchain.c:927
static const struct wined3d_swapchain_state_parent_ops d3d11_swapchain_state_parent_ops
Definition: swapchain.c:951
static HRESULT d3d11_swapchain_create_d3d11_textures(struct d3d11_swapchain *swapchain, IWineDXGIDevice *device, struct wined3d_swapchain_desc *desc)
Definition: swapchain.c:956
static const struct IDXGISwapChain4Vtbl d3d11_swapchain_vtbl
Definition: swapchain.c:866
unsigned int BOOL
Definition: ntddk_ex.h:94
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
D3D11_SHADER_VARIABLE_DESC desc
Definition: reflection.c:1683
IWineDXGIDevice * device
Definition: dxgi_private.h:180
struct wined3d_private_store private_store
Definition: dxgi_private.h:177
struct wined3d_swapchain_state_parent state_parent
Definition: dxgi_private.h:179
IDXGISwapChain4 IDXGISwapChain4_iface
Definition: dxgi_private.h:175
struct wined3d_swapchain * wined3d_swapchain
Definition: dxgi_private.h:178
IDXGIOutput * target
Definition: dxgi_private.h:183
IWineDXGIFactory * factory
Definition: dxgi_private.h:181
Definition: devices.h:37
ULONG CDECL wined3d_swapchain_decref(struct wined3d_swapchain *swapchain)
Definition: swapchain.c:144
HRESULT CDECL wined3d_swapchain_create(struct wined3d_device *device, const struct wined3d_swapchain_desc *desc, struct wined3d_swapchain_state_parent *state_parent, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_swapchain **swapchain)
Definition: swapchain.c:1732
HRESULT CDECL wined3d_swapchain_state_set_fullscreen(struct wined3d_swapchain_state *state, const struct wined3d_swapchain_desc *swapchain_desc, const struct wined3d_display_mode *mode)
Definition: swapchain.c:2344
void CDECL wined3d_swapchain_state_get_size(const struct wined3d_swapchain_state *state, unsigned int *width, unsigned int *height)
Definition: swapchain.c:2458
struct wined3d_swapchain_state *CDECL wined3d_swapchain_get_state(struct wined3d_swapchain *swapchain)
Definition: swapchain.c:311
static void wined3d_private_store_cleanup(struct wined3d_private_store *store)
Definition: wined3d.h:2636
@ WINED3DFMT_UNKNOWN
Definition: wined3d.h:127
static void wined3d_private_store_init(struct wined3d_private_store *store)
Definition: wined3d.h:2607
#define WINED3DERR_INVALIDCALL
Definition: wined3d.h:44
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:544
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:539

Referenced by dxgi_swapchain_factory_create_swapchain().

◆ d3d12_swapchain_create()

HRESULT d3d12_swapchain_create ( IWineDXGIFactory *  factory,
ID3D12CommandQueue *  queue,
HWND  window,
const DXGI_SWAP_CHAIN_DESC1 *  swapchain_desc,
const DXGI_SWAP_CHAIN_FULLSCREEN_DESC *  fullscreen_desc,
IDXGISwapChain1 **  swapchain 
)

Definition at line 3399 of file swapchain.c.

3402{
3403 DXGI_SWAP_CHAIN_FULLSCREEN_DESC default_fullscreen_desc;
3405 struct d3d12_swapchain *object;
3407 HRESULT hr;
3408
3409 if (swapchain_desc->Format == DXGI_FORMAT_UNKNOWN)
3411
3412 queue_desc = ID3D12CommandQueue_GetDesc(queue);
3415
3416 if (!fullscreen_desc)
3417 {
3418 memset(&default_fullscreen_desc, 0, sizeof(default_fullscreen_desc));
3419 default_fullscreen_desc.Windowed = TRUE;
3420 fullscreen_desc = &default_fullscreen_desc;
3421 }
3422
3423 if (!(object = calloc(1, sizeof(*object))))
3424 return E_OUTOFMEMORY;
3425
3426 if (FAILED(hr = ID3D12CommandQueue_GetDevice(queue, &IID_ID3D12Device, (void **)&device)))
3427 {
3428 ERR("Failed to get d3d12 device, hr %#lx.\n", hr);
3429 free(object);
3430 return hr;
3431 }
3432
3433 hr = d3d12_swapchain_init(object, factory, device, queue, window, swapchain_desc, fullscreen_desc);
3434 ID3D12Device_Release(device);
3435 if (FAILED(hr))
3436 {
3437 free(object);
3438 return hr;
3439 }
3440
3441 TRACE("Created swapchain %p.\n", object);
3442
3443 *swapchain = (IDXGISwapChain1 *)&object->IDXGISwapChain4_iface;
3444
3445 return S_OK;
3446}
@ D3D12_COMMAND_LIST_TYPE_DIRECT
Definition: d3d12.idl:2189
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define free
Definition: debug_ros.c:5
static HRESULT d3d12_swapchain_init(struct d3d12_swapchain *swapchain, IWineDXGIFactory *factory, ID3D12Device *device, ID3D12CommandQueue *queue, HWND window, const DXGI_SWAP_CHAIN_DESC1 *swapchain_desc, const DXGI_SWAP_CHAIN_FULLSCREEN_DESC *fullscreen_desc)
Definition: swapchain.c:3176
@ DXGI_FORMAT_UNKNOWN
Definition: dxgiformat.idl:23
static IHTMLWindow2 * window
Definition: events.c:77
#define calloc
Definition: rosglue.h:14
#define memset(x, y, z)
Definition: compat.h:39
#define TRACE(s)
Definition: solgame.cpp:4
DXGI_FORMAT Format
Definition: dxgi1_2.idl:223
ID3D12Device * device
Definition: swapchain.c:1185
DXGI_SWAP_CHAIN_FULLSCREEN_DESC fullscreen_desc
Definition: swapchain.c:1191
Definition: main.c:439
Definition: queue.c:179
#define DXGI_ERROR_INVALID_CALL
Definition: winerror.h:7120

Referenced by dxgi_factory_CreateSwapChainForHwnd().

◆ debug_dxgi_format()

const char * debug_dxgi_format ( DXGI_FORMAT  format)

Definition at line 46 of file utils.c.

47{
48 switch(format)
49 {
153 default:
154 FIXME("Unrecognized DXGI_FORMAT %#x.\n", format);
155 return "unrecognized";
156 }
157}
#define WINE_D3D_TO_STR(x)
Definition: utils.c:24
@ DXGI_FORMAT_R16_UINT
Definition: dxgiformat.idl:80
@ DXGI_FORMAT_B8G8R8A8_UNORM
Definition: dxgiformat.idl:110
@ DXGI_FORMAT_R8_TYPELESS
Definition: dxgiformat.idl:83
@ DXGI_FORMAT_BC3_UNORM_SRGB
Definition: dxgiformat.idl:101
@ DXGI_FORMAT_R8G8_B8G8_UNORM
Definition: dxgiformat.idl:91
@ DXGI_FORMAT_R32G32B32_TYPELESS
Definition: dxgiformat.idl:28
@ DXGI_FORMAT_BC3_TYPELESS
Definition: dxgiformat.idl:99
@ DXGI_FORMAT_R16G16_SNORM
Definition: dxgiformat.idl:60
@ DXGI_FORMAT_D32_FLOAT_S8X24_UINT
Definition: dxgiformat.idl:43
@ DXGI_FORMAT_R32G32B32A32_SINT
Definition: dxgiformat.idl:27
@ DXGI_FORMAT_BC5_UNORM
Definition: dxgiformat.idl:106
@ DXGI_FORMAT_BC1_UNORM
Definition: dxgiformat.idl:94
@ DXGI_FORMAT_R8G8_UINT
Definition: dxgiformat.idl:73
@ DXGI_FORMAT_R32G32B32A32_UINT
Definition: dxgiformat.idl:26
@ DXGI_FORMAT_R16G16B16A16_SNORM
Definition: dxgiformat.idl:36
@ DXGI_FORMAT_R32_FLOAT
Definition: dxgiformat.idl:64
@ DXGI_FORMAT_R16G16B16A16_UNORM
Definition: dxgiformat.idl:34
@ DXGI_FORMAT_R32_SINT
Definition: dxgiformat.idl:66
@ DXGI_FORMAT_R8G8_UNORM
Definition: dxgiformat.idl:72
@ DXGI_FORMAT_R16G16_UNORM
Definition: dxgiformat.idl:58
@ DXGI_FORMAT_BC1_UNORM_SRGB
Definition: dxgiformat.idl:95
@ DXGI_FORMAT_R16G16_SINT
Definition: dxgiformat.idl:61
@ DXGI_FORMAT_R24_UNORM_X8_TYPELESS
Definition: dxgiformat.idl:69
@ DXGI_FORMAT_R8G8B8A8_TYPELESS
Definition: dxgiformat.idl:50
@ DXGI_FORMAT_BC2_TYPELESS
Definition: dxgiformat.idl:96
@ DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS
Definition: dxgiformat.idl:44
@ DXGI_FORMAT_R32G32B32_FLOAT
Definition: dxgiformat.idl:29
@ DXGI_FORMAT_R32G32B32_SINT
Definition: dxgiformat.idl:31
@ DXGI_FORMAT_R32G32B32A32_TYPELESS
Definition: dxgiformat.idl:24
@ DXGI_FORMAT_B8G8R8A8_UNORM_SRGB
Definition: dxgiformat.idl:114
@ DXGI_FORMAT_B8G8R8X8_TYPELESS
Definition: dxgiformat.idl:115
@ DXGI_FORMAT_B8G8R8A8_TYPELESS
Definition: dxgiformat.idl:113
@ DXGI_FORMAT_X24_TYPELESS_G8_UINT
Definition: dxgiformat.idl:70
@ DXGI_FORMAT_R16_SINT
Definition: dxgiformat.idl:82
@ DXGI_FORMAT_R1_UNORM
Definition: dxgiformat.idl:89
@ DXGI_FORMAT_R16G16B16A16_UINT
Definition: dxgiformat.idl:35
@ DXGI_FORMAT_R16_UNORM
Definition: dxgiformat.idl:79
@ DXGI_FORMAT_R8G8B8A8_SINT
Definition: dxgiformat.idl:55
@ DXGI_FORMAT_D24_UNORM_S8_UINT
Definition: dxgiformat.idl:68
@ DXGI_FORMAT_R8G8B8A8_SNORM
Definition: dxgiformat.idl:54
@ DXGI_FORMAT_A8_UNORM
Definition: dxgiformat.idl:88
@ DXGI_FORMAT_R8G8B8A8_UINT
Definition: dxgiformat.idl:53
@ DXGI_FORMAT_R10G10B10A2_TYPELESS
Definition: dxgiformat.idl:46
@ DXGI_FORMAT_R32G32_FLOAT
Definition: dxgiformat.idl:39
@ DXGI_FORMAT_BC6H_UF16
Definition: dxgiformat.idl:118
@ DXGI_FORMAT_BC6H_SF16
Definition: dxgiformat.idl:119
@ DXGI_FORMAT_R10G10B10A2_UNORM
Definition: dxgiformat.idl:47
@ DXGI_FORMAT_R8_SNORM
Definition: dxgiformat.idl:86
@ DXGI_FORMAT_R9G9B9E5_SHAREDEXP
Definition: dxgiformat.idl:90
@ DXGI_FORMAT_R16G16B16A16_TYPELESS
Definition: dxgiformat.idl:32
@ DXGI_FORMAT_R16G16B16A16_FLOAT
Definition: dxgiformat.idl:33
@ DXGI_FORMAT_BC7_TYPELESS
Definition: dxgiformat.idl:120
@ DXGI_FORMAT_R32_TYPELESS
Definition: dxgiformat.idl:62
@ DXGI_FORMAT_R8_UNORM
Definition: dxgiformat.idl:84
@ DXGI_FORMAT_R32G32_UINT
Definition: dxgiformat.idl:40
@ DXGI_FORMAT_R11G11B10_FLOAT
Definition: dxgiformat.idl:49
@ DXGI_FORMAT_R8G8B8A8_UNORM
Definition: dxgiformat.idl:51
@ DXGI_FORMAT_G8R8_G8B8_UNORM
Definition: dxgiformat.idl:92
@ DXGI_FORMAT_YUY2
Definition: dxgiformat.idl:130
@ DXGI_FORMAT_D16_UNORM
Definition: dxgiformat.idl:78
@ DXGI_FORMAT_R16_FLOAT
Definition: dxgiformat.idl:77
@ DXGI_FORMAT_R10G10B10A2_UINT
Definition: dxgiformat.idl:48
@ DXGI_FORMAT_BC6H_TYPELESS
Definition: dxgiformat.idl:117
@ DXGI_FORMAT_BC7_UNORM
Definition: dxgiformat.idl:121
@ DXGI_FORMAT_BC5_TYPELESS
Definition: dxgiformat.idl:105
@ DXGI_FORMAT_R32G32_SINT
Definition: dxgiformat.idl:41
@ DXGI_FORMAT_BC2_UNORM_SRGB
Definition: dxgiformat.idl:98
@ DXGI_FORMAT_R16_SNORM
Definition: dxgiformat.idl:81
@ DXGI_FORMAT_R8_SINT
Definition: dxgiformat.idl:87
@ DXGI_FORMAT_BC5_SNORM
Definition: dxgiformat.idl:107
@ DXGI_FORMAT_R32_UINT
Definition: dxgiformat.idl:65
@ DXGI_FORMAT_BC4_TYPELESS
Definition: dxgiformat.idl:102
@ DXGI_FORMAT_R32G32B32A32_FLOAT
Definition: dxgiformat.idl:25
@ DXGI_FORMAT_R24G8_TYPELESS
Definition: dxgiformat.idl:67
@ DXGI_FORMAT_R8G8_SINT
Definition: dxgiformat.idl:75
@ DXGI_FORMAT_R16_TYPELESS
Definition: dxgiformat.idl:76
@ DXGI_FORMAT_BC3_UNORM
Definition: dxgiformat.idl:100
@ DXGI_FORMAT_R32G32B32_UINT
Definition: dxgiformat.idl:30
@ DXGI_FORMAT_R16G16_TYPELESS
Definition: dxgiformat.idl:56
@ DXGI_FORMAT_R8G8B8A8_UNORM_SRGB
Definition: dxgiformat.idl:52
@ DXGI_FORMAT_R16G16_UINT
Definition: dxgiformat.idl:59
@ DXGI_FORMAT_D32_FLOAT
Definition: dxgiformat.idl:63
@ DXGI_FORMAT_R8G8_TYPELESS
Definition: dxgiformat.idl:71
@ DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM
Definition: dxgiformat.idl:112
@ DXGI_FORMAT_R16G16B16A16_SINT
Definition: dxgiformat.idl:37
@ DXGI_FORMAT_BC1_TYPELESS
Definition: dxgiformat.idl:93
@ DXGI_FORMAT_BC7_UNORM_SRGB
Definition: dxgiformat.idl:122
@ DXGI_FORMAT_BC2_UNORM
Definition: dxgiformat.idl:97
@ DXGI_FORMAT_R32G32_TYPELESS
Definition: dxgiformat.idl:38
@ DXGI_FORMAT_R32G8X24_TYPELESS
Definition: dxgiformat.idl:42
@ DXGI_FORMAT_B4G4R4A4_UNORM
Definition: dxgiformat.idl:138
@ DXGI_FORMAT_R16G16_FLOAT
Definition: dxgiformat.idl:57
@ DXGI_FORMAT_B5G6R5_UNORM
Definition: dxgiformat.idl:108
@ DXGI_FORMAT_BC4_UNORM
Definition: dxgiformat.idl:103
@ DXGI_FORMAT_X32_TYPELESS_G8X24_UINT
Definition: dxgiformat.idl:45
@ DXGI_FORMAT_R8G8_SNORM
Definition: dxgiformat.idl:74
@ DXGI_FORMAT_B8G8R8X8_UNORM_SRGB
Definition: dxgiformat.idl:116
@ DXGI_FORMAT_R8_UINT
Definition: dxgiformat.idl:85
@ DXGI_FORMAT_BC4_SNORM
Definition: dxgiformat.idl:104
@ DXGI_FORMAT_NV12
Definition: dxgiformat.idl:126
@ DXGI_FORMAT_B5G5R5A1_UNORM
Definition: dxgiformat.idl:109
@ DXGI_FORMAT_B8G8R8X8_UNORM
Definition: dxgiformat.idl:111

Referenced by debug_dxgi_mode(), and debug_dxgi_mode1().

◆ debug_dxgi_mode()

const char * debug_dxgi_mode ( const DXGI_MODE_DESC *  desc)

Definition at line 388 of file utils.c.

389{
390 if (!desc)
391 return "(null)";
392
393 return wine_dbg_sprintf("resolution %ux%u, refresh rate %u / %u, "
394 "format %s, scanline ordering %#x, scaling %#x",
395 desc->Width, desc->Height, desc->RefreshRate.Numerator, desc->RefreshRate.Denominator,
396 debug_dxgi_format(desc->Format), desc->ScanlineOrdering, desc->Scaling);
397}
const char * debug_dxgi_format(DXGI_FORMAT format)
Definition: utils.c:47
const char * wine_dbg_sprintf(const char *format,...)
Definition: compat.c:296

Referenced by dxgi_output_FindClosestMatchingMode(), and dxgi_swapchain_resize_target().

◆ debug_dxgi_mode1()

const char * debug_dxgi_mode1 ( const DXGI_MODE_DESC1 *  desc)

Definition at line 399 of file utils.c.

400{
401 if (!desc)
402 return "(null)";
403
404 return wine_dbg_sprintf("resolution %ux%u, refresh rate %u / %u, "
405 "format %s, scanline ordering %#x, scaling %#x, stereo %#x",
406 desc->Width, desc->Height, desc->RefreshRate.Numerator, desc->RefreshRate.Denominator,
407 debug_dxgi_format(desc->Format), desc->ScanlineOrdering, desc->Scaling, desc->Stereo);
408}

Referenced by dxgi_output_FindClosestMatchingMode1().

◆ dump_feature_levels()

void dump_feature_levels ( const D3D_FEATURE_LEVEL *  feature_levels,
unsigned int  level_count 
)

Definition at line 410 of file utils.c.

411{
412 unsigned int i;
413
414 if (!feature_levels || !level_count)
415 {
416 TRACE("Feature levels: (null).\n");
417 return;
418 }
419
420 TRACE("Feature levels (count = %u):\n", level_count);
421 for (i = 0; i < level_count; ++i)
422 TRACE(" [%u] = %s.\n", i, debug_feature_level(feature_levels[i]));
423}
static const char * debug_feature_level(D3D_FEATURE_LEVEL feature_level)
Definition: utils.c:26
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static D3D_DRIVER_TYPE HMODULE UINT const D3D_FEATURE_LEVEL * feature_levels
Definition: hlsl_d3d11.c:28

Referenced by DXGID3D10CreateDevice().

◆ dxgi_adapter_create()

HRESULT dxgi_adapter_create ( struct dxgi_factory *  factory,
UINT  ordinal,
struct dxgi_adapter **  adapter 
)

Definition at line 448 of file adapter.c.

449{
450 if (!(*adapter = malloc(sizeof(**adapter))))
451 return E_OUTOFMEMORY;
452
454 return S_OK;
455}
#define malloc
Definition: debug_ros.c:4
static void dxgi_adapter_init(struct dxgi_adapter *adapter, struct dxgi_factory *factory, UINT ordinal)
Definition: adapter.c:437
return adapter

Referenced by dxgi_factory_EnumAdapters1().

◆ dxgi_device_init()

HRESULT dxgi_device_init ( struct dxgi_device *  device,
struct dxgi_device_layer *  layer,
IDXGIFactory *  factory,
IDXGIAdapter *  adapter,
const D3D_FEATURE_LEVEL *  feature_levels,
unsigned int  level_count 
)

Definition at line 486 of file device.c.

489{
491 struct wined3d_swapchain_desc swapchain_desc;
492 IWineDXGIDeviceParent *dxgi_device_parent;
495 struct dxgi_output *dxgi_output;
496 struct IDXGIOutput *output;
497 void *layer_base;
498 HWND window;
499 HRESULT hr;
500
502 {
503 WARN("This is not the factory we're looking for.\n");
504 return E_FAIL;
505 }
506
508 {
509 WARN("This is not the adapter we're looking for.\n");
510 return E_FAIL;
511 }
512
513 device->IWineDXGIDevice_iface.lpVtbl = &dxgi_device_vtbl;
514 device->IWineDXGISwapChainFactory_iface.lpVtbl = &dxgi_swapchain_factory_vtbl;
515 device->refcount = 1;
517 wined3d_private_store_init(&device->private_store);
518
519 layer_base = device + 1;
520
521 if (FAILED(hr = layer->create(layer->id, &layer_base, 0,
522 device, &IID_IUnknown, (void **)&device->child_layer)))
523 {
524 WARN("Failed to create device, returning %#lx.\n", hr);
525 wined3d_private_store_cleanup(&device->private_store);
527 return hr;
528 }
529
530 if (FAILED(hr = IWineDXGIDevice_QueryInterface(&device->IWineDXGIDevice_iface,
531 &IID_IWineDXGIDeviceParent, (void **)&dxgi_device_parent)))
532 {
533 ERR("DXGI device should implement IWineDXGIDeviceParent.\n");
534 IUnknown_Release(device->child_layer);
535 wined3d_private_store_cleanup(&device->private_store);
537 return hr;
538 }
539 wined3d_device_parent = IWineDXGIDeviceParent_get_wined3d_device_parent(dxgi_device_parent);
540 IWineDXGIDeviceParent_Release(dxgi_device_parent);
541
544 (const enum wined3d_feature_level *)feature_levels, level_count,
545 wined3d_device_parent, &device->wined3d_device)))
546 {
547 WARN("Failed to create a wined3d device, returning %#lx.\n", hr);
548 IUnknown_Release(device->child_layer);
549 wined3d_private_store_cleanup(&device->private_store);
551 return hr;
552 }
553
556 {
557 ERR("Failed to get output from window %p.\n", window);
558 wined3d_device_decref(device->wined3d_device);
559 IUnknown_Release(device->child_layer);
560 wined3d_private_store_cleanup(&device->private_store);
562 return hr;
563 }
565
566 memset(&swapchain_desc, 0, sizeof(swapchain_desc));
567 swapchain_desc.swap_effect = WINED3D_SWAP_EFFECT_DISCARD;
568 swapchain_desc.device_window = window;
569 swapchain_desc.windowed = TRUE;
570 swapchain_desc.flags = WINED3D_SWAPCHAIN_IMPLICIT;
571 swapchain_desc.output = dxgi_output->wined3d_output;
572 IDXGIOutput_Release(output);
573
574 if (FAILED(hr = wined3d_swapchain_create(device->wined3d_device, &swapchain_desc,
575 NULL, NULL, &dxgi_null_wined3d_parent_ops, &device->implicit_swapchain)))
576 {
577 ERR("Failed to create implicit swapchain, hr %#lx.\n", hr);
578 wined3d_device_decref(device->wined3d_device);
579 IUnknown_Release(device->child_layer);
580 wined3d_private_store_cleanup(&device->private_store);
582 return E_OUTOFMEMORY;
583 }
584
586
588 IWineDXGIAdapter_AddRef(device->adapter);
589
590 return S_OK;
591}
const GUID IID_IUnknown
#define E_FAIL
Definition: ddrawi.h:102
struct dxgi_adapter * unsafe_impl_from_IDXGIAdapter(IDXGIAdapter *iface)
Definition: adapter.c:418
static const struct IWineDXGIDeviceVtbl dxgi_device_vtbl
Definition: device.c:363
static const struct IWineDXGISwapChainFactoryVtbl dxgi_swapchain_factory_vtbl
Definition: device.c:478
static const struct wined3d_parent_ops dxgi_null_wined3d_parent_ops
Definition: device.c:26
ULONG CDECL wined3d_device_decref(struct wined3d_device *device)
Definition: device.c:251
struct dxgi_factory * unsafe_impl_from_IDXGIFactory(IDXGIFactory *iface)
Definition: factory.c:546
HRESULT dxgi_get_output_from_window(IWineDXGIFactory *factory, HWND window, IDXGIOutput **dxgi_output)
Definition: swapchain.c:103
struct dxgi_output * unsafe_impl_from_IDXGIOutput(IDXGIOutput *iface)
Definition: output.c:706
HWND dxgi_factory_get_device_window(struct dxgi_factory *factory)
Definition: factory.c:607
GLenum GLuint GLint GLint layer
Definition: glext.h:7007
struct wined3d_adapter * wined3d_adapter
Definition: dxgi_private.h:162
IWineDXGIAdapter IWineDXGIAdapter_iface
Definition: dxgi_private.h:160
struct wined3d * wined3d
Definition: dxgi_private.h:117
IWineDXGIFactory IWineDXGIFactory_iface
Definition: dxgi_private.h:114
struct wined3d_output * wined3d_output
Definition: dxgi_private.h:148
HRESULT CDECL wined3d_device_create(struct wined3d *wined3d, struct wined3d_adapter *adapter, enum wined3d_device_type device_type, HWND focus_window, uint32_t flags, BYTE surface_alignment, const enum wined3d_feature_level *feature_levels, unsigned int feature_level_count, struct wined3d_device_parent *device_parent, struct wined3d_device **device)
Definition: directx.c:2777
#define WINED3D_SWAPCHAIN_IMPLICIT
Definition: wined3d.h:901
@ WINED3D_SWAP_EFFECT_DISCARD
Definition: wined3d.h:534
wined3d_feature_level
Definition: wined3d.h:98
@ WINED3D_DEVICE_TYPE_HAL
Definition: wined3d.h:91

Referenced by DXGID3D10CreateDevice().

◆ dxgi_factory_create()

HRESULT dxgi_factory_create ( REFIID  riid,
void **  factory,
BOOL  extended 
)

Definition at line 585 of file factory.c.

586{
587 struct dxgi_factory *object;
588 HRESULT hr;
589
590 if (!(object = calloc(1, sizeof(*object))))
591 return E_OUTOFMEMORY;
592
593 if (FAILED(hr = dxgi_factory_init(object, extended)))
594 {
595 WARN("Failed to initialize factory, hr %#lx.\n", hr);
596 free(object);
597 return hr;
598 }
599
600 TRACE("Created factory %p.\n", object);
601
602 hr = IWineDXGIFactory_QueryInterface(&object->IWineDXGIFactory_iface, riid, factory);
603 IWineDXGIFactory_Release(&object->IWineDXGIFactory_iface);
604 return hr;
605}
static HRESULT dxgi_factory_init(struct dxgi_factory *factory, BOOL extended)
Definition: factory.c:565
REFIID riid
Definition: atlbase.h:39

Referenced by CreateDXGIFactory(), CreateDXGIFactory1(), and CreateDXGIFactory2().

◆ dxgi_factory_get_device_window()

HWND dxgi_factory_get_device_window ( struct dxgi_factory *  factory)

Definition at line 607 of file factory.c.

608{
610
611 if (!factory->device_window)
612 {
613 if (!(factory->device_window = CreateWindowA("static", "DXGI device window",
614 WS_DISABLED, 0, 0, 0, 0, NULL, NULL, NULL, NULL)))
615 {
617 ERR("Failed to create a window.\n");
618 return NULL;
619 }
620 TRACE("Created device window %p for factory %p.\n", factory->device_window, factory);
621 }
622
624
625 return factory->device_window;
626}
#define WS_DISABLED
Definition: pedump.c:621
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4469

Referenced by dxgi_device_init().

◆ dxgi_format_from_wined3dformat()

DXGI_FORMAT dxgi_format_from_wined3dformat ( enum wined3d_format_id  format)

Definition at line 210 of file utils.c.

211{
212 switch(format)
213 {
317 default:
318 FIXME("Unhandled wined3d format %#x.\n", format);
319 return DXGI_FORMAT_UNKNOWN;
320 }
321}
@ WINED3DFMT_R32G32B32_TYPELESS
Definition: wined3d.h:160
@ WINED3DFMT_R8_TYPELESS
Definition: wined3d.h:217
@ WINED3DFMT_BC5_UNORM
Definition: wined3d.h:240
@ WINED3DFMT_R32G32B32_SINT
Definition: wined3d.h:163
@ WINED3DFMT_R8G8_UNORM
Definition: wined3d.h:206
@ WINED3DFMT_BC7_TYPELESS
Definition: wined3d.h:253
@ WINED3DFMT_BC7_UNORM_SRGB
Definition: wined3d.h:255
@ WINED3DFMT_R32G32_SINT
Definition: wined3d.h:173
@ WINED3DFMT_X24_TYPELESS_G8_UINT
Definition: wined3d.h:204
@ WINED3DFMT_BC2_UNORM_SRGB
Definition: wined3d.h:232
@ WINED3DFMT_B4G4R4A4_UNORM
Definition: wined3d.h:130
@ WINED3DFMT_R16G16_UINT
Definition: wined3d.h:193
@ WINED3DFMT_R16G16_UNORM
Definition: wined3d.h:192
@ WINED3DFMT_R8G8_TYPELESS
Definition: wined3d.h:205
@ WINED3DFMT_BC5_SNORM
Definition: wined3d.h:241
@ WINED3DFMT_R32_SINT
Definition: wined3d.h:200
@ WINED3DFMT_D32_FLOAT
Definition: wined3d.h:197
@ WINED3DFMT_R10G10B10A2_UNORM
Definition: wined3d.h:179
@ WINED3DFMT_R8_UINT
Definition: wined3d.h:219
@ WINED3DFMT_R32G32_FLOAT
Definition: wined3d.h:171
@ WINED3DFMT_R16G16_SNORM
Definition: wined3d.h:194
@ WINED3DFMT_B8G8R8A8_UNORM
Definition: wined3d.h:244
@ WINED3DFMT_R16_UNORM
Definition: wined3d.h:213
@ WINED3DFMT_R24G8_TYPELESS
Definition: wined3d.h:201
@ WINED3DFMT_R10G10B10A2_TYPELESS
Definition: wined3d.h:178
@ WINED3DFMT_R32G32_UINT
Definition: wined3d.h:172
@ WINED3DFMT_R32G32B32_UINT
Definition: wined3d.h:162
@ WINED3DFMT_BC4_TYPELESS
Definition: wined3d.h:236
@ WINED3DFMT_BC2_UNORM
Definition: wined3d.h:231
@ WINED3DFMT_R8_UNORM
Definition: wined3d.h:218
@ WINED3DFMT_R8G8B8A8_SNORM
Definition: wined3d.h:188
@ WINED3DFMT_NV12
Definition: wined3d.h:279
@ WINED3DFMT_R10G10B10_XR_BIAS_A2_UNORM
Definition: wined3d.h:182
@ WINED3DFMT_R16_TYPELESS
Definition: wined3d.h:210
@ WINED3DFMT_R16G16B16A16_SINT
Definition: wined3d.h:169
@ WINED3DFMT_R16_SINT
Definition: wined3d.h:216
@ WINED3DFMT_R8G8_B8G8_UNORM
Definition: wined3d.h:225
@ WINED3DFMT_R32G32B32_FLOAT
Definition: wined3d.h:161
@ WINED3DFMT_B8G8R8X8_UNORM
Definition: wined3d.h:245
@ WINED3DFMT_R32_FLOAT_X8X24_TYPELESS
Definition: wined3d.h:176
@ WINED3DFMT_BC1_UNORM_SRGB
Definition: wined3d.h:229
@ WINED3DFMT_R16G16B16A16_FLOAT
Definition: wined3d.h:165
@ WINED3DFMT_D16_UNORM
Definition: wined3d.h:212
@ WINED3DFMT_R8G8_SNORM
Definition: wined3d.h:208
@ WINED3DFMT_R8G8B8A8_TYPELESS
Definition: wined3d.h:184
@ WINED3DFMT_R8G8_UINT
Definition: wined3d.h:207
@ WINED3DFMT_BC7_UNORM
Definition: wined3d.h:254
@ WINED3DFMT_R8G8B8A8_UNORM_SRGB
Definition: wined3d.h:186
@ WINED3DFMT_R9G9B9E5_SHAREDEXP
Definition: wined3d.h:224
@ WINED3DFMT_B8G8R8X8_TYPELESS
Definition: wined3d.h:248
@ WINED3DFMT_R32_UINT
Definition: wined3d.h:199
@ WINED3DFMT_B5G5R5A1_UNORM
Definition: wined3d.h:243
@ WINED3DFMT_R16_FLOAT
Definition: wined3d.h:211
@ WINED3DFMT_R8G8B8A8_UNORM
Definition: wined3d.h:185
@ WINED3DFMT_R10G10B10A2_UINT
Definition: wined3d.h:180
@ WINED3DFMT_G8R8_G8B8_UNORM
Definition: wined3d.h:226
@ WINED3DFMT_R32G32B32A32_UINT
Definition: wined3d.h:158
@ WINED3DFMT_R16G16B16A16_UNORM
Definition: wined3d.h:166
@ WINED3DFMT_BC3_UNORM
Definition: wined3d.h:234
@ WINED3DFMT_BC6H_UF16
Definition: wined3d.h:251
@ WINED3DFMT_R16G16B16A16_TYPELESS
Definition: wined3d.h:164
@ WINED3DFMT_R24_UNORM_X8_TYPELESS
Definition: wined3d.h:203
@ WINED3DFMT_D32_FLOAT_S8X24_UINT
Definition: wined3d.h:175
@ WINED3DFMT_R32_FLOAT
Definition: wined3d.h:198
@ WINED3DFMT_X32_TYPELESS_G8X24_UINT
Definition: wined3d.h:177
@ WINED3DFMT_B5G6R5_UNORM
Definition: wined3d.h:242
@ WINED3DFMT_R16G16B16A16_UINT
Definition: wined3d.h:167
@ WINED3DFMT_BC1_TYPELESS
Definition: wined3d.h:227
@ WINED3DFMT_B8G8R8X8_UNORM_SRGB
Definition: wined3d.h:249
@ WINED3DFMT_BC4_UNORM
Definition: wined3d.h:237
@ WINED3DFMT_B8G8R8A8_TYPELESS
Definition: wined3d.h:246
@ WINED3DFMT_BC3_TYPELESS
Definition: wined3d.h:233
@ WINED3DFMT_R16G16_TYPELESS
Definition: wined3d.h:190
@ WINED3DFMT_R8_SNORM
Definition: wined3d.h:220
@ WINED3DFMT_YUY2
Definition: wined3d.h:258
@ WINED3DFMT_R16G16_FLOAT
Definition: wined3d.h:191
@ WINED3DFMT_R8G8B8A8_UINT
Definition: wined3d.h:187
@ WINED3DFMT_R16_SNORM
Definition: wined3d.h:215
@ WINED3DFMT_BC6H_TYPELESS
Definition: wined3d.h:250
@ WINED3DFMT_BC1_UNORM
Definition: wined3d.h:228
@ WINED3DFMT_R32G32B32A32_TYPELESS
Definition: wined3d.h:156
@ WINED3DFMT_R32_TYPELESS
Definition: wined3d.h:196
@ WINED3DFMT_R32G8X24_TYPELESS
Definition: wined3d.h:174
@ WINED3DFMT_R16_UINT
Definition: wined3d.h:214
@ WINED3DFMT_R8_SINT
Definition: wined3d.h:221
@ WINED3DFMT_BC5_TYPELESS
Definition: wined3d.h:239
@ WINED3DFMT_R8G8_SINT
Definition: wined3d.h:209
@ WINED3DFMT_R32G32B32A32_SINT
Definition: wined3d.h:159
@ WINED3DFMT_R8G8B8A8_SINT
Definition: wined3d.h:189
@ WINED3DFMT_R1_UNORM
Definition: wined3d.h:223
@ WINED3DFMT_R11G11B10_FLOAT
Definition: wined3d.h:183
@ WINED3DFMT_B8G8R8A8_UNORM_SRGB
Definition: wined3d.h:247
@ WINED3DFMT_BC3_UNORM_SRGB
Definition: wined3d.h:235
@ WINED3DFMT_A8_UNORM
Definition: wined3d.h:222
@ WINED3DFMT_R32G32B32A32_FLOAT
Definition: wined3d.h:157
@ WINED3DFMT_BC2_TYPELESS
Definition: wined3d.h:230
@ WINED3DFMT_BC6H_SF16
Definition: wined3d.h:252
@ WINED3DFMT_D24_UNORM_S8_UINT
Definition: wined3d.h:202
@ WINED3DFMT_R16G16B16A16_SNORM
Definition: wined3d.h:168
@ WINED3DFMT_BC4_SNORM
Definition: wined3d.h:238
@ WINED3DFMT_R16G16_SINT
Definition: wined3d.h:195
@ WINED3DFMT_R32G32_TYPELESS
Definition: wined3d.h:170

◆ dxgi_get_output_from_window()

HRESULT dxgi_get_output_from_window ( IWineDXGIFactory *  factory,
HWND  window,
IDXGIOutput **  dxgi_output 
)

Definition at line 103 of file swapchain.c.

104{
105 unsigned int adapter_idx, output_idx;
108 IDXGIOutput *output;
109 HMONITOR monitor;
110 HRESULT hr;
111
112 if (!(monitor = MonitorFromWindow(window, MONITOR_DEFAULTTONEAREST)))
113 {
114 WARN("Failed to get monitor from window.\n");
116 }
117
118 for (adapter_idx = 0; SUCCEEDED(hr = IWineDXGIFactory_EnumAdapters(factory, adapter_idx, &adapter));
119 ++adapter_idx)
120 {
121 for (output_idx = 0; SUCCEEDED(hr = IDXGIAdapter_EnumOutputs(adapter, output_idx,
122 &output)); ++output_idx)
123 {
124 if (FAILED(hr = IDXGIOutput_GetDesc(output, &desc)))
125 {
126 WARN("Adapter %u output %u: Failed to get output desc, hr %#lx.\n", adapter_idx,
127 output_idx, hr);
128 IDXGIOutput_Release(output);
129 continue;
130 }
131
132 if (desc.Monitor == monitor)
133 {
134 *dxgi_output = output;
135 IDXGIAdapter_Release(adapter);
136 return S_OK;
137 }
138
139 IDXGIOutput_Release(output);
140 }
141 IDXGIAdapter_Release(adapter);
142 }
143
145 WARN("Failed to enumerate outputs, hr %#lx.\n", hr);
146
147 WARN("Output could not be found.\n");
149}
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HMONITOR WINAPI MonitorFromWindow(HWND, DWORD)
#define DXGI_ERROR_NOT_FOUND
Definition: winerror.h:7122

Referenced by d3d11_swapchain_GetContainingOutput(), d3d12_swapchain_GetContainingOutput(), d3d12_swapchain_init(), dxgi_device_init(), and dxgi_swapchain_factory_create_swapchain().

◆ dxgi_get_private_data()

HRESULT dxgi_get_private_data ( struct wined3d_private_store *  store,
REFGUID  guid,
UINT *  data_size,
void *  data 
)

Definition at line 624 of file utils.c.

626{
627 const struct wined3d_private_data *stored_data;
628 DWORD size_in;
629 HRESULT hr;
630
631 if (!data_size)
632 return E_INVALIDARG;
633
635 if (!(stored_data = wined3d_private_store_get_private_data(store, guid)))
636 {
638 *data_size = 0;
639 goto done;
640 }
641
642 size_in = *data_size;
643 *data_size = stored_data->size;
644 if (!data)
645 {
646 hr = S_OK;
647 goto done;
648 }
649 if (size_in < stored_data->size)
650 {
652 goto done;
653 }
654
655 if (stored_data->flags & WINED3DSPD_IUNKNOWN)
656 IUnknown_AddRef(stored_data->content.object);
657 memcpy(data, stored_data->content.data, stored_data->size);
658 hr = S_OK;
659
660done:
662
663 return hr;
664}
GUID guid
Definition: version.c:147
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizeiptr size
Definition: glext.h:5919
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
union wined3d_private_data::@4825 content
IUnknown * object
Definition: wined3d.h:2285
static struct wined3d_private_data * wined3d_private_store_get_private_data(const struct wined3d_private_store *store, const GUID *tag)
Definition: wined3d.h:2612
#define WINED3DSPD_IUNKNOWN
Definition: wined3d.h:1018
#define DXGI_ERROR_MORE_DATA
Definition: winerror.h:7123

Referenced by d3d11_swapchain_GetPrivateData(), d3d12_swapchain_GetPrivateData(), dxgi_adapter_GetPrivateData(), dxgi_device_GetPrivateData(), dxgi_factory_GetPrivateData(), dxgi_output_GetPrivateData(), and dxgi_resource_GetPrivateData().

◆ dxgi_output_create()

HRESULT dxgi_output_create ( struct dxgi_adapter *  adapter,
unsigned int  output_idx,
struct dxgi_output **  output 
)

Definition at line 725 of file output.c.

727{
728 if (!(*output = calloc(1, sizeof(**output))))
729 return E_OUTOFMEMORY;
730
731 dxgi_output_init(*output, output_idx, adapter);
732 return S_OK;
733}
static void dxgi_output_init(struct dxgi_output *output, unsigned int output_idx, struct dxgi_adapter *adapter)
Definition: output.c:714

Referenced by dxgi_adapter_EnumOutputs().

◆ dxgi_resource_init()

HRESULT dxgi_resource_init ( struct dxgi_resource *  resource,
IDXGIDevice *  device,
IUnknown *  outer,
BOOL  needs_surface,
struct wined3d_resource *  wined3d_resource 
)

Definition at line 426 of file resource.c.

428{
430
432 if ((desc.resource_type == WINED3D_RTYPE_TEXTURE_1D || desc.resource_type == WINED3D_RTYPE_TEXTURE_2D)
433 && needs_surface)
434 {
435 resource->IDXGISurface1_iface.lpVtbl = &dxgi_surface_vtbl;
436 }
437 else
438 resource->IDXGISurface1_iface.lpVtbl = NULL;
439 resource->IDXGIResource_iface.lpVtbl = &dxgi_resource_vtbl;
440 resource->IUnknown_iface.lpVtbl = &dxgi_resource_inner_unknown_vtbl;
441 resource->refcount = 1;
442 wined3d_private_store_init(&resource->private_store);
443 resource->outer_unknown = outer ? outer : &resource->IUnknown_iface;
444 resource->device = device;
445 resource->wined3d_resource = wined3d_resource;
446 resource->dc = NULL;
447
448 return S_OK;
449}
static const struct IDXGISurface1Vtbl dxgi_surface_vtbl
Definition: resource.c:240
static const struct IUnknownVtbl dxgi_resource_inner_unknown_vtbl
Definition: resource.c:418
static const struct IDXGIResourceVtbl dxgi_resource_vtbl
Definition: resource.c:398
void CDECL wined3d_resource_get_desc(const struct wined3d_resource *resource, struct wined3d_resource_desc *desc)
Definition: resource.c:280
static IUnknown * outer
Definition: compobj.c:82
@ WINED3D_RTYPE_TEXTURE_2D
Definition: wined3d.h:720
@ WINED3D_RTYPE_TEXTURE_1D
Definition: wined3d.h:719

Referenced by dxgi_device_create_resource().

◆ dxgi_sample_desc_from_wined3d()

void dxgi_sample_desc_from_wined3d ( DXGI_SAMPLE_DESC *  desc,
enum wined3d_multisample_type  wined3d_type,
unsigned int  wined3d_quality 
)

Definition at line 447 of file utils.c.

449{
450 desc->Count = wined3d_type == WINED3D_MULTISAMPLE_NONE ? 1 : wined3d_type;
451 desc->Quality = wined3d_quality;
452}
@ WINED3D_MULTISAMPLE_NONE
Definition: wined3d.h:573

Referenced by d3d11_swapchain_GetDesc(), d3d11_swapchain_GetDesc1(), and dxgi_surface_GetDesc().

◆ dxgi_set_private_data()

HRESULT dxgi_set_private_data ( struct wined3d_private_store *  store,
REFGUID  guid,
UINT  data_size,
const void *  data 
)

Definition at line 666 of file utils.c.

668{
670 HRESULT hr;
671
672 if (!data)
673 {
676 {
678 return S_FALSE;
679 }
680
683
684 return S_OK;
685 }
686
688 hr = wined3d_private_store_set_private_data(store, guid, data, data_size, 0);
690
691 return hr;
692}
uint32_t entry
Definition: isohybrid.c:63
static void wined3d_private_store_free_private_data(struct wined3d_private_store *store, struct wined3d_private_data *entry)
Definition: wined3d.h:2627
static HRESULT wined3d_private_store_set_private_data(struct wined3d_private_store *store, const GUID *guid, const void *data, DWORD data_size, uint32_t flags)
Definition: wined3d.h:2648
#define S_FALSE
Definition: winerror.h:3451

Referenced by d3d11_swapchain_SetPrivateData(), d3d12_swapchain_SetPrivateData(), dxgi_adapter_SetPrivateData(), dxgi_device_SetPrivateData(), dxgi_factory_SetPrivateData(), dxgi_output_SetPrivateData(), dxgi_resource_SetPrivateData(), and dxgi_set_private_data_interface().

◆ dxgi_set_private_data_interface()

HRESULT dxgi_set_private_data_interface ( struct wined3d_private_store *  store,
REFGUID  guid,
const IUnknown *  object 
)

Definition at line 694 of file utils.c.

696{
697 HRESULT hr;
698
699 if (!object)
700 return dxgi_set_private_data(store, guid, sizeof(object), &object);
701
704 guid, object, sizeof(object), WINED3DSPD_IUNKNOWN);
706
707 return hr;
708}
HRESULT dxgi_set_private_data(struct wined3d_private_store *store, REFGUID guid, UINT data_size, const void *data)
Definition: utils.c:666

Referenced by d3d11_swapchain_SetPrivateDataInterface(), d3d12_swapchain_SetPrivateDataInterface(), dxgi_adapter_SetPrivateDataInterface(), dxgi_device_SetPrivateDataInterface(), dxgi_factory_SetPrivateDataInterface(), dxgi_output_SetPrivateDataInterface(), and dxgi_resource_SetPrivateDataInterface().

◆ dxgi_swapchain_flags_from_wined3d()

unsigned int dxgi_swapchain_flags_from_wined3d ( unsigned int  wined3d_flags)

Definition at line 525 of file utils.c.

526{
527 unsigned int flags = 0;
528
529 wined3d_flags &= ~DXGI_WINED3D_SWAPCHAIN_FLAGS;
530
531 if (wined3d_flags & WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH)
532 {
533 wined3d_flags &= ~WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH;
535 }
536
537 if (wined3d_flags & WINED3D_SWAPCHAIN_GDI_COMPATIBLE)
538 {
539 wined3d_flags &= ~WINED3D_SWAPCHAIN_GDI_COMPATIBLE;
541 }
542
543 if (wined3d_flags)
544 FIXME("Unhandled flags %#x.\n", flags);
545
546 return flags;
547}
@ DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH
Definition: dxgi.idl:120
@ DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE
Definition: dxgi.idl:121
GLbitfield flags
Definition: glext.h:7161
#define WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH
Definition: wined3d.h:897
#define WINED3D_SWAPCHAIN_GDI_COMPATIBLE
Definition: wined3d.h:900

Referenced by d3d11_swapchain_GetDesc(), and d3d11_swapchain_GetDesc1().

◆ dxgi_usage_from_wined3d_bind_flags()

DXGI_USAGE dxgi_usage_from_wined3d_bind_flags ( unsigned int  wined3d_bind_flags)

Definition at line 490 of file utils.c.

491{
492 DXGI_USAGE dxgi_usage = 0;
493
494 if (wined3d_bind_flags & WINED3D_BIND_SHADER_RESOURCE)
495 dxgi_usage |= DXGI_USAGE_SHADER_INPUT;
496 if (wined3d_bind_flags & WINED3D_BIND_RENDER_TARGET)
498 if (wined3d_bind_flags & WINED3D_BIND_UNORDERED_ACCESS)
499 dxgi_usage |= DXGI_USAGE_UNORDERED_ACCESS;
500
501 return dxgi_usage;
502}
const DXGI_USAGE DXGI_USAGE_UNORDERED_ACCESS
Definition: dxgi.idl:49
const DXGI_USAGE DXGI_USAGE_RENDER_TARGET_OUTPUT
Definition: dxgi.idl:44
const DXGI_USAGE DXGI_USAGE_SHADER_INPUT
Definition: dxgi.idl:43
UINT DXGI_USAGE
Definition: dxgi.idl:42
#define WINED3D_BIND_UNORDERED_ACCESS
Definition: wined3d.h:916
#define WINED3D_BIND_SHADER_RESOURCE
Definition: wined3d.h:912
#define WINED3D_BIND_RENDER_TARGET
Definition: wined3d.h:914

Referenced by d3d11_swapchain_GetDesc(), d3d11_swapchain_GetDesc1(), and dxgi_resource_GetUsage().

◆ dxgi_validate_swapchain_desc()

BOOL dxgi_validate_swapchain_desc ( const DXGI_SWAP_CHAIN_DESC1 *  desc)

Definition at line 63 of file swapchain.c.

64{
65 unsigned int min_buffer_count;
66
67 switch (desc->SwapEffect)
68 {
71 min_buffer_count = 1;
72 break;
73
76 min_buffer_count = 2;
77
78 if (desc->Format && !dxgi_validate_flip_swap_effect_format(desc->Format))
79 return FALSE;
80
81 if (desc->SampleDesc.Count != 1 || desc->SampleDesc.Quality)
82 {
83 WARN("Invalid sample desc %u, %u for swap effect %#x.\n",
84 desc->SampleDesc.Count, desc->SampleDesc.Quality, desc->SwapEffect);
85 return FALSE;
86 }
87 break;
88
89 default:
90 WARN("Invalid swap effect %u used.\n", desc->SwapEffect);
91 return FALSE;
92 }
93
94 if (desc->BufferCount < min_buffer_count || desc->BufferCount > DXGI_MAX_SWAP_CHAIN_BUFFERS)
95 {
96 WARN("BufferCount is %u.\n", desc->BufferCount);
97 return FALSE;
98 }
99
100 return TRUE;
101}
static BOOL dxgi_validate_flip_swap_effect_format(DXGI_FORMAT format)
Definition: swapchain.c:48
@ DXGI_SWAP_EFFECT_SEQUENTIAL
Definition: dxgi.idl:66
@ DXGI_SWAP_EFFECT_DISCARD
Definition: dxgi.idl:65
@ DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL
Definition: dxgi.idl:67
@ DXGI_SWAP_EFFECT_FLIP_DISCARD
Definition: dxgi.idl:68

Referenced by d3d12_swapchain_resize_buffers(), and dxgi_factory_CreateSwapChainForHwnd().

◆ unsafe_impl_from_IDXGIAdapter()

struct dxgi_adapter * unsafe_impl_from_IDXGIAdapter ( IDXGIAdapter *  iface)

Definition at line 418 of file adapter.c.

419{
420 IWineDXGIAdapter *wine_adapter;
421 struct dxgi_adapter *adapter;
422 HRESULT hr;
423
424 if (!iface)
425 return NULL;
426 if (FAILED(hr = IDXGIAdapter_QueryInterface(iface, &IID_IWineDXGIAdapter, (void **)&wine_adapter)))
427 {
428 ERR("Failed to get IWineDXGIAdapter interface, hr %#lx.\n", hr);
429 return NULL;
430 }
431 assert(wine_adapter->lpVtbl == &dxgi_adapter_vtbl);
433 IWineDXGIAdapter_Release(wine_adapter);
434 return adapter;
435}
static const struct IWineDXGIAdapterVtbl dxgi_adapter_vtbl
Definition: adapter.c:388
#define assert(_expr)
Definition: assert.h:32
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by dxgi_device_init().

◆ unsafe_impl_from_IDXGIFactory()

struct dxgi_factory * unsafe_impl_from_IDXGIFactory ( IDXGIFactory *  iface)

Definition at line 546 of file factory.c.

547{
548 IWineDXGIFactory *wine_factory;
549 struct dxgi_factory *factory;
550 HRESULT hr;
551
552 if (!iface)
553 return NULL;
554 if (FAILED(hr = IDXGIFactory_QueryInterface(iface, &IID_IWineDXGIFactory, (void **)&wine_factory)))
555 {
556 ERR("Failed to get IWineDXGIFactory interface, hr %#lx.\n", hr);
557 return NULL;
558 }
559 assert(wine_factory->lpVtbl == &dxgi_factory_vtbl);
561 IWineDXGIFactory_Release(wine_factory);
562 return factory;
563}
static const struct IWineDXGIFactoryVtbl dxgi_factory_vtbl
Definition: factory.c:503

Referenced by d3d12_swapchain_init(), dxgi_device_init(), and dxgi_swapchain_factory_create_swapchain().

◆ unsafe_impl_from_IDXGIOutput()

struct dxgi_output * unsafe_impl_from_IDXGIOutput ( IDXGIOutput *  iface)

Definition at line 706 of file output.c.

707{
708 if (!iface)
709 return NULL;
710 assert(iface->lpVtbl == (IDXGIOutputVtbl *)&dxgi_output_vtbl);
711 return CONTAINING_RECORD(iface, struct dxgi_output, IDXGIOutput6_iface);
712}
static const struct IDXGIOutput6Vtbl dxgi_output_vtbl
Definition: output.c:665

Referenced by d3d11_swapchain_SetFullscreenState(), dxgi_device_init(), and wined3d_swapchain_desc_from_dxgi().

◆ wined3d_bind_flags_from_dxgi_usage()

unsigned int wined3d_bind_flags_from_dxgi_usage ( DXGI_USAGE  usage)

Definition at line 504 of file utils.c.

505{
506 unsigned int wined3d_bind_flags = 0;
507
508 if (dxgi_usage & DXGI_USAGE_SHADER_INPUT)
509 wined3d_bind_flags |= WINED3D_BIND_SHADER_RESOURCE;
510 if (dxgi_usage & DXGI_USAGE_RENDER_TARGET_OUTPUT)
511 wined3d_bind_flags |= WINED3D_BIND_RENDER_TARGET;
512 if (dxgi_usage & DXGI_USAGE_UNORDERED_ACCESS)
513 wined3d_bind_flags |= WINED3D_BIND_UNORDERED_ACCESS;
514
516 if (dxgi_usage)
517 FIXME("Unhandled DXGI usage %#x.\n", dxgi_usage);
518 return wined3d_bind_flags;
519}

Referenced by dxgi_device_CreateSurface(), and wined3d_swapchain_desc_from_dxgi().

◆ wined3d_display_mode_from_dxgi()

void wined3d_display_mode_from_dxgi ( struct wined3d_display_mode *  wined3d_mode,
const DXGI_MODE_DESC *  mode 
)

Definition at line 469 of file utils.c.

471{
472 wined3d_mode->width = mode->Width;
473 wined3d_mode->height = mode->Height;
474 wined3d_mode->refresh_rate = dxgi_rational_to_uint(&mode->RefreshRate);
475 wined3d_mode->format_id = wined3dformat_from_dxgi_format(mode->Format);
476 wined3d_mode->scanline_ordering = wined3d_scanline_ordering_from_dxgi(mode->ScanlineOrdering);
477}
enum wined3d_format_id wined3dformat_from_dxgi_format(DXGI_FORMAT format)
Definition: utils.c:275
static unsigned int dxgi_rational_to_uint(const DXGI_RATIONAL *rational)
Definition: utils.c:425
static enum wined3d_scanline_ordering wined3d_scanline_ordering_from_dxgi(DXGI_MODE_SCANLINE_ORDER scanline_order)
Definition: utils.c:433
GLenum mode
Definition: glext.h:6217
enum wined3d_format_id format_id
Definition: wined3d.h:1614
enum wined3d_scanline_ordering scanline_ordering
Definition: wined3d.h:1615

Referenced by dxgi_output_FindClosestMatchingMode(), and dxgi_swapchain_resize_target().

◆ wined3d_display_mode_from_dxgi1()

void wined3d_display_mode_from_dxgi1 ( struct wined3d_display_mode *  wined3d_mode,
const DXGI_MODE_DESC1 *  mode 
)

Definition at line 479 of file utils.c.

481{
482 wined3d_mode->width = mode->Width;
483 wined3d_mode->height = mode->Height;
484 wined3d_mode->refresh_rate = dxgi_rational_to_uint(&mode->RefreshRate);
485 wined3d_mode->format_id = wined3dformat_from_dxgi_format(mode->Format);
486 wined3d_mode->scanline_ordering = wined3d_scanline_ordering_from_dxgi(mode->ScanlineOrdering);
487 FIXME("Ignoring stereo %#x.\n", mode->Stereo);
488}

Referenced by dxgi_output_FindClosestMatchingMode1().

◆ wined3d_sample_desc_from_dxgi()

void wined3d_sample_desc_from_dxgi ( enum wined3d_multisample_type *  wined3d_type,
unsigned int *  wined3d_quality,
const DXGI_SAMPLE_DESC *  dxgi_desc 
)

Definition at line 454 of file utils.c.

456{
457 if (dxgi_desc->Count > 1)
458 {
459 *wined3d_type = dxgi_desc->Count;
460 *wined3d_quality = dxgi_desc->Quality;
461 }
462 else
463 {
464 *wined3d_type = WINED3D_MULTISAMPLE_NONE;
465 *wined3d_quality = 0;
466 }
467}

Referenced by dxgi_device_CreateSurface(), and wined3d_swapchain_desc_from_dxgi().

◆ wined3d_swapchain_desc_from_dxgi()

HRESULT wined3d_swapchain_desc_from_dxgi ( struct wined3d_swapchain_desc *  wined3d_desc,
IDXGIOutput *  dxgi_containing_output,
HWND  window,
const DXGI_SWAP_CHAIN_DESC1 *  dxgi_desc,
const DXGI_SWAP_CHAIN_FULLSCREEN_DESC *  dxgi_fullscreen_desc 
)

Definition at line 571 of file utils.c.

574{
575 struct dxgi_output *dxgi_output = unsafe_impl_from_IDXGIOutput(dxgi_containing_output);
576
577 if (dxgi_desc->Scaling != DXGI_SCALING_STRETCH)
578 FIXME("Ignoring scaling %#x.\n", dxgi_desc->Scaling);
580 FIXME("Ignoring alpha mode %#x.\n", dxgi_desc->AlphaMode);
581 if (dxgi_fullscreen_desc && dxgi_fullscreen_desc->ScanlineOrdering)
582 FIXME("Unhandled scanline ordering %#x.\n", dxgi_fullscreen_desc->ScanlineOrdering);
583 if (dxgi_fullscreen_desc && dxgi_fullscreen_desc->Scaling)
584 FIXME("Unhandled mode scaling %#x.\n", dxgi_fullscreen_desc->Scaling);
585
586 switch (dxgi_desc->SwapEffect)
587 {
590 break;
593 break;
596 break;
599 break;
600 default:
601 WARN("Invalid swap effect %#x.\n", dxgi_desc->SwapEffect);
603 }
604
605 wined3d_desc->output = dxgi_output->wined3d_output;
606 wined3d_desc->backbuffer_width = dxgi_desc->Width;
607 wined3d_desc->backbuffer_height = dxgi_desc->Height;
608 wined3d_desc->backbuffer_format = wined3dformat_from_dxgi_format(dxgi_desc->Format);
609 wined3d_desc->backbuffer_count = dxgi_desc->BufferCount;
612 &wined3d_desc->multisample_quality, &dxgi_desc->SampleDesc);
613 wined3d_desc->device_window = window;
614 wined3d_desc->windowed = dxgi_fullscreen_desc ? dxgi_fullscreen_desc->Windowed : TRUE;
615 wined3d_desc->enable_auto_depth_stencil = FALSE;
616 wined3d_desc->auto_depth_stencil_format = 0;
617 wined3d_desc->flags = wined3d_swapchain_flags_from_dxgi(dxgi_desc->Flags);
618 wined3d_desc->refresh_rate = dxgi_fullscreen_desc ? dxgi_rational_to_uint(&dxgi_fullscreen_desc->RefreshRate) : 0;
619 wined3d_desc->auto_restore_display_mode = TRUE;
620
621 return S_OK;
622}
unsigned int wined3d_bind_flags_from_dxgi_usage(DXGI_USAGE dxgi_usage)
Definition: utils.c:504
void wined3d_sample_desc_from_dxgi(enum wined3d_multisample_type *wined3d_type, unsigned int *wined3d_quality, const DXGI_SAMPLE_DESC *dxgi_desc)
Definition: utils.c:454
static unsigned int wined3d_swapchain_flags_from_dxgi(unsigned int flags)
Definition: utils.c:549
@ DXGI_ALPHA_MODE_UNSPECIFIED
Definition: dxgi1_2.idl:34
@ DXGI_ALPHA_MODE_IGNORE
Definition: dxgi1_2.idl:37
DXGI_ALPHA_MODE AlphaMode
Definition: dxgi1_2.idl:230
DXGI_USAGE BufferUsage
Definition: dxgi1_2.idl:226
DXGI_SWAP_EFFECT SwapEffect
Definition: dxgi1_2.idl:229
DXGI_SAMPLE_DESC SampleDesc
Definition: dxgi1_2.idl:225
DXGI_SCALING Scaling
Definition: dxgi1_2.idl:228
DXGI_MODE_SCANLINE_ORDER ScanlineOrdering
Definition: dxgi1_2.idl:236
DXGI_MODE_SCALING Scaling
Definition: dxgi1_2.idl:237
unsigned int multisample_quality
Definition: wined3d.h:1778
unsigned int backbuffer_height
Definition: wined3d.h:1773
BOOL auto_restore_display_mode
Definition: wined3d.h:1786
enum wined3d_multisample_type multisample_type
Definition: wined3d.h:1777
enum wined3d_format_id auto_depth_stencil_format
Definition: wined3d.h:1783
struct wined3d_output * output
Definition: wined3d.h:1771
unsigned int backbuffer_width
Definition: wined3d.h:1772
unsigned int backbuffer_count
Definition: wined3d.h:1775
enum wined3d_format_id backbuffer_format
Definition: wined3d.h:1774
enum wined3d_swap_effect swap_effect
Definition: wined3d.h:1779
BOOL enable_auto_depth_stencil
Definition: wined3d.h:1782
unsigned int refresh_rate
Definition: wined3d.h:1785
unsigned int backbuffer_bind_flags
Definition: wined3d.h:1776
@ WINED3D_SWAP_EFFECT_FLIP_DISCARD
Definition: wined3d.h:536
@ WINED3D_SWAP_EFFECT_SEQUENTIAL
Definition: wined3d.h:535
@ WINED3D_SWAP_EFFECT_FLIP_SEQUENTIAL
Definition: wined3d.h:537

Referenced by d3d12_swapchain_init(), d3d12_swapchain_SetFullscreenState(), and dxgi_swapchain_factory_create_swapchain().

◆ wined3dformat_from_dxgi_format()

enum wined3d_format_id wined3dformat_from_dxgi_format ( DXGI_FORMAT  format)

Definition at line 323 of file utils.c.

324{
325 switch(format)
326 {
430 default:
431 FIXME("Unhandled DXGI_FORMAT %#x.\n", format);
432 return WINED3DFMT_UNKNOWN;
433 }
434}

Referenced by wined3d_display_mode_from_dxgi(), wined3d_display_mode_from_dxgi1(), and wined3d_swapchain_desc_from_dxgi().