dxgi: Introduce a helper function to convert dxgi multisample info to wined3d.
This commit is contained in:
parent
7f29d994ad
commit
fbc8f59629
|
@ -185,8 +185,8 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_CreateSurface(IWineDXGIDevice *ifac
|
|||
FIXME("Implement DXGI<->wined3d usage conversion\n");
|
||||
surface_desc.resource_type = WINED3D_RTYPE_SURFACE;
|
||||
surface_desc.format = wined3dformat_from_dxgi_format(desc->Format);
|
||||
surface_desc.multisample_type = desc->SampleDesc.Count > 1 ? desc->SampleDesc.Count : WINED3D_MULTISAMPLE_NONE;
|
||||
surface_desc.multisample_quality = desc->SampleDesc.Quality;
|
||||
wined3d_sample_desc_from_dxgi(&surface_desc.multisample_type,
|
||||
&surface_desc.multisample_quality, &desc->SampleDesc);
|
||||
surface_desc.usage = usage;
|
||||
surface_desc.pool = WINED3D_POOL_DEFAULT;
|
||||
surface_desc.width = desc->Width;
|
||||
|
|
|
@ -76,6 +76,8 @@ const char *debug_dxgi_format(DXGI_FORMAT format) DECLSPEC_HIDDEN;
|
|||
|
||||
DXGI_FORMAT dxgi_format_from_wined3dformat(enum wined3d_format_id format) DECLSPEC_HIDDEN;
|
||||
enum wined3d_format_id wined3dformat_from_dxgi_format(DXGI_FORMAT format) DECLSPEC_HIDDEN;
|
||||
void wined3d_sample_desc_from_dxgi(enum wined3d_multisample_type *wined3d_type,
|
||||
unsigned int *wined3d_quality, const DXGI_SAMPLE_DESC *dxgi_desc) DECLSPEC_HIDDEN;
|
||||
HRESULT dxgi_get_private_data(struct wined3d_private_store *store,
|
||||
REFGUID guid, UINT *data_size, void *data) DECLSPEC_HIDDEN;
|
||||
HRESULT dxgi_set_private_data(struct wined3d_private_store *store,
|
||||
|
|
|
@ -211,16 +211,8 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSwapChain(IDXGIFactory1 *ifa
|
|||
wined3d_desc.backbuffer_height = desc->BufferDesc.Height;
|
||||
wined3d_desc.backbuffer_format = wined3dformat_from_dxgi_format(desc->BufferDesc.Format);
|
||||
wined3d_desc.backbuffer_count = desc->BufferCount;
|
||||
if (desc->SampleDesc.Count > 1)
|
||||
{
|
||||
wined3d_desc.multisample_type = desc->SampleDesc.Count;
|
||||
wined3d_desc.multisample_quality = desc->SampleDesc.Quality;
|
||||
}
|
||||
else
|
||||
{
|
||||
wined3d_desc.multisample_type = WINED3D_MULTISAMPLE_NONE;
|
||||
wined3d_desc.multisample_quality = 0;
|
||||
}
|
||||
wined3d_sample_desc_from_dxgi(&wined3d_desc.multisample_type,
|
||||
&wined3d_desc.multisample_quality, &desc->SampleDesc);
|
||||
wined3d_desc.swap_effect = WINED3D_SWAP_EFFECT_DISCARD;
|
||||
wined3d_desc.device_window = desc->OutputWindow;
|
||||
wined3d_desc.windowed = desc->Windowed;
|
||||
|
|
|
@ -325,6 +325,21 @@ enum wined3d_format_id wined3dformat_from_dxgi_format(DXGI_FORMAT format)
|
|||
}
|
||||
}
|
||||
|
||||
void wined3d_sample_desc_from_dxgi(enum wined3d_multisample_type *wined3d_type,
|
||||
unsigned int *wined3d_quality, const DXGI_SAMPLE_DESC *dxgi_desc)
|
||||
{
|
||||
if (dxgi_desc->Count > 1)
|
||||
{
|
||||
*wined3d_type = dxgi_desc->Count;
|
||||
*wined3d_quality = dxgi_desc->Quality;
|
||||
}
|
||||
else
|
||||
{
|
||||
*wined3d_type = WINED3D_MULTISAMPLE_NONE;
|
||||
*wined3d_quality = 0;
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT dxgi_get_private_data(struct wined3d_private_store *store,
|
||||
REFGUID guid, UINT *data_size, void *data)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue