Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
July 2021
- 86 participants
- 1756 messages
Re: [PATCH] wined3d: Negiotiate less specific memory types on allocation failure.
by Jan Sikorski
> On 29 Jul 2021, at 18:36, Zebediah Figura (she/her) <zfigura(a)codeweavers.com> wrote:
>
> This will still spew an ERR message, though, which seems less than ideal.
Maybe “Failed to find a suitable memory type” could be a WARN instead? I think other failures could stay ERR. I’d upgrade to an ERR at the call site as well.
> Also, the while loop seems awkward to me, couldn't we instead do something like (abbreviated):
>
> if (!wined3d_context_vk_create_bo(memory_type)
> && !wined3d_context_vk_create_bo(memory_type & ~HOST_CACHED)
> && !wined3d_context_vk_create_bo(memory_type & ~DEVICE_LOCAL))
Yeah, it isn’t exactly equivalent (the loop could go DCV -> DV -> VC -> V), but I guess the last step isn’t helping much. I’ll do the simplified thing in v2.
- Jan
July 30, 2021
[PATCH v2] user32: Fix the logical problem that the client window is a Unicode window and still goes A->W.
by Haidong Yu
July 30, 2021
Re: [PATCH] mfplat/allocator: Handle D3D11 resource sharing mode configuration attributes.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=94732
Your paranoid android.
=== w1064 (testbot log) ===
WineRunTask.pl:error: The previous 1 run(s) terminated abnormally
July 30, 2021
Re: [PATCH] d3d11/tests: Test 2D texture creation with mutually exclusive sharing modes.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=94731
Your paranoid android.
=== w1064v1809 (32 bit report) ===
d3d11:
d3d11.c:5918: Test failed: Got unexpected IAVertices count: 0.
d3d11.c:5919: Test failed: Got unexpected IAPrimitives count: 0.
d3d11.c:5920: Test failed: Got unexpected VSInvocations count: 0.
d3d11.c:5923: Test failed: Got unexpected CInvocations count: 0.
d3d11.c:5924: Test failed: Got unexpected CPrimitives count: 0.
=== debiant2 (32 bit Hindi:India report) ===
d3d11:
d3d11.c:9768: Test failed: d3d11.c:15151: Test marked todo: Got hr 0 for WRITE_DISCARD.
July 30, 2021
[PATCH] mfplat/allocator: Handle D3D11 resource sharing mode configuration attributes.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/mfplat/sample.c | 11 ++++++-
dlls/mfplat/tests/mfplat.c | 67 ++++++++++++++++++++++++++++++++++++++
2 files changed, 77 insertions(+), 1 deletion(-)
diff --git a/dlls/mfplat/sample.c b/dlls/mfplat/sample.c
index 09c65b5fcf1..d99e2b046a6 100644
--- a/dlls/mfplat/sample.c
+++ b/dlls/mfplat/sample.c
@@ -74,6 +74,7 @@ struct sample_allocator
DXGI_FORMAT dxgi_format;
unsigned int usage;
unsigned int bindflags;
+ unsigned int miscflags;
unsigned int buffer_count;
} frame_desc;
@@ -1352,6 +1353,7 @@ static HRESULT sample_allocator_allocate_sample(struct sample_allocator *allocat
desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
else if (desc.Usage == D3D11_USAGE_STAGING)
desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE | D3D11_CPU_ACCESS_READ;
+ desc.MiscFlags = allocator->frame_desc.miscflags;
if (SUCCEEDED(hr = ID3D11Device_CreateTexture2D(service->d3d11_device, &desc, NULL, &texture)))
{
@@ -1380,7 +1382,7 @@ static HRESULT sample_allocator_initialize(struct sample_allocator *allocator, u
{
struct surface_service service;
DXGI_FORMAT dxgi_format;
- unsigned int i;
+ unsigned int i, value;
GUID major, subtype;
UINT64 frame_size;
IMFSample *sample;
@@ -1415,6 +1417,7 @@ static HRESULT sample_allocator_initialize(struct sample_allocator *allocator, u
dxgi_format = MFMapDX9FormatToDXGIFormat(subtype.Data1);
allocator->frame_desc.bindflags = 0;
+ allocator->frame_desc.miscflags = 0;
allocator->frame_desc.usage = D3D11_USAGE_DEFAULT;
if (dxgi_format == DXGI_FORMAT_B8G8R8A8_UNORM ||
@@ -1428,7 +1431,13 @@ static HRESULT sample_allocator_initialize(struct sample_allocator *allocator, u
}
if (attributes)
+ {
IMFAttributes_GetUINT32(attributes, &MF_SA_D3D11_BINDFLAGS, &allocator->frame_desc.bindflags);
+ if (SUCCEEDED(IMFAttributes_GetUINT32(attributes, &MF_SA_D3D11_SHARED, &value)) && value)
+ allocator->frame_desc.miscflags |= D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX;
+ if (SUCCEEDED(IMFAttributes_GetUINT32(attributes, &MF_SA_D3D11_SHARED_WITHOUT_MUTEX, &value)) && value)
+ allocator->frame_desc.miscflags |= D3D11_RESOURCE_MISC_SHARED;
+ }
sample_allocator_set_media_type(allocator, media_type);
sample_allocator_set_attributes(allocator, attributes);
diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c
index f1c041b7eb4..3e0907e41ad 100644
--- a/dlls/mfplat/tests/mfplat.c
+++ b/dlls/mfplat/tests/mfplat.c
@@ -6798,6 +6798,12 @@ static void test_sample_allocator(void)
D3D11_USAGE_STAGING,
D3D11_USAGE_STAGING + 1,
};
+ static const unsigned int sharing[] =
+ {
+ D3D11_RESOURCE_MISC_SHARED | D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX,
+ D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX,
+ D3D11_RESOURCE_MISC_SHARED,
+ };
if (!pMFCreateVideoSampleAllocatorEx)
{
@@ -7155,6 +7161,67 @@ todo_wine
IMFVideoSampleAllocatorEx_Release(allocatorex);
}
+ /* MF_SA_D3D11_SHARED, MF_SA_D3D11_SHARED_WITHOUT_MUTEX */
+ for (i = 0; i < ARRAY_SIZE(sharing); ++i)
+ {
+ hr = pMFCreateVideoSampleAllocatorEx(&IID_IMFVideoSampleAllocatorEx, (void **)&allocatorex);
+ ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+
+ hr = IMFVideoSampleAllocatorEx_SetDirectXManager(allocatorex, (IUnknown *)manager);
+ ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+
+ hr = IMFAttributes_DeleteAllItems(attributes);
+ ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+
+ hr = IMFAttributes_SetUINT32(attributes, &MF_SA_D3D11_USAGE, D3D11_USAGE_DEFAULT);
+ ok(hr == S_OK, "Failed to set attribute, hr %#x.\n", hr);
+
+ if (sharing[i] & D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX)
+ {
+ hr = IMFAttributes_SetUINT32(attributes, &MF_SA_D3D11_SHARED, TRUE);
+ ok(hr == S_OK, "Failed to set attribute, hr %#x.\n", hr);
+ }
+
+ if (sharing[i] & D3D11_RESOURCE_MISC_SHARED)
+ {
+ hr = IMFAttributes_SetUINT32(attributes, &MF_SA_D3D11_SHARED_WITHOUT_MUTEX, TRUE);
+ ok(hr == S_OK, "Failed to set attribute, hr %#x.\n", hr);
+ }
+
+ hr = IMFVideoSampleAllocatorEx_InitializeSampleAllocatorEx(allocatorex, 0, 0, attributes, video_type);
+ if (sharing[i] == (D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX | D3D11_RESOURCE_MISC_SHARED))
+ {
+ todo_wine
+ ok(hr == E_INVALIDARG, "%u: Unexpected hr %#x.\n", i, hr);
+ IMFVideoSampleAllocatorEx_Release(allocatorex);
+ continue;
+ }
+ ok(hr == S_OK, "%u: Unexpected hr %#x.\n", i, hr);
+
+ hr = IMFVideoSampleAllocatorEx_AllocateSample(allocatorex, &sample);
+ ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+
+ hr = IMFSample_GetBufferByIndex(sample, 0, &buffer);
+ ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+
+ hr = IMFMediaBuffer_QueryInterface(buffer, &IID_IMFDXGIBuffer, (void **)&dxgi_buffer);
+ ok(hr == S_OK, "Failed to get interface, hr %#x.\n", hr);
+
+ hr = IMFDXGIBuffer_GetResource(dxgi_buffer, &IID_ID3D11Texture2D, (void **)&texture);
+ ok(hr == S_OK, "Failed to get resource, hr %#x.\n", hr);
+
+ ID3D11Texture2D_GetDesc(texture, &desc);
+ ok(desc.MiscFlags == sharing[i], "%u: unexpected misc flags %#x.\n", i, desc.MiscFlags);
+
+ ID3D11Texture2D_Release(texture);
+ IMFDXGIBuffer_Release(dxgi_buffer);
+ IMFMediaBuffer_Release(buffer);
+
+ IMFSample_Release(sample);
+
+ IMFVideoSampleAllocatorEx_Release(allocatorex);
+ }
+
IMFAttributes_Release(attributes);
IMFDXGIDeviceManager_Release(manager);
--
2.30.2
July 30, 2021
[PATCH] d3d11/tests: Test 2D texture creation with mutually exclusive sharing modes.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/d3d11/tests/d3d11.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index 2213e48e57c..3ea3de95709 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -2736,6 +2736,8 @@ static void test_create_texture2d(void)
{DXGI_FORMAT_R8G8B8A8_UINT, 1, D3D11_BIND_RENDER_TARGET, 0, TRUE, FALSE},
{DXGI_FORMAT_R8G8B8A8_SNORM, 1, D3D11_BIND_RENDER_TARGET, 0, TRUE, FALSE},
{DXGI_FORMAT_R8G8B8A8_SINT, 1, D3D11_BIND_RENDER_TARGET, 0, TRUE, FALSE},
+ {DXGI_FORMAT_R8G8B8A8_UNORM, 1, D3D11_BIND_RENDER_TARGET, D3D11_RESOURCE_MISC_SHARED | D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX,
+ FALSE, TRUE},
{DXGI_FORMAT_D24_UNORM_S8_UINT, 1, D3D11_BIND_SHADER_RESOURCE, 0, FALSE, TRUE},
{DXGI_FORMAT_D24_UNORM_S8_UINT, 1, D3D11_BIND_RENDER_TARGET, 0, FALSE, FALSE},
{DXGI_FORMAT_D32_FLOAT, 1, D3D11_BIND_SHADER_RESOURCE, 0, FALSE, TRUE},
--
2.30.2
July 30, 2021
Re: [PATCH 2/2] wined3d: Make use of VK_EXT_host_query_reset if available.
by Jan Sikorski
> On 29 Jul 2021, at 16:24, Henri Verbeet <hverbeet(a)gmail.com> wrote:
>
> On Wed, 28 Jul 2021 at 13:42, Jan Sikorski <jsikorski(a)codeweavers.com> wrote:
>> + if (VK_CALL(vkResetQueryPoolEXT))
>> + {
> I think that works, but I'd prefer a proper extension check along the
> lines of "if (vk_info->supported[WINED3D_VK_EXT_HOST_QUERY_RESET])",
> similar to what we do for e.g. VK_EXT_transform_feedback.
>
> Would it make sense to use this extension for vkd3d as well?
Looks like vkd3d could use a similar query handling upgrade - currently it halts the render pass each time a query is begun/ended, so just using host query reset won’t buy us anything.
- Jan
July 30, 2021
[PATCH v2] wined3d: Make use of VK_EXT_host_query_reset if available.
by Jan Sikorski
Signed-off-by: Jan Sikorski <jsikorski(a)codeweavers.com>
---
v2: add it to supported extensions table and check that
---
dlls/wined3d/adapter_vk.c | 10 +++++++++-
dlls/wined3d/context_vk.c | 14 +++++++++++---
dlls/wined3d/query.c | 26 ++++++++++++++++++++------
dlls/wined3d/wined3d_vk.h | 5 ++++-
4 files changed, 44 insertions(+), 11 deletions(-)
diff --git a/dlls/wined3d/adapter_vk.c b/dlls/wined3d/adapter_vk.c
index 850e2a6dfdb..c7da02865ea 100644
--- a/dlls/wined3d/adapter_vk.c
+++ b/dlls/wined3d/adapter_vk.c
@@ -313,6 +313,7 @@ struct wined3d_physical_device_info
{
VkPhysicalDeviceTransformFeedbackFeaturesEXT xfb_features;
VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT vertex_divisor_features;
+ VkPhysicalDeviceHostQueryResetFeatures host_query_reset_features;
VkPhysicalDeviceFeatures2 features2;
};
@@ -403,6 +404,7 @@ static HRESULT adapter_vk_create_device(struct wined3d *wined3d, const struct wi
{
const struct wined3d_adapter_vk *adapter_vk = wined3d_adapter_vk_const(adapter);
VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT *vertex_divisor_features;
+ VkPhysicalDeviceHostQueryResetFeatures *host_query_reset_features;
const struct wined3d_vk_info *vk_info = &adapter_vk->vk_info;
VkPhysicalDeviceTransformFeedbackFeaturesEXT *xfb_features;
struct wined3d_physical_device_info physical_device_info;
@@ -435,9 +437,13 @@ static HRESULT adapter_vk_create_device(struct wined3d *wined3d, const struct wi
vertex_divisor_features->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT;
vertex_divisor_features->pNext = xfb_features;
+ host_query_reset_features = &physical_device_info.host_query_reset_features;
+ host_query_reset_features->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES;
+ host_query_reset_features->pNext = vertex_divisor_features;
+
features2 = &physical_device_info.features2;
features2->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
- features2->pNext = vertex_divisor_features;
+ features2->pNext = host_query_reset_features;
if (vk_info->vk_ops.vkGetPhysicalDeviceFeatures2)
VK_CALL(vkGetPhysicalDeviceFeatures2(physical_device, features2));
@@ -2195,6 +2201,7 @@ static bool wined3d_adapter_vk_init_device_extensions(struct wined3d_adapter_vk
{VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_EXTENSION_NAME,VK_API_VERSION_1_2},
{VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME, VK_API_VERSION_1_1, true},
{VK_KHR_SWAPCHAIN_EXTENSION_NAME, ~0u, true},
+ {VK_EXT_HOST_QUERY_RESET_EXTENSION_NAME, VK_API_VERSION_1_2},
};
static const struct
@@ -2206,6 +2213,7 @@ static bool wined3d_adapter_vk_init_device_extensions(struct wined3d_adapter_vk
{
{VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME, WINED3D_VK_EXT_TRANSFORM_FEEDBACK},
{VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_EXTENSION_NAME, WINED3D_VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE},
+ {VK_EXT_HOST_QUERY_RESET_EXTENSION_NAME, WINED3D_VK_EXT_HOST_QUERY_RESET},
};
if ((vr = VK_CALL(vkEnumerateDeviceExtensionProperties(physical_device, NULL, &count, NULL))) < 0)
diff --git a/dlls/wined3d/context_vk.c b/dlls/wined3d/context_vk.c
index c718f3facd5..eac4eacff5a 100644
--- a/dlls/wined3d/context_vk.c
+++ b/dlls/wined3d/context_vk.c
@@ -1398,9 +1398,17 @@ bool wined3d_context_vk_allocate_query(struct wined3d_context_vk *context_vk,
return false;
}
- wined3d_context_vk_end_current_render_pass(context_vk);
- VK_CALL(vkCmdResetQueryPool(wined3d_context_vk_get_command_buffer(context_vk),
- pool_vk->vk_query_pool, 0, WINED3D_QUERY_POOL_SIZE));
+ if (vk_info->supported[WINED3D_VK_EXT_HOST_QUERY_RESET])
+ {
+ VK_CALL(vkResetQueryPoolEXT(wined3d_device_vk(context_vk->c.device)->vk_device,
+ pool_vk->vk_query_pool, 0, WINED3D_QUERY_POOL_SIZE));
+ }
+ else
+ {
+ wined3d_context_vk_end_current_render_pass(context_vk);
+ VK_CALL(vkCmdResetQueryPool(wined3d_context_vk_get_command_buffer(context_vk),
+ pool_vk->vk_query_pool, 0, WINED3D_QUERY_POOL_SIZE));
+ }
if (!wined3d_query_pool_vk_allocate_query(pool_vk, &idx))
{
diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
index 4628cb98cdc..527d5f6c809 100644
--- a/dlls/wined3d/query.c
+++ b/dlls/wined3d/query.c
@@ -1351,12 +1351,26 @@ HRESULT wined3d_query_gl_create(struct wined3d_device *device, enum wined3d_quer
static void wined3d_query_pool_vk_mark_complete(struct wined3d_query_pool_vk *pool_vk, size_t idx,
struct wined3d_context_vk *context_vk)
{
- /* Don't reset completed queries right away, as vkCmdResetQueryPool() needs to happen
- * outside of a render pass. Queue the query to be reset in wined3d_query_pool_vk_reset()
- * instead, which is called when the render pass ends. */
- wined3d_bitmap_set(pool_vk->completed, idx);
- if (list_empty(&pool_vk->completed_entry))
- list_add_tail(&context_vk->completed_query_pools, &pool_vk->completed_entry);
+ const struct wined3d_vk_info *vk_info = context_vk->vk_info;
+
+ if (vk_info->supported[WINED3D_VK_EXT_HOST_QUERY_RESET])
+ {
+ VK_CALL(vkResetQueryPoolEXT(wined3d_device_vk(context_vk->c.device)->vk_device,
+ pool_vk->vk_query_pool, idx, 1));
+
+ wined3d_bitmap_clear(pool_vk->allocated, idx);
+ if (list_empty(&pool_vk->entry))
+ list_add_tail(pool_vk->free_list, &pool_vk->entry);
+ }
+ else
+ {
+ /* Don't reset completed queries right away, as vkCmdResetQueryPool() needs to happen
+ * outside of a render pass. Queue the query to be reset in wined3d_query_pool_vk_reset()
+ * instead, which is called when the render pass ends. */
+ wined3d_bitmap_set(pool_vk->completed, idx);
+ if (list_empty(&pool_vk->completed_entry))
+ list_add_tail(&context_vk->completed_query_pools, &pool_vk->completed_entry);
+ }
}
bool wined3d_query_pool_vk_allocate_query(struct wined3d_query_pool_vk *pool_vk, size_t *idx)
diff --git a/dlls/wined3d/wined3d_vk.h b/dlls/wined3d/wined3d_vk.h
index a417a795901..91ef8c816cd 100644
--- a/dlls/wined3d/wined3d_vk.h
+++ b/dlls/wined3d/wined3d_vk.h
@@ -49,7 +49,9 @@
VK_INSTANCE_PFN(vkGetPhysicalDeviceSurfacePresentModesKHR) \
VK_INSTANCE_PFN(vkGetPhysicalDeviceSurfaceSupportKHR) \
/* VK_KHR_win32_surface */ \
- VK_INSTANCE_PFN(vkCreateWin32SurfaceKHR)
+ VK_INSTANCE_PFN(vkCreateWin32SurfaceKHR) \
+ /* VK_EXT_host_query_reset */ \
+ VK_INSTANCE_EXT_PFN(vkResetQueryPoolEXT)
#define VK_DEVICE_FUNCS() \
VK_DEVICE_PFN(vkAllocateCommandBuffers) \
@@ -210,6 +212,7 @@ enum wined3d_vk_extension
WINED3D_VK_EXT_TRANSFORM_FEEDBACK,
WINED3D_VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE,
+ WINED3D_VK_EXT_HOST_QUERY_RESET,
WINED3D_VK_EXT_COUNT,
};
--
2.30.2
July 30, 2021
[PATCH] d3dx11_43: Implement D3DX11GetImageInfoFromMemory
by Alistair Leslie-Hughes
Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=50210
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/d3dx11_42/Makefile.in | 1 +
dlls/d3dx11_43/Makefile.in | 1 +
dlls/d3dx11_43/main.c | 9 -
dlls/d3dx11_43/tests/d3dx11.c | 668 ++++++++++++++++++++++++++++++++++
dlls/d3dx11_43/texture.c | 176 +++++++++
5 files changed, 846 insertions(+), 9 deletions(-)
diff --git a/dlls/d3dx11_42/Makefile.in b/dlls/d3dx11_42/Makefile.in
index dbc31e2407d..410d4555d2f 100644
--- a/dlls/d3dx11_42/Makefile.in
+++ b/dlls/d3dx11_42/Makefile.in
@@ -1,6 +1,7 @@
EXTRADEFS = -DD3DX11_SDK_VERSION=42
MODULE = d3dx11_42.dll
IMPORTS = d3dcompiler
+DELAYIMPORTS = windowscodecs
PARENTSRC = ../d3dx11_43
EXTRADLLFLAGS = -mno-cygwin -Wb,--prefer-native
diff --git a/dlls/d3dx11_43/Makefile.in b/dlls/d3dx11_43/Makefile.in
index b69f3f1ce02..ed23958a671 100644
--- a/dlls/d3dx11_43/Makefile.in
+++ b/dlls/d3dx11_43/Makefile.in
@@ -2,6 +2,7 @@ EXTRADEFS = -DD3DX11_SDK_VERSION=43
MODULE = d3dx11_43.dll
IMPORTLIB = d3dx11
IMPORTS = d3dcompiler
+DELAYIMPORTS = windowscodecs
EXTRADLLFLAGS = -mno-cygwin -Wb,--prefer-native
diff --git a/dlls/d3dx11_43/main.c b/dlls/d3dx11_43/main.c
index 950f6d76f5c..00c1db35e42 100644
--- a/dlls/d3dx11_43/main.c
+++ b/dlls/d3dx11_43/main.c
@@ -66,12 +66,3 @@ HRESULT WINAPI D3DX11GetImageInfoFromFileW(const WCHAR *filename, ID3DX11ThreadP
return E_NOTIMPL;
}
-
-HRESULT WINAPI D3DX11GetImageInfoFromMemory(const void *src_data, SIZE_T src_data_size, ID3DX11ThreadPump *pump,
- D3DX11_IMAGE_INFO *img_info, HRESULT *hresult)
-{
- FIXME("src_data %p, src_data_size %lu, pump %p, img_info %p, hresult %p stub!\n",
- src_data, src_data_size, pump, img_info, hresult);
-
- return E_NOTIMPL;
-}
diff --git a/dlls/d3dx11_43/tests/d3dx11.c b/dlls/d3dx11_43/tests/d3dx11.c
index 06924877da4..a53c79a25b9 100644
--- a/dlls/d3dx11_43/tests/d3dx11.c
+++ b/dlls/d3dx11_43/tests/d3dx11.c
@@ -25,6 +25,646 @@
static WCHAR temp_dir[MAX_PATH];
+/* 1x1 1bpp bmp image */
+static const BYTE test_bmp_1bpp[] =
+{
+ 0x42, 0x4d, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x28, 0x00,
+ 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x02, 0x00,
+ 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf1, 0xf2, 0xf3, 0x80, 0xf4, 0xf5, 0xf6, 0x81, 0x00, 0x00,
+ 0x00, 0x00
+};
+static const BYTE test_bmp_1bpp_data[] =
+{
+ 0xf3, 0xf2, 0xf1, 0xff
+};
+
+/* 1x1 4bpp bmp image */
+static const BYTE test_bmp_4bpp[] =
+{
+ 0x42, 0x4d, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x28, 0x00,
+ 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x02, 0x00,
+ 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf1, 0xf2, 0xf3, 0x80, 0xf4, 0xf5, 0xf6, 0x81, 0x00, 0x00,
+ 0x00, 0x00
+};
+static const BYTE test_bmp_4bpp_data[] =
+{
+ 0xf3, 0xf2, 0xf1, 0xff
+};
+
+/* 1x1 8bpp bmp image */
+static const BYTE test_bmp_8bpp[] =
+{
+ 0x42, 0x4d, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x28, 0x00,
+ 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x02, 0x00,
+ 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf1, 0xf2, 0xf3, 0x80, 0xf4, 0xf5, 0xf6, 0x81, 0x00, 0x00,
+ 0x00, 0x00
+};
+static const BYTE test_bmp_8bpp_data[] =
+{
+ 0xf3, 0xf2, 0xf1, 0xff
+};
+
+/* 1x1 16bpp bmp image */
+static const BYTE test_bmp_16bpp[] =
+{
+ 0x42, 0x4d, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00,
+ 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x42, 0x00, 0x00, 0x00, 0x00
+};
+static const BYTE test_bmp_16bpp_data[] =
+{
+ 0x84, 0x84, 0x73, 0xff
+};
+
+/* 1x1 24bpp bmp image */
+static const BYTE test_bmp_24bpp[] =
+{
+ 0x42, 0x4d, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00,
+ 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x18, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x84, 0x84, 0x00, 0x00, 0x00
+};
+static const BYTE test_bmp_24bpp_data[] =
+{
+ 0x84, 0x84, 0x73, 0xff
+};
+
+/* 2x2 32bpp XRGB bmp image */
+static const BYTE test_bmp_32bpp_xrgb[] =
+{
+ 0x42, 0x4d, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00,
+ 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xb0, 0xc0, 0x00, 0xa1, 0xb1, 0xc1, 0x00, 0xa2, 0xb2,
+ 0xc2, 0x00, 0xa3, 0xb3, 0xc3, 0x00
+};
+static const BYTE test_bmp_32bpp_xrgb_data[] =
+{
+ 0xc2, 0xb2, 0xa2, 0xff, 0xc3, 0xb3, 0xa3, 0xff, 0xc0, 0xb0, 0xa0, 0xff, 0xc1, 0xb1, 0xa1, 0xff
+
+};
+
+/* 2x2 32bpp ARGB bmp image */
+static const BYTE test_bmp_32bpp_argb[] =
+{
+ 0x42, 0x4d, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00,
+ 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xb0, 0xc0, 0x00, 0xa1, 0xb1, 0xc1, 0x00, 0xa2, 0xb2,
+ 0xc2, 0x00, 0xa3, 0xb3, 0xc3, 0x01
+};
+static const BYTE test_bmp_32bpp_argb_data[] =
+{
+ 0xc2, 0xb2, 0xa2, 0xff, 0xc3, 0xb3, 0xa3, 0xff, 0xc0, 0xb0, 0xa0, 0xff, 0xc1, 0xb1, 0xa1, 0xff
+
+};
+
+/* 1x1 8bpp gray png image */
+static const BYTE test_png_8bpp_gray[] =
+{
+ 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
+ 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x7e, 0x9b,
+ 0x55, 0x00, 0x00, 0x00, 0x0a, 0x49, 0x44, 0x41, 0x54, 0x08, 0xd7, 0x63, 0xf8, 0x0f, 0x00, 0x01,
+ 0x01, 0x01, 0x00, 0x1b, 0xb6, 0xee, 0x56, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae,
+ 0x42, 0x60, 0x82
+};
+static const BYTE test_png_8bpp_gray_data[] =
+{
+ 0xff, 0xff, 0xff, 0xff
+};
+
+/* 1x1 jpg image */
+static const BYTE test_jpg[] =
+{
+ 0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x01, 0x01, 0x2c,
+ 0x01, 0x2c, 0x00, 0x00, 0xff, 0xdb, 0x00, 0x43, 0x00, 0x05, 0x03, 0x04, 0x04, 0x04, 0x03, 0x05,
+ 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x06, 0x07, 0x0c, 0x08, 0x07, 0x07, 0x07, 0x07, 0x0f, 0x0b,
+ 0x0b, 0x09, 0x0c, 0x11, 0x0f, 0x12, 0x12, 0x11, 0x0f, 0x11, 0x11, 0x13, 0x16, 0x1c, 0x17, 0x13,
+ 0x14, 0x1a, 0x15, 0x11, 0x11, 0x18, 0x21, 0x18, 0x1a, 0x1d, 0x1d, 0x1f, 0x1f, 0x1f, 0x13, 0x17,
+ 0x22, 0x24, 0x22, 0x1e, 0x24, 0x1c, 0x1e, 0x1f, 0x1e, 0xff, 0xdb, 0x00, 0x43, 0x01, 0x05, 0x05,
+ 0x05, 0x07, 0x06, 0x07, 0x0e, 0x08, 0x08, 0x0e, 0x1e, 0x14, 0x11, 0x14, 0x1e, 0x1e, 0x1e, 0x1e,
+ 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e,
+ 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e,
+ 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0xff, 0xc0,
+ 0x00, 0x11, 0x08, 0x00, 0x01, 0x00, 0x01, 0x03, 0x01, 0x22, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11,
+ 0x01, 0xff, 0xc4, 0x00, 0x15, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xff, 0xc4, 0x00, 0x14, 0x10, 0x01, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xc4,
+ 0x00, 0x14, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xff, 0xc4, 0x00, 0x14, 0x11, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xda, 0x00, 0x0c, 0x03, 0x01,
+ 0x00, 0x02, 0x11, 0x03, 0x11, 0x00, 0x3f, 0x00, 0xb2, 0xc0, 0x07, 0xff, 0xd9
+};
+static const BYTE test_jpg_data[] =
+{
+ 0xff, 0xff, 0xff, 0xff
+};
+
+/* 1x1 gif image */
+static const BYTE test_gif[] =
+{
+ 0x47, 0x49, 0x46, 0x38, 0x37, 0x61, 0x01, 0x00, 0x01, 0x00, 0x80, 0x00, 0x00, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x02, 0x02, 0x44,
+ 0x01, 0x00, 0x3b
+};
+static const BYTE test_gif_data[] =
+{
+ 0xff, 0xff, 0xff, 0xff
+};
+
+/* 1x1 tiff image */
+static const BYTE test_tiff[] =
+{
+ 0x49, 0x49, 0x2a, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0xfe, 0x00,
+ 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x00, 0x01, 0x00,
+ 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00,
+ 0x00, 0x00, 0x02, 0x01, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, 0x00, 0x03, 0x01,
+ 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x01, 0x03, 0x00, 0x01, 0x00,
+ 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0d, 0x01, 0x02, 0x00, 0x1b, 0x00, 0x00, 0x00, 0xd8, 0x00,
+ 0x00, 0x00, 0x11, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x12, 0x01,
+ 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x15, 0x01, 0x03, 0x00, 0x01, 0x00,
+ 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x16, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x40, 0x00,
+ 0x00, 0x00, 0x17, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1a, 0x01,
+ 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0x1b, 0x01, 0x05, 0x00, 0x01, 0x00,
+ 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x1c, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00,
+ 0x00, 0x00, 0x28, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x2f, 0x68, 0x6f, 0x6d, 0x65, 0x2f, 0x6d, 0x65,
+ 0x68, 0x2f, 0x44, 0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x74,
+ 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x48,
+ 0x00, 0x00, 0x00, 0x01
+};
+static const BYTE test_tiff_data[] =
+{
+ 0x00, 0x00, 0x00, 0xff
+};
+
+/* 1x1 alpha dds image */
+static const BYTE test_dds_alpha[] =
+{
+ 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff
+};
+static const BYTE test_dds_alpha_data[] =
+{
+ 0xff
+};
+
+/* 1x1 luminance dds image */
+static const BYTE test_dds_luminance[] =
+{
+ 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x82
+};
+static const BYTE test_dds_luminance_data[] =
+{
+ 0x82, 0x82, 0x82, 0xff
+};
+
+/* 1x1 16bpp dds image */
+static const BYTE test_dds_16bpp[] =
+{
+ 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00,
+ 0xe0, 0x03, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x0e, 0x42
+};
+static const BYTE test_dds_16bpp_data[] =
+{
+ 0x84, 0x84, 0x73, 0xff
+};
+
+/* 1x1 24bpp dds image */
+static const BYTE test_dds_24bpp[] =
+{
+ 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00,
+ 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x70, 0x81, 0x83
+};
+static const BYTE test_dds_24bpp_data[] =
+{
+ 0x83, 0x81, 0x70, 0xff
+};
+
+/* 1x1 32bpp dds image */
+static const BYTE test_dds_32bpp[] =
+{
+ 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00,
+ 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x10, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x70, 0x81, 0x83, 0xff
+};
+static const BYTE test_dds_32bpp_data[] =
+{
+ 0x83, 0x81, 0x70, 0xff
+};
+
+/* 1x1 64bpp dds image */
+static const BYTE test_dds_64bpp[] =
+{
+ 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x0f, 0x10, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x83, 0x83, 0x81, 0x81, 0x70, 0x70, 0xff, 0xff
+};
+static const BYTE test_dds_64bpp_data[] =
+{
+ 0x83, 0x83, 0x81, 0x81, 0x70, 0x70, 0xff, 0xff
+};
+
+/* 1x1 96bpp dds image */
+static const BYTE test_dds_96bpp[] =
+{
+ 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x0f, 0x10, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x44, 0x58, 0x31, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x84, 0x83, 0x03, 0x3f, 0x82, 0x81, 0x01, 0x3f, 0xe2, 0xe0, 0xe0, 0x3e
+};
+static const BYTE test_dds_96bpp_data[] =
+{
+ 0x84, 0x83, 0x03, 0x3f, 0x82, 0x81, 0x01, 0x3f, 0xe2, 0xe0, 0xe0, 0x3e
+};
+
+/* 1x1 128bpp dds image */
+static const BYTE test_dds_128bpp[] =
+{
+ 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x0f, 0x10, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x84, 0x83, 0x03, 0x3f, 0x82, 0x81, 0x01, 0x3f, 0xe2, 0xe0, 0xe0, 0x3e, 0x00, 0x00, 0x80, 0x3f
+};
+static const BYTE test_dds_128bpp_data[] =
+{
+ 0x84, 0x83, 0x03, 0x3f, 0x82, 0x81, 0x01, 0x3f, 0xe2, 0xe0, 0xe0, 0x3e, 0x00, 0x00, 0x80, 0x3f
+
+};
+
+/* 4x4 DXT1 dds image */
+static const BYTE test_dds_dxt1[] =
+{
+ 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x44, 0x58, 0x54, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x2a, 0x31, 0xf5, 0xbc, 0xe3, 0x6e, 0x2a, 0x3a
+};
+static const BYTE test_dds_dxt1_data[] =
+{
+ 0x2a, 0x31, 0xf5, 0xbc, 0xe3, 0x6e, 0x2a, 0x3a
+};
+
+/* 4x4 DXT2 dds image */
+static const BYTE test_dds_dxt2[] =
+{
+ 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x44, 0x58, 0x54, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xde, 0xc4, 0x10, 0x2f, 0xbf, 0xff, 0x7b,
+ 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x53, 0x00, 0x00, 0x52, 0x52, 0x55, 0x55,
+ 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xce, 0x59, 0x00, 0x00, 0x54, 0x55, 0x55, 0x55
+};
+static const BYTE test_dds_dxt2_data[] =
+{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xde, 0xc4, 0x10, 0x2f, 0xbf, 0xff, 0x7b
+
+};
+
+/* 1x3 DXT3 dds image */
+static const BYTE test_dds_dxt3[] =
+{
+ 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x0a, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x44, 0x58, 0x54, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0c, 0x92, 0x38, 0x84, 0x00, 0xff, 0x55, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x53, 0x8b, 0x53, 0x8b, 0x00, 0x00, 0x00, 0x00
+};
+static const BYTE test_dds_dxt3_data[] =
+{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x4e, 0x92, 0xd6, 0x83, 0x00, 0xaa, 0x55, 0x55
+
+};
+
+/* 4x4 DXT4 dds image */
+static const BYTE test_dds_dxt4[] =
+{
+ 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x44, 0x58, 0x54, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfd, 0xde, 0xc4, 0x10, 0x2f, 0xbf, 0xff, 0x7b,
+ 0xff, 0x00, 0x40, 0x02, 0x24, 0x49, 0x92, 0x24, 0x57, 0x53, 0x00, 0x00, 0x52, 0x52, 0x55, 0x55,
+ 0xff, 0x00, 0x48, 0x92, 0x24, 0x49, 0x92, 0x24, 0xce, 0x59, 0x00, 0x00, 0x54, 0x55, 0x55, 0x55
+};
+static const BYTE test_dds_dxt4_data[] =
+{
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfd, 0xde, 0xc4, 0x10, 0x2f, 0xbf, 0xff, 0x7b
+
+};
+
+/* 4x2 DXT5 dds image */
+static const BYTE test_dds_dxt5[] =
+{
+ 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x08, 0x00, 0x02, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x44, 0x58, 0x54, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0x87, 0x0f, 0x78, 0x05, 0x05, 0x50, 0x50
+};
+static const BYTE test_dds_dxt5_data[] =
+{
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0x87, 0x0f, 0x78, 0x05, 0x05, 0x05, 0x05
+
+};
+
+/* 4x4 BC4 dds image */
+static const BYTE test_dds_bc4[] =
+{
+ 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x0a, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x42, 0x43, 0x34, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xd9, 0x15, 0xbc, 0x41, 0x5b, 0xa3, 0x3d, 0x3a, 0x8f, 0x3d, 0x45, 0x81, 0x20, 0x45, 0x81, 0x20,
+ 0x6f, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+static const BYTE test_dds_bc4_data[] =
+{
+ 0xd9, 0x15, 0xbc, 0x41, 0x5b, 0xa3, 0x3d, 0x3a
+};
+
+/* 6x3 BC5 dds image */
+static const BYTE test_dds_bc5[] =
+{
+ 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x0a, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x42, 0x43, 0x35, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x9f, 0x28, 0x73, 0xac, 0xd5, 0x80, 0xaa, 0xd5, 0x70, 0x2c, 0x4e, 0xd6, 0x76, 0x1d, 0xd6, 0x76,
+ 0xd5, 0x0f, 0xc3, 0x50, 0x96, 0xcf, 0x53, 0x96, 0xdf, 0x16, 0xc3, 0x50, 0x96, 0xcf, 0x53, 0x96,
+ 0x83, 0x55, 0x08, 0x83, 0x30, 0x08, 0x83, 0x30, 0x79, 0x46, 0x31, 0x1c, 0xc3, 0x31, 0x1c, 0xc3,
+ 0x6d, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+static const BYTE test_dds_bc5_data[] =
+{
+ 0x95, 0x35, 0xe2, 0xa3, 0xf5, 0xd2, 0x28, 0x68, 0x65, 0x32, 0x7c, 0x4e, 0xdb, 0xe4, 0x56, 0x0a,
+ 0xb9, 0x33, 0xaf, 0xf0, 0x52, 0xbe, 0xed, 0x27, 0xb4, 0x2e, 0xa6, 0x60, 0x4e, 0xb6, 0x5d, 0x3f
+
+};
+
+/* 4x4 DXT1 cube map */
+static const BYTE test_dds_cube[] =
+{
+ 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x0a, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x44, 0x58, 0x54, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x00,
+ 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xf5, 0xa7, 0x08, 0x69, 0x74, 0xc0, 0xbf, 0xd7, 0x32, 0x96, 0x0b, 0x7b, 0xcc, 0x55, 0xcc, 0x55,
+ 0x0e, 0x84, 0x0e, 0x84, 0x00, 0x00, 0x00, 0x00, 0xf5, 0xa7, 0x08, 0x69, 0x74, 0xc0, 0xbf, 0xd7,
+ 0x32, 0x96, 0x0b, 0x7b, 0xcc, 0x55, 0xcc, 0x55, 0x0e, 0x84, 0x0e, 0x84, 0x00, 0x00, 0x00, 0x00,
+ 0xf5, 0xa7, 0x08, 0x69, 0x74, 0xc0, 0xbf, 0xd7, 0x32, 0x96, 0x0b, 0x7b, 0xcc, 0x55, 0xcc, 0x55,
+ 0x0e, 0x84, 0x0e, 0x84, 0x00, 0x00, 0x00, 0x00, 0xf5, 0xa7, 0x08, 0x69, 0x74, 0xc0, 0xbf, 0xd7,
+ 0x32, 0x96, 0x0b, 0x7b, 0xcc, 0x55, 0xcc, 0x55, 0x0e, 0x84, 0x0e, 0x84, 0x00, 0x00, 0x00, 0x00,
+ 0xf5, 0xa7, 0x08, 0x69, 0x74, 0xc0, 0xbf, 0xd7, 0x32, 0x96, 0x0b, 0x7b, 0xcc, 0x55, 0xcc, 0x55,
+ 0x0e, 0x84, 0x0e, 0x84, 0x00, 0x00, 0x00, 0x00, 0xf5, 0xa7, 0x08, 0x69, 0x74, 0xc0, 0xbf, 0xd7,
+ 0x32, 0x96, 0x0b, 0x7b, 0xcc, 0x55, 0xcc, 0x55, 0x0e, 0x84, 0x0e, 0x84, 0x00, 0x00, 0x00, 0x00
+};
+static const BYTE test_dds_cube_data[] =
+{
+ 0xf5, 0xa7, 0x08, 0x69, 0x74, 0xc0, 0xbf, 0xd7
+};
+
+static const struct test_image
+{
+ const BYTE *data;
+ unsigned int size;
+ const BYTE *expected_data;
+ D3DX11_IMAGE_INFO expected_info;
+}
+test_image[] =
+{
+ {
+ test_bmp_1bpp, sizeof(test_bmp_1bpp), test_bmp_1bpp_data,
+ {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_BMP}
+ },
+ {
+ test_bmp_4bpp, sizeof(test_bmp_4bpp), test_bmp_4bpp_data,
+ {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_BMP}
+ },
+ {
+ test_bmp_8bpp, sizeof(test_bmp_8bpp), test_bmp_8bpp_data,
+ {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_BMP}
+ },
+ {
+ test_bmp_16bpp, sizeof(test_bmp_16bpp), test_bmp_16bpp_data,
+ {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_BMP}
+ },
+ {
+ test_bmp_24bpp, sizeof(test_bmp_24bpp), test_bmp_24bpp_data,
+ {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_BMP}
+ },
+ {
+ test_bmp_32bpp_xrgb, sizeof(test_bmp_32bpp_xrgb), test_bmp_32bpp_xrgb_data,
+ {2, 2, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_BMP}
+ },
+ {
+ test_bmp_32bpp_argb, sizeof(test_bmp_32bpp_argb), test_bmp_32bpp_argb_data,
+ {2, 2, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_BMP}
+ },
+ {
+ test_png_8bpp_gray, sizeof(test_png_8bpp_gray), test_png_8bpp_gray_data,
+ {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_PNG}
+ },
+ {
+ test_jpg, sizeof(test_jpg), test_jpg_data,
+ {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_JPG}
+ },
+ {
+ test_gif, sizeof(test_gif), test_gif_data,
+ {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_GIF}
+ },
+ {
+ test_tiff, sizeof(test_tiff), test_tiff_data,
+ {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_TIFF}
+ },
+ {
+ test_dds_alpha, sizeof(test_dds_alpha), test_dds_alpha_data,
+ {1, 1, 1, 1, 1, 0, DXGI_FORMAT_A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}
+ },
+ {
+ test_dds_luminance, sizeof(test_dds_luminance), test_dds_luminance_data,
+ {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}
+ },
+ {
+ test_dds_16bpp, sizeof(test_dds_16bpp), test_dds_16bpp_data,
+ {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}
+ },
+ {
+ test_dds_24bpp, sizeof(test_dds_24bpp), test_dds_24bpp_data,
+ {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}
+ },
+ {
+ test_dds_32bpp, sizeof(test_dds_32bpp), test_dds_32bpp_data,
+ {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}
+ },
+ {
+ test_dds_64bpp, sizeof(test_dds_64bpp), test_dds_64bpp_data,
+ {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R16G16B16A16_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}
+ },
+ {
+ test_dds_96bpp, sizeof(test_dds_96bpp), test_dds_96bpp_data,
+ {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R32G32B32_FLOAT, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}
+ },
+ {
+ test_dds_128bpp, sizeof(test_dds_128bpp), test_dds_128bpp_data,
+ {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R32G32B32A32_FLOAT, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}
+ },
+ {
+ test_dds_dxt1, sizeof(test_dds_dxt1), test_dds_dxt1_data,
+ {4, 4, 1, 1, 1, 0, DXGI_FORMAT_BC1_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}
+ },
+ {
+ test_dds_dxt2, sizeof(test_dds_dxt2), test_dds_dxt2_data,
+ {4, 4, 1, 1, 3, 0, DXGI_FORMAT_BC2_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}
+ },
+ {
+ test_dds_dxt3, sizeof(test_dds_dxt3), test_dds_dxt3_data,
+ {1, 3, 1, 1, 2, 0, DXGI_FORMAT_BC2_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}
+ },
+ {
+ test_dds_dxt4, sizeof(test_dds_dxt4), test_dds_dxt4_data,
+ {4, 4, 1, 1, 3, 0, DXGI_FORMAT_BC3_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}
+ },
+ {
+ test_dds_dxt5, sizeof(test_dds_dxt5), test_dds_dxt5_data,
+ {4, 2, 1, 1, 1, 0, DXGI_FORMAT_BC3_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}
+ },
+ {
+ test_dds_bc4, sizeof(test_dds_bc4), test_dds_bc4_data,
+ {4, 4, 1, 1, 3, 0, DXGI_FORMAT_BC4_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}
+ },
+ {
+ test_dds_bc5, sizeof(test_dds_bc5), test_dds_bc5_data,
+ {6, 3, 1, 1, 3, 0, DXGI_FORMAT_BC5_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}
+ },
+ {
+ test_dds_cube, sizeof(test_dds_cube), test_dds_cube_data,
+ {4, 4, 1, 6, 3, 0x4, DXGI_FORMAT_BC1_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}
+ },
+};
+
+static void check_image_info(D3DX11_IMAGE_INFO *image_info, const struct test_image *image, unsigned int line)
+{
+ ok_(__FILE__, line)(image_info->Width == image->expected_info.Width,
+ "Got unexpected Width %u, expected %u.\n",
+ image_info->Width, image->expected_info.Width);
+ ok_(__FILE__, line)(image_info->Height == image->expected_info.Height,
+ "Got unexpected Height %u, expected %u.\n",
+ image_info->Height, image->expected_info.Height);
+ ok_(__FILE__, line)(image_info->Depth == image->expected_info.Depth,
+ "Got unexpected Depth %u, expected %u.\n",
+ image_info->Depth, image->expected_info.Depth);
+ ok_(__FILE__, line)(image_info->ArraySize == image->expected_info.ArraySize,
+ "Got unexpected ArraySize %u, expected %u.\n",
+ image_info->ArraySize, image->expected_info.ArraySize);
+ ok_(__FILE__, line)(image_info->MipLevels == image->expected_info.MipLevels,
+ "Got unexpected MipLevels %u, expected %u.\n",
+ image_info->MipLevels, image->expected_info.MipLevels);
+ ok_(__FILE__, line)(image_info->MiscFlags == image->expected_info.MiscFlags,
+ "Got unexpected MiscFlags %#x, expected %#x.\n",
+ image_info->MiscFlags, image->expected_info.MiscFlags);
+ ok_(__FILE__, line)(image_info->Format == image->expected_info.Format,
+ "Got unexpected Format %#x, expected %#x.\n",
+ image_info->Format, image->expected_info.Format);
+ ok_(__FILE__, line)(image_info->ResourceDimension == image->expected_info.ResourceDimension,
+ "Got unexpected ResourceDimension %u, expected %u.\n",
+ image_info->ResourceDimension, image->expected_info.ResourceDimension);
+ ok_(__FILE__, line)(image_info->ImageFileFormat == image->expected_info.ImageFileFormat,
+ "Got unexpected ImageFileFormat %u, expected %u.\n",
+ image_info->ImageFileFormat, image->expected_info.ImageFileFormat);
+}
+
static BOOL create_file(const WCHAR *filename, const char *data, unsigned int size, WCHAR *out_path)
{
WCHAR path[MAX_PATH];
@@ -404,10 +1044,38 @@ static void test_D3DX11CompileFromFile(void)
delete_directory(L"include");
}
+static void test_get_image_info(void)
+{
+ D3DX11_IMAGE_INFO image_info;
+ unsigned int i;
+ DWORD dword;
+ HRESULT hr;
+
+ hr = D3DX11GetImageInfoFromMemory(test_image[0].data, 0, NULL, &image_info, NULL);
+ ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
+ hr = D3DX11GetImageInfoFromMemory(NULL, test_image[0].size, NULL, &image_info, NULL);
+ ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
+ hr = D3DX11GetImageInfoFromMemory(&dword, sizeof(dword), NULL, &image_info, NULL);
+ ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
+
+ for (i = 0; i < ARRAY_SIZE(test_image); ++i)
+ {
+ winetest_push_context("Test %u", i);
+
+ hr = D3DX11GetImageInfoFromMemory(test_image[i].data, test_image[i].size, NULL, &image_info, NULL);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ if (hr == S_OK)
+ check_image_info(&image_info, test_image + i, __LINE__);
+
+ winetest_pop_context();
+ }
+}
+
START_TEST(d3dx11)
{
test_D3DX11CreateAsyncMemoryLoader();
test_D3DX11CreateAsyncFileLoader();
test_D3DX11CreateAsyncResourceLoader();
test_D3DX11CompileFromFile();
+ test_get_image_info();
}
diff --git a/dlls/d3dx11_43/texture.c b/dlls/d3dx11_43/texture.c
index ee6808d76d6..8addf4f84d3 100644
--- a/dlls/d3dx11_43/texture.c
+++ b/dlls/d3dx11_43/texture.c
@@ -15,14 +15,190 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#define COBJMACROS
#include "d3dx11.h"
#include "d3dcompiler.h"
+#include "wincodec.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(d3dx);
+HRESULT WINAPI WICCreateImagingFactory_Proxy(UINT sdk_version, IWICImagingFactory **imaging_factory);
+
+static const struct
+{
+ const GUID *wic_container_guid;
+ D3DX11_IMAGE_FILE_FORMAT d3dx_file_format;
+}
+file_formats[] =
+{
+ { &GUID_ContainerFormatBmp, D3DX11_IFF_BMP },
+ { &GUID_ContainerFormatJpeg, D3DX11_IFF_JPG },
+ { &GUID_ContainerFormatPng, D3DX11_IFF_PNG },
+ { &GUID_ContainerFormatDds, D3DX11_IFF_DDS },
+ { &GUID_ContainerFormatTiff, D3DX11_IFF_TIFF },
+ { &GUID_ContainerFormatGif, D3DX11_IFF_GIF },
+ { &GUID_ContainerFormatWmp, D3DX11_IFF_WMP },
+};
+
+static D3DX11_IMAGE_FILE_FORMAT wic_container_guid_to_file_format(GUID *container_format)
+{
+ unsigned int i;
+
+ for (i = 0; i < ARRAY_SIZE(file_formats); ++i)
+ {
+ if (IsEqualGUID(file_formats[i].wic_container_guid, container_format))
+ return file_formats[i].d3dx_file_format;
+ }
+ return D3DX11_IFF_FORCE_DWORD;
+}
+
+static D3D11_RESOURCE_DIMENSION wic_dimension_to_d3dx11_dimension(WICDdsDimension wic_dimension)
+{
+ switch (wic_dimension)
+ {
+ case WICDdsTexture1D:
+ return D3D11_RESOURCE_DIMENSION_TEXTURE1D;
+ case WICDdsTexture2D:
+ case WICDdsTextureCube:
+ return D3D11_RESOURCE_DIMENSION_TEXTURE2D;
+ case WICDdsTexture3D:
+ return D3D11_RESOURCE_DIMENSION_TEXTURE3D;
+ default:
+ return D3D11_RESOURCE_DIMENSION_UNKNOWN;
+ }
+}
+
+static const DXGI_FORMAT to_be_converted_format[] =
+{
+ DXGI_FORMAT_UNKNOWN,
+ DXGI_FORMAT_R8_UNORM,
+ DXGI_FORMAT_R8G8_UNORM,
+ DXGI_FORMAT_B5G6R5_UNORM,
+ DXGI_FORMAT_B4G4R4A4_UNORM,
+ DXGI_FORMAT_B5G5R5A1_UNORM,
+ DXGI_FORMAT_B8G8R8X8_UNORM,
+ DXGI_FORMAT_B8G8R8A8_UNORM
+};
+
+static DXGI_FORMAT get_d3dx11_dds_format(DXGI_FORMAT format)
+{
+ unsigned int i;
+
+ for (i = 0; i < ARRAY_SIZE(to_be_converted_format); ++i)
+ {
+ if (format == to_be_converted_format[i])
+ return DXGI_FORMAT_R8G8B8A8_UNORM;
+ }
+ return format;
+}
+
+HRESULT WINAPI D3DX11GetImageInfoFromMemory(const void *src_data, SIZE_T src_data_size, ID3DX11ThreadPump *pump,
+ D3DX11_IMAGE_INFO *img_info, HRESULT *hresult)
+{
+ IWICBitmapFrameDecode *frame = NULL;
+ IWICImagingFactory *factory = NULL;
+ IWICDdsDecoder *dds_decoder = NULL;
+ IWICBitmapDecoder *decoder = NULL;
+ WICDdsParameters dds_params;
+ IWICStream *stream = NULL;
+ unsigned int frame_count;
+ GUID container_format;
+ HRESULT hr;
+
+ TRACE("src_data %p, src_data_size %lu, pump %p, img_info %p, hresult %p.\n",
+ src_data, src_data_size, pump, img_info, hresult);
+
+ if (!src_data || !src_data_size || !img_info)
+ return E_FAIL;
+ if (pump)
+ FIXME("Thread pump is not supported yet.\n");
+
+ WICCreateImagingFactory_Proxy(WINCODEC_SDK_VERSION, &factory);
+ IWICImagingFactory_CreateStream(factory, &stream);
+ hr = IWICStream_InitializeFromMemory(stream, (BYTE *)src_data, src_data_size);
+ if (FAILED(hr))
+ {
+ WARN("Failed to initialize stream.\n");
+ goto end;
+ }
+ hr = IWICImagingFactory_CreateDecoderFromStream(factory, (IStream *)stream, NULL, 0, &decoder);
+ if (FAILED(hr))
+ goto end;
+
+ hr = IWICBitmapDecoder_GetContainerFormat(decoder, &container_format);
+ if (FAILED(hr))
+ goto end;
+ img_info->ImageFileFormat = wic_container_guid_to_file_format(&container_format);
+ if (img_info->ImageFileFormat == D3DX11_IFF_FORCE_DWORD)
+ {
+ hr = E_FAIL;
+ WARN("Unsupported image file format %s.\n", debugstr_guid(&container_format));
+ goto end;
+ }
+
+ hr = IWICBitmapDecoder_GetFrameCount(decoder, &frame_count);
+ if (FAILED(hr) || !frame_count)
+ goto end;
+ hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
+ if (FAILED(hr))
+ goto end;
+ hr = IWICBitmapFrameDecode_GetSize(frame, &img_info->Width, &img_info->Height);
+ if (FAILED(hr))
+ goto end;
+
+ if (img_info->ImageFileFormat == D3DX11_IFF_DDS)
+ {
+ hr = IWICBitmapDecoder_QueryInterface(decoder, &IID_IWICDdsDecoder, (void **)&dds_decoder);
+ if (FAILED(hr))
+ goto end;
+ hr = IWICDdsDecoder_GetParameters(dds_decoder, &dds_params);
+ if (FAILED(hr))
+ goto end;
+ img_info->ArraySize = dds_params.ArraySize;
+ img_info->Depth = dds_params.Depth;
+ img_info->MipLevels = dds_params.MipLevels;
+ img_info->ResourceDimension = wic_dimension_to_d3dx11_dimension(dds_params.Dimension);
+ img_info->Format = get_d3dx11_dds_format(dds_params.DxgiFormat);
+ img_info->MiscFlags = 0;
+ if (dds_params.Dimension == WICDdsTextureCube)
+ {
+ img_info->MiscFlags = D3D11_RESOURCE_MISC_TEXTURECUBE;
+ img_info->ArraySize *= 6;
+ }
+ }
+ else
+ {
+ img_info->ArraySize = 1;
+ img_info->Depth = 1;
+ img_info->MipLevels = 1;
+ img_info->ResourceDimension = D3D11_RESOURCE_DIMENSION_TEXTURE2D;
+ img_info->Format = DXGI_FORMAT_R8G8B8A8_UNORM;
+ img_info->MiscFlags = 0;
+ }
+
+end:
+ if (dds_decoder)
+ IWICDdsDecoder_Release(dds_decoder);
+ if (frame)
+ IWICBitmapFrameDecode_Release(frame);
+ if (decoder)
+ IWICBitmapDecoder_Release(decoder);
+ if (stream)
+ IWICStream_Release(stream);
+ if (factory)
+ IWICImagingFactory_Release(factory);
+
+ if (hr != S_OK)
+ {
+ WARN("Invalid or unsupported image file.\n");
+ return E_FAIL;
+ }
+ return S_OK;
+}
+
HRESULT WINAPI D3DX11CreateShaderResourceViewFromMemory(ID3D11Device *device, const void *data,
SIZE_T data_size, D3DX11_IMAGE_LOAD_INFO *load_info, ID3DX11ThreadPump *pump,
ID3D11ShaderResourceView **view, HRESULT *hresult)
--
2.30.2
July 30, 2021
Re: [PATCH] kernel32: add GetCurrentPackagePath stub (resend)
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=94727
Your paranoid android.
=== debiant2 (32 bit report) ===
kernel32:
change.c:320: Test failed: should be ready
change.c:350: Test failed: should be ready
July 30, 2021