dxgi: Introduce a helper function to convert wined3d multisample info to dxgi.

This commit is contained in:
Henri Verbeet 2015-08-06 00:21:56 +02:00 committed by Alexandre Julliard
parent fbc8f59629
commit d29f263c79
3 changed files with 10 additions and 2 deletions

View File

@ -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 dxgi_sample_desc_from_wined3d(DXGI_SAMPLE_DESC *desc,
enum wined3d_multisample_type wined3d_type, unsigned int wined3d_quality) 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,

View File

@ -205,8 +205,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetDesc(IDXGISwapChain *iface, D
desc->BufferDesc.Format = dxgi_format_from_wined3dformat(wined3d_desc.backbuffer_format);
desc->BufferDesc.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED;
desc->BufferDesc.Scaling = DXGI_MODE_SCALING_UNSPECIFIED;
desc->SampleDesc.Count = wined3d_desc.multisample_type;
desc->SampleDesc.Quality = wined3d_desc.multisample_quality;
dxgi_sample_desc_from_wined3d(&desc->SampleDesc, wined3d_desc.multisample_type, wined3d_desc.multisample_quality);
desc->BufferCount = wined3d_desc.backbuffer_count;
desc->OutputWindow = wined3d_desc.device_window;
desc->Windowed = wined3d_desc.windowed;

View File

@ -325,6 +325,13 @@ 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)
{
desc->Count = wined3d_type == WINED3D_MULTISAMPLE_NONE ? 1 : wined3d_type;
desc->Quality = wined3d_quality;
}
void wined3d_sample_desc_from_dxgi(enum wined3d_multisample_type *wined3d_type,
unsigned int *wined3d_quality, const DXGI_SAMPLE_DESC *dxgi_desc)
{