dxgi: Trace requested feature levels.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2016-04-22 11:18:42 +02:00 committed by Alexandre Julliard
parent 1bb1824e7e
commit 7402e8116c
3 changed files with 26 additions and 6 deletions

View File

@ -128,8 +128,8 @@ HRESULT WINAPI DXGID3D10CreateDevice(HMODULE d3d10core, IDXGIFactory *factory, I
unsigned int flags, const D3D_FEATURE_LEVEL *feature_levels, unsigned int level_count, void **device) unsigned int flags, const D3D_FEATURE_LEVEL *feature_levels, unsigned int level_count, void **device)
{ {
struct layer_get_size_args get_size_args; struct layer_get_size_args get_size_args;
struct dxgi_device *dxgi_device;
struct dxgi_device_layer d3d10_layer; struct dxgi_device_layer d3d10_layer;
struct dxgi_device *dxgi_device;
UINT device_size; UINT device_size;
DWORD count; DWORD count;
HRESULT hr; HRESULT hr;
@ -137,18 +137,22 @@ HRESULT WINAPI DXGID3D10CreateDevice(HMODULE d3d10core, IDXGIFactory *factory, I
TRACE("d3d10core %p, factory %p, adapter %p, flags %#x, feature_levels %p, level_count %u, device %p.\n", TRACE("d3d10core %p, factory %p, adapter %p, flags %#x, feature_levels %p, level_count %u, device %p.\n",
d3d10core, factory, adapter, flags, feature_levels, level_count, device); d3d10core, factory, adapter, flags, feature_levels, level_count, device);
FIXME("Ignoring flags.\n"); if (flags)
FIXME("Ignoring flags %#x.\n", flags);
if (TRACE_ON(dxgi))
dump_feature_levels(feature_levels, level_count);
hr = register_d3d10core_layers(d3d10core); hr = register_d3d10core_layers(d3d10core);
if (FAILED(hr)) if (FAILED(hr))
{ {
ERR("Failed to register d3d10core layers, returning %#x\n", hr); ERR("Failed to register d3d10core layers, returning %#x.\n", hr);
return hr; return hr;
} }
if (!get_layer(DXGI_DEVICE_LAYER_D3D10_DEVICE, &d3d10_layer)) if (!get_layer(DXGI_DEVICE_LAYER_D3D10_DEVICE, &d3d10_layer))
{ {
ERR("Failed to get D3D10 device layer\n"); ERR("Failed to get D3D10 device layer.\n");
return E_FAIL; return E_FAIL;
} }
@ -156,7 +160,7 @@ HRESULT WINAPI DXGID3D10CreateDevice(HMODULE d3d10core, IDXGIFactory *factory, I
hr = d3d10_layer.init(d3d10_layer.id, &count, NULL); hr = d3d10_layer.init(d3d10_layer.id, &count, NULL);
if (FAILED(hr)) if (FAILED(hr))
{ {
WARN("Failed to initialize D3D10 device layer\n"); WARN("Failed to initialize D3D10 device layer.\n");
return E_FAIL; return E_FAIL;
} }
@ -176,7 +180,7 @@ HRESULT WINAPI DXGID3D10CreateDevice(HMODULE d3d10core, IDXGIFactory *factory, I
dxgi_device = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, device_size); dxgi_device = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, device_size);
if (!dxgi_device) if (!dxgi_device)
{ {
ERR("Failed to allocate device memory\n"); ERR("Failed to allocate device memory.\n");
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }

View File

@ -79,6 +79,7 @@ struct dxgi_device_layer
/* TRACE helper functions */ /* TRACE helper functions */
const char *debug_dxgi_format(DXGI_FORMAT format) DECLSPEC_HIDDEN; const char *debug_dxgi_format(DXGI_FORMAT format) DECLSPEC_HIDDEN;
void dump_feature_levels(const D3D_FEATURE_LEVEL *feature_levels, unsigned int level_count) DECLSPEC_HIDDEN;
DXGI_FORMAT dxgi_format_from_wined3dformat(enum wined3d_format_id 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; enum wined3d_format_id wined3dformat_from_dxgi_format(DXGI_FORMAT format) DECLSPEC_HIDDEN;

View File

@ -364,6 +364,21 @@ enum wined3d_format_id wined3dformat_from_dxgi_format(DXGI_FORMAT format)
} }
} }
void dump_feature_levels(const D3D_FEATURE_LEVEL *feature_levels, unsigned int level_count)
{
unsigned int i;
if (!feature_levels || !level_count)
{
TRACE("Feature levels: (null).\n");
return;
}
TRACE("Feature levels (count = %u):\n", level_count);
for (i = 0; i < level_count; ++i)
TRACE(" [%u] = %s.\n", i, debug_feature_level(feature_levels[i]));
}
void dxgi_sample_desc_from_wined3d(DXGI_SAMPLE_DESC *desc, void dxgi_sample_desc_from_wined3d(DXGI_SAMPLE_DESC *desc,
enum wined3d_multisample_type wined3d_type, unsigned int wined3d_quality) enum wined3d_multisample_type wined3d_type, unsigned int wined3d_quality)
{ {