From 7402e8116c20496375a15506f56159a4b3b9edde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Fri, 22 Apr 2016 11:18:42 +0200 Subject: [PATCH] dxgi: Trace requested feature levels. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Józef Kucia Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/dxgi/dxgi_main.c | 16 ++++++++++------ dlls/dxgi/dxgi_private.h | 1 + dlls/dxgi/utils.c | 15 +++++++++++++++ 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/dlls/dxgi/dxgi_main.c b/dlls/dxgi/dxgi_main.c index a4c1362e80c..8a39d931a75 100644 --- a/dlls/dxgi/dxgi_main.c +++ b/dlls/dxgi/dxgi_main.c @@ -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) { struct layer_get_size_args get_size_args; - struct dxgi_device *dxgi_device; struct dxgi_device_layer d3d10_layer; + struct dxgi_device *dxgi_device; UINT device_size; DWORD count; 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", 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); 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; } 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; } @@ -156,7 +160,7 @@ HRESULT WINAPI DXGID3D10CreateDevice(HMODULE d3d10core, IDXGIFactory *factory, I hr = d3d10_layer.init(d3d10_layer.id, &count, NULL); if (FAILED(hr)) { - WARN("Failed to initialize D3D10 device layer\n"); + WARN("Failed to initialize D3D10 device layer.\n"); return E_FAIL; } @@ -176,7 +180,7 @@ HRESULT WINAPI DXGID3D10CreateDevice(HMODULE d3d10core, IDXGIFactory *factory, I dxgi_device = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, device_size); if (!dxgi_device) { - ERR("Failed to allocate device memory\n"); + ERR("Failed to allocate device memory.\n"); return E_OUTOFMEMORY; } diff --git a/dlls/dxgi/dxgi_private.h b/dlls/dxgi/dxgi_private.h index 129f6b42bee..804ae99bf94 100644 --- a/dlls/dxgi/dxgi_private.h +++ b/dlls/dxgi/dxgi_private.h @@ -79,6 +79,7 @@ struct dxgi_device_layer /* TRACE helper functions */ 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; enum wined3d_format_id wined3dformat_from_dxgi_format(DXGI_FORMAT format) DECLSPEC_HIDDEN; diff --git a/dlls/dxgi/utils.c b/dlls/dxgi/utils.c index c0c1fcd8a8d..c01dd9ba046 100644 --- a/dlls/dxgi/utils.c +++ b/dlls/dxgi/utils.c @@ -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, enum wined3d_multisample_type wined3d_type, unsigned int wined3d_quality) {