From: Connor McAdams <cmcadams@codeweavers.com> Signed-off-by: Connor McAdams <cmcadams@codeweavers.com> --- dlls/d3dx10_43/tests/d3dx10.c | 11 ----------- dlls/d3dx10_43/texture.c | 17 ++++++++--------- dlls/d3dx11_43/tests/d3dx11.c | 7 ------- dlls/d3dx11_43/texture.c | 17 ++++++++--------- 4 files changed, 16 insertions(+), 36 deletions(-) diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index 3eed87bc0b8..78278da0a60 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -3907,7 +3907,6 @@ static void test_D3DX10CreateAsyncTextureProcessor(void) ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); hr = ID3DX10DataProcessor_Process(dp, (void *)test_image[i].data, test_image[i].size); - todo_wine_if (i == 30) ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP), "Got unexpected hr %#lx.\n", hr); if (hr == S_OK) @@ -3929,7 +3928,6 @@ static void test_D3DX10CreateAsyncTextureProcessor(void) ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); hr = ID3DX10DataProcessor_Process(dp, (void *)test_image[i].data, test_image[i].size); - todo_wine_if (i == 30) ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP), "Got unexpected hr %#lx.\n", hr); if (hr == S_OK) @@ -3953,7 +3951,6 @@ static void test_D3DX10CreateAsyncTextureProcessor(void) ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); hr = ID3DX10DataProcessor_Process(dp, (void *)test_image[i].data, test_image[i].size); - todo_wine_if (i == 30) ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP), "Got unexpected hr %#lx.\n", hr); if (hr == S_OK) @@ -4358,7 +4355,6 @@ static void test_D3DX10CreateThreadPump(void) ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); hr = ID3DX10ThreadPump_WaitForAllItems(pump); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - todo_wine_if (i == 30) ok(work_item_hr == S_OK || (work_item_hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP), "Got unexpected hr %#lx.\n", work_item_hr); @@ -5110,7 +5106,6 @@ static void test_create_texture(void) hr2 = 0xdeadbeef; hr = D3DX10CreateTextureFromMemory(device, test_image[i].data, test_image[i].size, NULL, NULL, &resource, &hr2); ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); - todo_wine_if (i == 30) ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP), "Got unexpected hr %#lx.\n", hr); if (hr == S_OK) @@ -5126,7 +5121,6 @@ static void test_create_texture(void) hr2 = 0xdeadbeef; hr = D3DX10CreateTextureFromMemory(device, test_image[i].data, test_image[i].size, &load_info, NULL, &resource, &hr2); ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); - todo_wine_if (i == 30) ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP), "Got unexpected hr %#lx.\n", hr); if (hr == S_OK) @@ -5144,7 +5138,6 @@ static void test_create_texture(void) hr2 = 0xdeadbeef; hr = D3DX10CreateTextureFromMemory(device, test_image[i].data, test_image[i].size, &load_info, NULL, &resource, &hr2); ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); - todo_wine_if (i == 30) ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP), "Got unexpected hr %#lx.\n", hr); if (hr == S_OK) @@ -5325,7 +5318,6 @@ static void test_create_texture(void) hr2 = 0xdeadbeef; hr = D3DX10CreateTextureFromFileW(device, path, NULL, NULL, &resource, &hr2); ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); - todo_wine_if (i == 30) ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP), "Got unexpected hr %#lx.\n", hr); if (hr == S_OK) @@ -5338,7 +5330,6 @@ static void test_create_texture(void) hr2 = 0xdeadbeef; hr = D3DX10CreateTextureFromFileA(device, get_str_a(path), NULL, NULL, &resource, &hr2); ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); - todo_wine_if (i == 30) ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP), "Got unexpected hr %#lx.\n", hr); if (hr == S_OK) @@ -5442,7 +5433,6 @@ static void test_create_texture(void) hr2 = 0xdeadbeef; hr = D3DX10CreateTextureFromResourceW(device, resource_module, test_resource_name, NULL, NULL, &resource, &hr2); - todo_wine_if (i == 30) ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP), "Got unexpected hr %#lx.\n", hr); ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); @@ -5456,7 +5446,6 @@ static void test_create_texture(void) hr2 = 0xdeadbeef; hr = D3DX10CreateTextureFromResourceA(device, resource_module, get_str_a(test_resource_name), NULL, NULL, &resource, &hr2); - todo_wine_if (i == 30) ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP), "Got unexpected hr %#lx.\n", hr); ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); diff --git a/dlls/d3dx10_43/texture.c b/dlls/d3dx10_43/texture.c index bb312ae42ff..0fd300b66a0 100644 --- a/dlls/d3dx10_43/texture.c +++ b/dlls/d3dx10_43/texture.c @@ -637,7 +637,7 @@ void init_load_info(const D3DX10_IMAGE_LOAD_INFO *load_info, D3DX10_IMAGE_LOAD_I HRESULT load_texture_data(const void *data, SIZE_T size, D3DX10_IMAGE_LOAD_INFO *load_info, D3D10_SUBRESOURCE_DATA **resource_data) { - uint32_t loaded_mip_level_count, max_mip_level_count; + uint32_t loaded_mip_level_count, max_mip_level_count, loaded_layer_count; const struct pixel_format_desc *fmt_desc, *src_desc; struct d3dx_subresource_data *sub_rsrcs = NULL; D3DX10_IMAGE_INFO img_info; @@ -661,12 +661,11 @@ HRESULT load_texture_data(const void *data, SIZE_T size, D3DX10_IMAGE_LOAD_INFO goto end; } - if ((!(img_info.MiscFlags & D3D10_RESOURCE_MISC_TEXTURECUBE) || img_info.ArraySize != 6) - && img_info.ArraySize != 1) + loaded_layer_count = img_info.ArraySize; + if ((loaded_layer_count > 1) && (img_info.ResourceDimension == D3D10_RESOURCE_DIMENSION_TEXTURE3D)) { - FIXME("img_info.ArraySize = %u not supported.\n", img_info.ArraySize); - hr = E_NOTIMPL; - goto end; + TRACE("Ignoring array size variable %u for 3D texture.\n", img_info.ArraySize); + loaded_layer_count = 1; } if (load_info->FirstMipLevel == D3DX10_DEFAULT || load_info->FirstMipLevel >= img_info.MipLevels) @@ -720,13 +719,13 @@ HRESULT load_texture_data(const void *data, SIZE_T size, D3DX10_IMAGE_LOAD_INFO } hr = d3dx_create_subresource_data_for_texture(load_info->Width, load_info->Height, load_info->Depth, - load_info->MipLevels, img_info.ArraySize, fmt_desc, &sub_rsrcs); + load_info->MipLevels, loaded_layer_count, fmt_desc, &sub_rsrcs); if (FAILED(hr)) goto end; src_desc = get_d3dx_pixel_format_info(image.format); loaded_mip_level_count = min(img_info.MipLevels - load_info->FirstMipLevel, load_info->MipLevels); - for (i = 0; i < img_info.ArraySize; ++i) + for (i = 0; i < loaded_layer_count; ++i) { struct volume dst_size = { load_info->Width, load_info->Height, load_info->Depth }; @@ -765,7 +764,7 @@ HRESULT load_texture_data(const void *data, SIZE_T size, D3DX10_IMAGE_LOAD_INFO } d3dx_get_mip_level_size(&base_level_size, base_level); - for (i = 0; i < img_info.ArraySize; ++i) + for (i = 0; i < loaded_layer_count; ++i) { struct volume src_size, dst_size; diff --git a/dlls/d3dx11_43/tests/d3dx11.c b/dlls/d3dx11_43/tests/d3dx11.c index d6855b0ec6f..bdf34daa761 100644 --- a/dlls/d3dx11_43/tests/d3dx11.c +++ b/dlls/d3dx11_43/tests/d3dx11.c @@ -3944,7 +3944,6 @@ static void test_create_texture(void) hr2 = 0xdeadbeef; hr = D3DX11CreateTextureFromMemory(device, test_image[i].data, test_image[i].size, NULL, NULL, &resource, &hr2); ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); - todo_wine_if (i == 30) ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX11_IFF_WMP), "Got unexpected hr %#lx.\n", hr); if (hr == S_OK) @@ -3960,7 +3959,6 @@ static void test_create_texture(void) hr2 = 0xdeadbeef; hr = D3DX11CreateTextureFromMemory(device, test_image[i].data, test_image[i].size, &load_info, NULL, &resource, &hr2); ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); - todo_wine_if (i == 30) ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX11_IFF_WMP), "Got unexpected hr %#lx.\n", hr); if (hr == S_OK) @@ -3978,7 +3976,6 @@ static void test_create_texture(void) hr2 = 0xdeadbeef; hr = D3DX11CreateTextureFromMemory(device, test_image[i].data, test_image[i].size, &load_info, NULL, &resource, &hr2); ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); - todo_wine_if (i == 30) ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX11_IFF_WMP), "Got unexpected hr %#lx.\n", hr); if (hr == S_OK) @@ -4153,7 +4150,6 @@ static void test_create_texture(void) hr2 = 0xdeadbeef; hr = D3DX11CreateTextureFromFileW(device, path, NULL, NULL, &resource, &hr2); ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); - todo_wine_if (i == 30) ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX11_IFF_WMP), "Got unexpected hr %#lx.\n", hr); if (hr == S_OK) @@ -4166,7 +4162,6 @@ static void test_create_texture(void) hr2 = 0xdeadbeef; hr = D3DX11CreateTextureFromFileA(device, get_str_a(path), NULL, NULL, &resource, &hr2); ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); - todo_wine_if (i == 30) ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX11_IFF_WMP), "Got unexpected hr %#lx.\n", hr); if (hr == S_OK) @@ -4270,7 +4265,6 @@ static void test_create_texture(void) hr2 = 0xdeadbeef; hr = D3DX11CreateTextureFromResourceW(device, resource_module, test_resource_name, NULL, NULL, &resource, &hr2); - todo_wine_if (i == 30) ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX11_IFF_WMP), "Got unexpected hr %#lx.\n", hr); ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); @@ -4284,7 +4278,6 @@ static void test_create_texture(void) hr2 = 0xdeadbeef; hr = D3DX11CreateTextureFromResourceA(device, resource_module, get_str_a(test_resource_name), NULL, NULL, &resource, &hr2); - todo_wine_if (i == 30) ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX11_IFF_WMP), "Got unexpected hr %#lx.\n", hr); ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); diff --git a/dlls/d3dx11_43/texture.c b/dlls/d3dx11_43/texture.c index 21f5b008964..5d4eaa4ef48 100644 --- a/dlls/d3dx11_43/texture.c +++ b/dlls/d3dx11_43/texture.c @@ -372,7 +372,7 @@ static void init_load_info(const D3DX11_IMAGE_LOAD_INFO *load_info, D3DX11_IMAGE HRESULT load_texture_data(const void *data, SIZE_T size, D3DX11_IMAGE_LOAD_INFO *load_info, D3D11_SUBRESOURCE_DATA **resource_data) { - uint32_t loaded_mip_level_count, max_mip_level_count; + uint32_t loaded_mip_level_count, max_mip_level_count, loaded_layer_count; const struct pixel_format_desc *fmt_desc, *src_desc; struct d3dx_subresource_data *sub_rsrcs = NULL; D3DX11_IMAGE_INFO img_info; @@ -396,12 +396,11 @@ HRESULT load_texture_data(const void *data, SIZE_T size, D3DX11_IMAGE_LOAD_INFO goto end; } - if ((!(img_info.MiscFlags & D3D11_RESOURCE_MISC_TEXTURECUBE) || img_info.ArraySize != 6) - && img_info.ArraySize != 1) + loaded_layer_count = img_info.ArraySize; + if ((loaded_layer_count > 1) && (img_info.ResourceDimension == D3D11_RESOURCE_DIMENSION_TEXTURE3D)) { - FIXME("img_info.ArraySize = %u not supported.\n", img_info.ArraySize); - hr = E_NOTIMPL; - goto end; + TRACE("Ignoring array size variable %u for 3D texture.\n", img_info.ArraySize); + loaded_layer_count = 1; } if (load_info->FirstMipLevel == D3DX11_DEFAULT || load_info->FirstMipLevel >= img_info.MipLevels) @@ -455,13 +454,13 @@ HRESULT load_texture_data(const void *data, SIZE_T size, D3DX11_IMAGE_LOAD_INFO } hr = d3dx_create_subresource_data_for_texture(load_info->Width, load_info->Height, load_info->Depth, - load_info->MipLevels, img_info.ArraySize, fmt_desc, &sub_rsrcs); + load_info->MipLevels, loaded_layer_count, fmt_desc, &sub_rsrcs); if (FAILED(hr)) goto end; src_desc = get_d3dx_pixel_format_info(image.format); loaded_mip_level_count = min(img_info.MipLevels - load_info->FirstMipLevel, load_info->MipLevels); - for (i = 0; i < img_info.ArraySize; ++i) + for (i = 0; i < loaded_layer_count; ++i) { struct volume dst_size = { load_info->Width, load_info->Height, load_info->Depth }; @@ -500,7 +499,7 @@ HRESULT load_texture_data(const void *data, SIZE_T size, D3DX11_IMAGE_LOAD_INFO } d3dx_get_mip_level_size(&base_level_size, base_level); - for (i = 0; i < img_info.ArraySize; ++i) + for (i = 0; i < loaded_layer_count; ++i) { struct volume src_size, dst_size; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10887