2 * Copyright 2009 Henri Verbeet for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #include "wine/port.h"
22 #include "dxgi_private.h"
24 WINE_DEFAULT_DEBUG_CHANNEL(dxgi
);
26 static inline DXGI_MODE_SCANLINE_ORDER
dxgi_mode_scanline_order_from_wined3d(enum wined3d_scanline_ordering ordering
)
28 return (DXGI_MODE_SCANLINE_ORDER
)ordering
;
31 static void dxgi_mode_from_wined3d(DXGI_MODE_DESC
*mode
, const struct wined3d_display_mode
*wined3d_mode
)
33 mode
->Width
= wined3d_mode
->width
;
34 mode
->Height
= wined3d_mode
->height
;
35 mode
->RefreshRate
.Numerator
= wined3d_mode
->refresh_rate
;
36 mode
->RefreshRate
.Denominator
= 1;
37 mode
->Format
= dxgi_format_from_wined3dformat(wined3d_mode
->format_id
);
38 mode
->ScanlineOrdering
= dxgi_mode_scanline_order_from_wined3d(wined3d_mode
->scanline_ordering
);
39 mode
->Scaling
= DXGI_MODE_SCALING_UNSPECIFIED
; /* FIXME */
42 static void dxgi_mode1_from_wined3d(DXGI_MODE_DESC1
*mode
, const struct wined3d_display_mode
*wined3d_mode
)
44 mode
->Width
= wined3d_mode
->width
;
45 mode
->Height
= wined3d_mode
->height
;
46 mode
->RefreshRate
.Numerator
= wined3d_mode
->refresh_rate
;
47 mode
->RefreshRate
.Denominator
= 1;
48 mode
->Format
= dxgi_format_from_wined3dformat(wined3d_mode
->format_id
);
49 mode
->ScanlineOrdering
= dxgi_mode_scanline_order_from_wined3d(wined3d_mode
->scanline_ordering
);
50 mode
->Scaling
= DXGI_MODE_SCALING_UNSPECIFIED
; /* FIXME */
51 mode
->Stereo
= FALSE
; /* FIXME */
54 static HRESULT
dxgi_output_find_closest_matching_mode(struct dxgi_output
*output
,
55 struct wined3d_display_mode
*mode
, IUnknown
*device
)
59 if (!mode
->width
!= !mode
->height
)
60 return DXGI_ERROR_INVALID_CALL
;
62 if (mode
->format_id
== WINED3DFMT_UNKNOWN
&& !device
)
63 return DXGI_ERROR_INVALID_CALL
;
65 if (mode
->format_id
== WINED3DFMT_UNKNOWN
)
67 FIXME("Matching formats to device not implemented.\n");
72 hr
= wined3d_output_find_closest_matching_mode(output
->wined3d_output
, mode
);
73 wined3d_mutex_unlock();
78 static int dxgi_mode_desc_compare(const void *l
, const void *r
)
80 const DXGI_MODE_DESC
*left
= l
, *right
= r
;
83 if (left
->Width
!= right
->Width
)
84 return left
->Width
- right
->Width
;
86 if (left
->Height
!= right
->Height
)
87 return left
->Height
- right
->Height
;
89 a
= left
->RefreshRate
.Numerator
* right
->RefreshRate
.Denominator
;
90 b
= right
->RefreshRate
.Numerator
* left
->RefreshRate
.Denominator
;
97 enum dxgi_mode_struct_version
99 DXGI_MODE_STRUCT_VERSION_0
,
100 DXGI_MODE_STRUCT_VERSION_1
,
103 static HRESULT
dxgi_output_get_display_mode_list(struct dxgi_output
*output
,
104 DXGI_FORMAT format
, unsigned int *mode_count
, void *modes
,
105 enum dxgi_mode_struct_version struct_version
)
107 enum wined3d_format_id wined3d_format
;
108 struct wined3d_display_mode mode
;
109 unsigned int i
, max_count
;
113 return DXGI_ERROR_INVALID_CALL
;
115 if (format
== DXGI_FORMAT_UNKNOWN
)
121 wined3d_format
= wined3dformat_from_dxgi_format(format
);
123 wined3d_mutex_lock();
124 max_count
= wined3d_output_get_mode_count(output
->wined3d_output
,
125 wined3d_format
, WINED3D_SCANLINE_ORDERING_UNKNOWN
);
129 wined3d_mutex_unlock();
130 *mode_count
= max_count
;
134 if (max_count
> *mode_count
)
136 wined3d_mutex_unlock();
137 return DXGI_ERROR_MORE_DATA
;
140 *mode_count
= max_count
;
142 for (i
= 0; i
< *mode_count
; ++i
)
144 if (FAILED(hr
= wined3d_output_get_mode(output
->wined3d_output
, wined3d_format
,
145 WINED3D_SCANLINE_ORDERING_UNKNOWN
, i
, &mode
)))
147 WARN("Failed to get output mode %u, hr %#x.\n", i
, hr
);
148 wined3d_mutex_unlock();
152 switch (struct_version
)
154 case DXGI_MODE_STRUCT_VERSION_0
:
156 DXGI_MODE_DESC
*desc
= modes
;
157 dxgi_mode_from_wined3d(&desc
[i
], &mode
);
161 case DXGI_MODE_STRUCT_VERSION_1
:
163 DXGI_MODE_DESC1
*desc
= modes
;
164 dxgi_mode1_from_wined3d(&desc
[i
], &mode
);
169 wined3d_mutex_unlock();
171 switch (struct_version
)
173 case DXGI_MODE_STRUCT_VERSION_0
:
174 qsort(modes
, *mode_count
, sizeof(DXGI_MODE_DESC
), dxgi_mode_desc_compare
);
176 case DXGI_MODE_STRUCT_VERSION_1
:
177 qsort(modes
, *mode_count
, sizeof(DXGI_MODE_DESC1
), dxgi_mode_desc_compare
);
184 static inline struct dxgi_output
*impl_from_IDXGIOutput6(IDXGIOutput6
*iface
)
186 return CONTAINING_RECORD(iface
, struct dxgi_output
, IDXGIOutput6_iface
);
189 /* IUnknown methods */
191 static HRESULT STDMETHODCALLTYPE
dxgi_output_QueryInterface(IDXGIOutput6
*iface
, REFIID iid
, void **object
)
193 TRACE("iface %p, iid %s, object %p.\n", iface
, debugstr_guid(iid
), object
);
195 if (IsEqualGUID(iid
, &IID_IDXGIOutput6
)
196 || IsEqualGUID(iid
, &IID_IDXGIOutput5
)
197 || IsEqualGUID(iid
, &IID_IDXGIOutput4
)
198 || IsEqualGUID(iid
, &IID_IDXGIOutput3
)
199 || IsEqualGUID(iid
, &IID_IDXGIOutput2
)
200 || IsEqualGUID(iid
, &IID_IDXGIOutput1
)
201 || IsEqualGUID(iid
, &IID_IDXGIOutput
)
202 || IsEqualGUID(iid
, &IID_IDXGIObject
)
203 || IsEqualGUID(iid
, &IID_IUnknown
))
205 IUnknown_AddRef(iface
);
210 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid
));
213 return E_NOINTERFACE
;
216 static ULONG STDMETHODCALLTYPE
dxgi_output_AddRef(IDXGIOutput6
*iface
)
218 struct dxgi_output
*output
= impl_from_IDXGIOutput6(iface
);
219 ULONG refcount
= InterlockedIncrement(&output
->refcount
);
221 TRACE("%p increasing refcount to %u.\n", output
, refcount
);
226 static ULONG STDMETHODCALLTYPE
dxgi_output_Release(IDXGIOutput6
*iface
)
228 struct dxgi_output
*output
= impl_from_IDXGIOutput6(iface
);
229 ULONG refcount
= InterlockedDecrement(&output
->refcount
);
231 TRACE("%p decreasing refcount to %u.\n", output
, refcount
);
235 wined3d_private_store_cleanup(&output
->private_store
);
236 IWineDXGIAdapter_Release(&output
->adapter
->IWineDXGIAdapter_iface
);
243 /* IDXGIObject methods */
245 static HRESULT STDMETHODCALLTYPE
dxgi_output_SetPrivateData(IDXGIOutput6
*iface
,
246 REFGUID guid
, UINT data_size
, const void *data
)
248 struct dxgi_output
*output
= impl_from_IDXGIOutput6(iface
);
250 TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface
, debugstr_guid(guid
), data_size
, data
);
252 return dxgi_set_private_data(&output
->private_store
, guid
, data_size
, data
);
255 static HRESULT STDMETHODCALLTYPE
dxgi_output_SetPrivateDataInterface(IDXGIOutput6
*iface
,
256 REFGUID guid
, const IUnknown
*object
)
258 struct dxgi_output
*output
= impl_from_IDXGIOutput6(iface
);
260 TRACE("iface %p, guid %s, object %p.\n", iface
, debugstr_guid(guid
), object
);
262 return dxgi_set_private_data_interface(&output
->private_store
, guid
, object
);
265 static HRESULT STDMETHODCALLTYPE
dxgi_output_GetPrivateData(IDXGIOutput6
*iface
,
266 REFGUID guid
, UINT
*data_size
, void *data
)
268 struct dxgi_output
*output
= impl_from_IDXGIOutput6(iface
);
270 TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface
, debugstr_guid(guid
), data_size
, data
);
272 return dxgi_get_private_data(&output
->private_store
, guid
, data_size
, data
);
275 static HRESULT STDMETHODCALLTYPE
dxgi_output_GetParent(IDXGIOutput6
*iface
,
276 REFIID riid
, void **parent
)
278 struct dxgi_output
*output
= impl_from_IDXGIOutput6(iface
);
280 TRACE("iface %p, riid %s, parent %p.\n", iface
, debugstr_guid(riid
), parent
);
282 return IWineDXGIAdapter_QueryInterface(&output
->adapter
->IWineDXGIAdapter_iface
, riid
, parent
);
285 /* IDXGIOutput methods */
287 static HRESULT STDMETHODCALLTYPE
dxgi_output_GetDesc(IDXGIOutput6
*iface
, DXGI_OUTPUT_DESC
*desc
)
289 struct dxgi_output
*output
= impl_from_IDXGIOutput6(iface
);
290 struct wined3d_output_desc wined3d_desc
;
291 enum wined3d_display_rotation rotation
;
292 struct wined3d_display_mode mode
;
295 TRACE("iface %p, desc %p.\n", iface
, desc
);
300 wined3d_mutex_lock();
301 hr
= wined3d_output_get_desc(output
->wined3d_output
, &wined3d_desc
);
304 WARN("Failed to get output desc, hr %#x.\n", hr
);
305 wined3d_mutex_unlock();
309 hr
= wined3d_output_get_display_mode(output
->wined3d_output
, &mode
, &rotation
);
312 WARN("Failed to get output display mode, hr %#x.\n", hr
);
313 wined3d_mutex_unlock();
316 wined3d_mutex_unlock();
318 memcpy(desc
->DeviceName
, wined3d_desc
.device_name
, sizeof(desc
->DeviceName
));
319 desc
->DesktopCoordinates
= wined3d_desc
.desktop_rect
;
320 desc
->AttachedToDesktop
= wined3d_desc
.attached_to_desktop
;
321 desc
->Rotation
= rotation
;
322 desc
->Monitor
= wined3d_desc
.monitor
;
327 static HRESULT STDMETHODCALLTYPE
dxgi_output_GetDisplayModeList(IDXGIOutput6
*iface
,
328 DXGI_FORMAT format
, UINT flags
, UINT
*mode_count
, DXGI_MODE_DESC
*modes
)
330 struct dxgi_output
*output
= impl_from_IDXGIOutput6(iface
);
332 FIXME("iface %p, format %s, flags %#x, mode_count %p, modes %p partial stub!\n",
333 iface
, debug_dxgi_format(format
), flags
, mode_count
, modes
);
335 return dxgi_output_get_display_mode_list(output
,
336 format
, mode_count
, modes
, DXGI_MODE_STRUCT_VERSION_0
);
339 static HRESULT STDMETHODCALLTYPE
dxgi_output_FindClosestMatchingMode(IDXGIOutput6
*iface
,
340 const DXGI_MODE_DESC
*mode
, DXGI_MODE_DESC
*closest_match
, IUnknown
*device
)
342 struct dxgi_output
*output
= impl_from_IDXGIOutput6(iface
);
343 struct wined3d_display_mode wined3d_mode
;
346 TRACE("iface %p, mode %p, closest_match %p, device %p.\n",
347 iface
, mode
, closest_match
, device
);
349 TRACE("Mode: %s.\n", debug_dxgi_mode(mode
));
351 wined3d_display_mode_from_dxgi(&wined3d_mode
, mode
);
352 hr
= dxgi_output_find_closest_matching_mode(output
, &wined3d_mode
, device
);
355 dxgi_mode_from_wined3d(closest_match
, &wined3d_mode
);
356 TRACE("Returning %s.\n", debug_dxgi_mode(closest_match
));
362 static HRESULT STDMETHODCALLTYPE
dxgi_output_WaitForVBlank(IDXGIOutput6
*iface
)
364 static BOOL once
= FALSE
;
367 FIXME("iface %p stub!\n", iface
);
369 TRACE("iface %p stub!\n", iface
);
374 static HRESULT STDMETHODCALLTYPE
dxgi_output_TakeOwnership(IDXGIOutput6
*iface
, IUnknown
*device
, BOOL exclusive
)
376 struct dxgi_output
*output
= impl_from_IDXGIOutput6(iface
);
379 TRACE("iface %p, device %p, exclusive %d.\n", iface
, device
, exclusive
);
382 return DXGI_ERROR_INVALID_CALL
;
384 wined3d_mutex_lock();
385 hr
= wined3d_output_take_ownership(output
->wined3d_output
, exclusive
);
386 wined3d_mutex_unlock();
391 static void STDMETHODCALLTYPE
dxgi_output_ReleaseOwnership(IDXGIOutput6
*iface
)
393 struct dxgi_output
*output
= impl_from_IDXGIOutput6(iface
);
395 TRACE("iface %p.\n", iface
);
397 wined3d_mutex_lock();
398 wined3d_output_release_ownership(output
->wined3d_output
);
399 wined3d_mutex_unlock();
402 static HRESULT STDMETHODCALLTYPE
dxgi_output_GetGammaControlCapabilities(IDXGIOutput6
*iface
,
403 DXGI_GAMMA_CONTROL_CAPABILITIES
*gamma_caps
)
407 TRACE("iface %p, gamma_caps %p.\n", iface
, gamma_caps
);
412 gamma_caps
->ScaleAndOffsetSupported
= FALSE
;
413 gamma_caps
->MaxConvertedValue
= 1.0f
;
414 gamma_caps
->MinConvertedValue
= 0.0f
;
415 gamma_caps
->NumGammaControlPoints
= 256;
417 for (i
= 0; i
< gamma_caps
->NumGammaControlPoints
; ++i
)
418 gamma_caps
->ControlPointPositions
[i
] = i
/ 255.0f
;
423 static WORD
uint16_from_float(float f
)
428 else if (f
> 65535.0f
)
434 static HRESULT STDMETHODCALLTYPE
dxgi_output_SetGammaControl(IDXGIOutput6
*iface
,
435 const DXGI_GAMMA_CONTROL
*gamma_control
)
437 struct dxgi_output
*output
= impl_from_IDXGIOutput6(iface
);
438 struct wined3d_gamma_ramp ramp
;
442 TRACE("iface %p, gamma_control %p.\n", iface
, gamma_control
);
444 if (gamma_control
->Scale
.Red
!= 1.0f
|| gamma_control
->Scale
.Green
!= 1.0f
|| gamma_control
->Scale
.Blue
!= 1.0f
)
445 FIXME("Ignoring unhandled scale {%.8e, %.8e, %.8e}.\n", gamma_control
->Scale
.Red
,
446 gamma_control
->Scale
.Green
, gamma_control
->Scale
.Blue
);
447 if (gamma_control
->Offset
.Red
!= 0.0f
|| gamma_control
->Offset
.Green
!= 0.0f
|| gamma_control
->Offset
.Blue
!= 0.0f
)
448 FIXME("Ignoring unhandled offset {%.8e, %.8e, %.8e}.\n", gamma_control
->Offset
.Red
,
449 gamma_control
->Offset
.Green
, gamma_control
->Offset
.Blue
);
451 for (i
= 0; i
< 256; ++i
)
453 p
= &gamma_control
->GammaCurve
[i
];
454 ramp
.red
[i
] = uint16_from_float(p
->Red
);
455 ramp
.green
[i
] = uint16_from_float(p
->Green
);
456 ramp
.blue
[i
] = uint16_from_float(p
->Blue
);
459 wined3d_mutex_lock();
460 wined3d_output_set_gamma_ramp(output
->wined3d_output
, &ramp
);
461 wined3d_mutex_unlock();
466 static HRESULT STDMETHODCALLTYPE
dxgi_output_GetGammaControl(IDXGIOutput6
*iface
,
467 DXGI_GAMMA_CONTROL
*gamma_control
)
469 FIXME("iface %p, gamma_control %p stub!\n", iface
, gamma_control
);
474 static HRESULT STDMETHODCALLTYPE
dxgi_output_SetDisplaySurface(IDXGIOutput6
*iface
, IDXGISurface
*surface
)
476 FIXME("iface %p, surface %p stub!\n", iface
, surface
);
481 static HRESULT STDMETHODCALLTYPE
dxgi_output_GetDisplaySurfaceData(IDXGIOutput6
*iface
, IDXGISurface
*surface
)
483 FIXME("iface %p, surface %p stub!\n", iface
, surface
);
488 static HRESULT STDMETHODCALLTYPE
dxgi_output_GetFrameStatistics(IDXGIOutput6
*iface
, DXGI_FRAME_STATISTICS
*stats
)
490 FIXME("iface %p, stats %p stub!\n", iface
, stats
);
495 /* IDXGIOutput1 methods */
497 static HRESULT STDMETHODCALLTYPE
dxgi_output_GetDisplayModeList1(IDXGIOutput6
*iface
,
498 DXGI_FORMAT format
, UINT flags
, UINT
*mode_count
, DXGI_MODE_DESC1
*modes
)
500 struct dxgi_output
*output
= impl_from_IDXGIOutput6(iface
);
502 FIXME("iface %p, format %s, flags %#x, mode_count %p, modes %p partial stub!\n",
503 iface
, debug_dxgi_format(format
), flags
, mode_count
, modes
);
505 return dxgi_output_get_display_mode_list(output
,
506 format
, mode_count
, modes
, DXGI_MODE_STRUCT_VERSION_1
);
509 static HRESULT STDMETHODCALLTYPE
dxgi_output_FindClosestMatchingMode1(IDXGIOutput6
*iface
,
510 const DXGI_MODE_DESC1
*mode
, DXGI_MODE_DESC1
*closest_match
, IUnknown
*device
)
512 struct dxgi_output
*output
= impl_from_IDXGIOutput6(iface
);
513 struct wined3d_display_mode wined3d_mode
;
516 TRACE("iface %p, mode %p, closest_match %p, device %p.\n",
517 iface
, mode
, closest_match
, device
);
519 TRACE("Mode: %s.\n", debug_dxgi_mode1(mode
));
521 wined3d_display_mode_from_dxgi1(&wined3d_mode
, mode
);
522 hr
= dxgi_output_find_closest_matching_mode(output
, &wined3d_mode
, device
);
525 dxgi_mode1_from_wined3d(closest_match
, &wined3d_mode
);
526 TRACE("Returning %s.\n", debug_dxgi_mode1(closest_match
));
532 static HRESULT STDMETHODCALLTYPE
dxgi_output_GetDisplaySurfaceData1(IDXGIOutput6
*iface
,
533 IDXGIResource
*resource
)
535 FIXME("iface %p, resource %p stub!\n", iface
, resource
);
540 static HRESULT STDMETHODCALLTYPE
dxgi_output_DuplicateOutput(IDXGIOutput6
*iface
,
541 IUnknown
*device
, IDXGIOutputDuplication
**output_duplication
)
543 FIXME("iface %p, device %p, output_duplication %p stub!\n", iface
, device
, output_duplication
);
548 /* IDXGIOutput2 methods */
550 static BOOL STDMETHODCALLTYPE
dxgi_output_SupportsOverlays(IDXGIOutput6
*iface
)
552 FIXME("iface %p stub!\n", iface
);
557 /* IDXGIOutput3 methods */
559 static HRESULT STDMETHODCALLTYPE
dxgi_output_CheckOverlaySupport(IDXGIOutput6
*iface
,
560 DXGI_FORMAT format
, IUnknown
*device
, UINT
*flags
)
562 FIXME("iface %p, format %#x, device %p, flags %p stub!\n", iface
, format
, device
, flags
);
567 /* IDXGIOutput4 methods */
569 static HRESULT STDMETHODCALLTYPE
dxgi_output_CheckOverlayColorSpaceSupport(IDXGIOutput6
*iface
,
570 DXGI_FORMAT format
, DXGI_COLOR_SPACE_TYPE color_space
, IUnknown
*device
, UINT
*flags
)
572 FIXME("iface %p, format %#x, color_space %#x, device %p, flags %p stub!\n",
573 iface
, format
, color_space
, device
, flags
);
578 /* IDXGIOutput5 methods */
580 static HRESULT STDMETHODCALLTYPE
dxgi_output_DuplicateOutput1(IDXGIOutput6
*iface
,
581 IUnknown
*device
, UINT flags
, UINT format_count
, const DXGI_FORMAT
*formats
,
582 IDXGIOutputDuplication
**output_duplication
)
584 FIXME("iface %p, device %p, flags %#x, format_count %u, formats %p, "
585 "output_duplication %p stub!\n", iface
, device
, flags
, format_count
,
586 formats
, output_duplication
);
591 /* IDXGIOutput6 methods */
593 static HRESULT STDMETHODCALLTYPE
dxgi_output_GetDesc1(IDXGIOutput6
*iface
,
594 DXGI_OUTPUT_DESC1
*desc
)
596 struct dxgi_output
*output
= impl_from_IDXGIOutput6(iface
);
597 struct wined3d_output_desc wined3d_desc
;
598 enum wined3d_display_rotation rotation
;
599 struct wined3d_display_mode mode
;
602 FIXME("iface %p, desc %p semi-stub!\n", iface
, desc
);
607 wined3d_mutex_lock();
608 hr
= wined3d_output_get_desc(output
->wined3d_output
, &wined3d_desc
);
611 WARN("Failed to get output desc, hr %#x.\n", hr
);
612 wined3d_mutex_unlock();
616 hr
= wined3d_output_get_display_mode(output
->wined3d_output
, &mode
, &rotation
);
619 WARN("Failed to get output display mode, hr %#x.\n", hr
);
620 wined3d_mutex_unlock();
623 wined3d_mutex_unlock();
627 WARN("Failed to get output desc, hr %#x.\n", hr
);
631 memcpy(desc
->DeviceName
, wined3d_desc
.device_name
, sizeof(desc
->DeviceName
));
632 desc
->DesktopCoordinates
= wined3d_desc
.desktop_rect
;
633 desc
->AttachedToDesktop
= wined3d_desc
.attached_to_desktop
;
634 desc
->Rotation
= rotation
;
635 desc
->Monitor
= wined3d_desc
.monitor
;
637 /* FIXME: fill this from monitor EDID */
638 desc
->BitsPerColor
= 0;
639 desc
->ColorSpace
= DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
;
640 desc
->RedPrimary
[0] = 0.f
;
641 desc
->RedPrimary
[1] = 0.f
;
642 desc
->GreenPrimary
[0] = 0.f
;
643 desc
->GreenPrimary
[1] = 0.f
;
644 desc
->BluePrimary
[0] = 0.f
;
645 desc
->BluePrimary
[1] = 0.f
;
646 desc
->WhitePoint
[0] = 0.f
;
647 desc
->WhitePoint
[1] = 0.f
;
648 desc
->MinLuminance
= 0.f
;
649 desc
->MaxLuminance
= 0.f
;
650 desc
->MaxFullFrameLuminance
= 0.f
;
655 static HRESULT STDMETHODCALLTYPE
dxgi_output_CheckHardwareCompositionSupport(IDXGIOutput6
*iface
,
658 FIXME("iface %p, flags %p stub!\n", iface
, flags
);
663 static const struct IDXGIOutput6Vtbl dxgi_output_vtbl
=
665 dxgi_output_QueryInterface
,
668 /* IDXGIObject methods */
669 dxgi_output_SetPrivateData
,
670 dxgi_output_SetPrivateDataInterface
,
671 dxgi_output_GetPrivateData
,
672 dxgi_output_GetParent
,
673 /* IDXGIOutput methods */
675 dxgi_output_GetDisplayModeList
,
676 dxgi_output_FindClosestMatchingMode
,
677 dxgi_output_WaitForVBlank
,
678 dxgi_output_TakeOwnership
,
679 dxgi_output_ReleaseOwnership
,
680 dxgi_output_GetGammaControlCapabilities
,
681 dxgi_output_SetGammaControl
,
682 dxgi_output_GetGammaControl
,
683 dxgi_output_SetDisplaySurface
,
684 dxgi_output_GetDisplaySurfaceData
,
685 dxgi_output_GetFrameStatistics
,
686 /* IDXGIOutput1 methods */
687 dxgi_output_GetDisplayModeList1
,
688 dxgi_output_FindClosestMatchingMode1
,
689 dxgi_output_GetDisplaySurfaceData1
,
690 dxgi_output_DuplicateOutput
,
691 /* IDXGIOutput2 methods */
692 dxgi_output_SupportsOverlays
,
693 /* IDXGIOutput3 methods */
694 dxgi_output_CheckOverlaySupport
,
695 /* IDXGIOutput4 methods */
696 dxgi_output_CheckOverlayColorSpaceSupport
,
697 /* IDXGIOutput5 methods */
698 dxgi_output_DuplicateOutput1
,
699 /* IDXGIOutput6 methods */
700 dxgi_output_GetDesc1
,
701 dxgi_output_CheckHardwareCompositionSupport
,
704 struct dxgi_output
*unsafe_impl_from_IDXGIOutput(IDXGIOutput
*iface
)
708 assert(iface
->lpVtbl
== (IDXGIOutputVtbl
*)&dxgi_output_vtbl
);
709 return CONTAINING_RECORD(iface
, struct dxgi_output
, IDXGIOutput6_iface
);
712 static void dxgi_output_init(struct dxgi_output
*output
, unsigned int output_idx
,
713 struct dxgi_adapter
*adapter
)
715 output
->IDXGIOutput6_iface
.lpVtbl
= &dxgi_output_vtbl
;
716 output
->refcount
= 1;
717 output
->wined3d_output
= wined3d_adapter_get_output(adapter
->wined3d_adapter
, output_idx
);
718 wined3d_private_store_init(&output
->private_store
);
719 output
->adapter
= adapter
;
720 IWineDXGIAdapter_AddRef(&output
->adapter
->IWineDXGIAdapter_iface
);
723 HRESULT
dxgi_output_create(struct dxgi_adapter
*adapter
, unsigned int output_idx
,
724 struct dxgi_output
**output
)
726 if (!(*output
= heap_alloc_zero(sizeof(**output
))))
727 return E_OUTOFMEMORY
;
729 dxgi_output_init(*output
, output_idx
, adapter
);