From: Connor McAdams cmcadams@codeweavers.com
Signed-off-by: Connor McAdams cmcadams@codeweavers.com --- dlls/d3dx9_36/surface.c | 112 +++++++++++++++++++++++++++++++--- dlls/d3dx9_36/tests/surface.c | 84 ++++++++++++------------- 2 files changed, 145 insertions(+), 51 deletions(-)
diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index 638bddf39ca..da8ab19a4dc 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -517,6 +517,91 @@ static HRESULT d3dx_init_dds_header(struct dds_header *header, D3DRESOURCETYPE r return D3D_OK; }
+static const enum d3dx_pixel_format_id tga_save_pixel_formats[] = +{ + D3DX_PIXEL_FORMAT_B8G8R8_UNORM, + D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM +}; + +static enum d3dx_pixel_format_id d3dx_get_closest_d3dx_pixel_format_id(const enum d3dx_pixel_format_id *format_ids, + uint32_t format_ids_size, enum d3dx_pixel_format_id format_id) +{ + const struct pixel_format_desc *fmt, *curfmt, *bestfmt = NULL; + int bestscore = INT_MIN, rgb_channels, a_channel, i, j; + BOOL alpha_only, rgb_only; + + for (i = 0; i < format_ids_size; ++i) + { + if (format_ids[i] == format_id) + return format_id; + } + + TRACE("Requested format is not directly supported, looking for the best alternative.\n"); + switch (format_id) + { + case D3DX_PIXEL_FORMAT_P8_UINT: + case D3DX_PIXEL_FORMAT_P8_UINT_A8_UNORM: + case D3DX_PIXEL_FORMAT_DXT1_UNORM: + case D3DX_PIXEL_FORMAT_DXT2_UNORM: + case D3DX_PIXEL_FORMAT_DXT3_UNORM: + case D3DX_PIXEL_FORMAT_DXT4_UNORM: + case D3DX_PIXEL_FORMAT_DXT5_UNORM: + fmt = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM); + break; + + default: + fmt = get_d3dx_pixel_format_info(format_id); + break; + } + + alpha_only = rgb_only = FALSE; + if (fmt->a_type != CTYPE_EMPTY && fmt->rgb_type == CTYPE_EMPTY) + alpha_only = TRUE; + else if (fmt->a_type == CTYPE_EMPTY && fmt->rgb_type != CTYPE_EMPTY) + rgb_only = TRUE; + + if (fmt->rgb_type == CTYPE_LUMA) + rgb_channels = 3; + else + rgb_channels = !!fmt->bits[1] + !!fmt->bits[2] + !!fmt->bits[3]; + a_channel = !!fmt->bits[0]; + for (i = 0; i < format_ids_size; ++i) + { + int cur_rgb_channels, cur_a_channel, score; + + curfmt = get_d3dx_pixel_format_info(format_ids[i]); + if (!is_conversion_to_supported(curfmt)) + continue; + if (alpha_only && curfmt->a_type == CTYPE_EMPTY) + continue; + if (rgb_only && curfmt->rgb_type == CTYPE_EMPTY) + continue; + if (fmt->rgb_type == CTYPE_SNORM && curfmt->rgb_type != CTYPE_SNORM) + continue; + + cur_rgb_channels = !!curfmt->bits[1] + !!curfmt->bits[2] + !!curfmt->bits[3]; + cur_a_channel = !!curfmt->bits[0]; + /* Calculate a score for this format. */ + score = 512 * (format_types_match(curfmt, fmt)); + score -= 32 * abs(cur_a_channel - a_channel); + score -= 32 * abs(cur_rgb_channels - rgb_channels); + for (j = 0; j < 4; ++j) + { + int diff = curfmt->bits[j] - fmt->bits[j]; + + score -= (diff < 0 ? -diff * 8 : diff) * (j == 0 ? 1 : 2); + } + + if (score > bestscore) + { + bestscore = score; + bestfmt = curfmt; + } + } + + return (bestfmt) ? bestfmt->format : D3DX_PIXEL_FORMAT_COUNT; +} + static HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const struct pixel_format_desc *src_fmt_desc, D3DXIMAGE_FILEFORMAT file_format, ID3DXBuffer **dst_buffer) { @@ -538,9 +623,17 @@ static HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const break;
case D3DXIFF_TGA: - if ((dst_format != D3DX_PIXEL_FORMAT_B8G8R8_UNORM) && (dst_format != D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM)) + dst_format = d3dx_get_closest_d3dx_pixel_format_id(tga_save_pixel_formats, ARRAY_SIZE(tga_save_pixel_formats), + dst_format); + if (dst_format == D3DX_PIXEL_FORMAT_COUNT) + { + WARN("Failed to find adequate replacement format for saving.\n"); + return D3DERR_INVALIDCALL; + } + + if (dst_format != src_fmt_desc->format && !is_conversion_from_supported(src_fmt_desc)) { - FIXME("Format replacement for TGA files is currently unimplemented.\n"); + FIXME("Cannot convert d3dx pixel format %d, can't save.\n", src_fmt_desc->format); return E_NOTIMPL; } break; @@ -607,9 +700,10 @@ static HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const
if (src_pixels->size.width != 0 && src_pixels->size.height != 0) { + const PALETTEENTRY *dst_palette = is_index_format(dst_fmt_desc) ? src_pixels->palette : NULL; const RECT dst_rect = { 0, 0, src_pixels->size.width, src_pixels->size.height };
- set_d3dx_pixels(&dst_pixels, pixels, dst_row_pitch, dst_slice_pitch, src_pixels->palette, src_pixels->size.width, + set_d3dx_pixels(&dst_pixels, pixels, dst_row_pitch, dst_slice_pitch, dst_palette, src_pixels->size.width, src_pixels->size.height, src_pixels->size.depth, &dst_rect);
hr = d3dx_load_pixels_from_pixels(&dst_pixels, dst_fmt_desc, src_pixels, src_fmt_desc, D3DX_FILTER_NONE, 0); @@ -3012,12 +3106,6 @@ HRESULT WINAPI D3DXSaveSurfaceToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE if (!dst_buffer || !src_surface) return D3DERR_INVALIDCALL;
IDirect3DSurface9_GetDesc(src_surface, &src_surface_desc); - if (file_format != D3DXIFF_DDS && (src_palette || is_index_format(get_format_info(src_surface_desc.Format)))) - { - FIXME("Saving surfaces with palettized pixel formats to non-DDS files is not implemented yet.\n"); - return D3DERR_INVALIDCALL; - } - switch (file_format) { case D3DXIFF_BMP: @@ -3042,6 +3130,12 @@ HRESULT WINAPI D3DXSaveSurfaceToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE return D3DERR_INVALIDCALL; }
+ if (src_palette || is_index_format(get_format_info(src_surface_desc.Format))) + { + FIXME("Saving surfaces with palettized pixel formats via WIC is not implemented yet.\n"); + return D3DERR_INVALIDCALL; + } + if (src_rect) { if (src_rect->left == src_rect->right || src_rect->top == src_rect->bottom) diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c index 25152fc6a74..cf07cd5d84a 100644 --- a/dlls/d3dx9_36/tests/surface.c +++ b/dlls/d3dx9_36/tests/surface.c @@ -3868,7 +3868,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_P8, test_palette, 0x00, { { D3D_OK, D3DFMT_P8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_P8, .todo_hr = TRUE }, @@ -3879,7 +3879,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_A8P8, test_palette, 0x00, { { D3D_OK, D3DFMT_P8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_P8, .todo_hr = TRUE }, @@ -3965,7 +3965,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_X8R8G8B8, NULL, 0x00, { { D3D_OK, D3DFMT_X8R8G8B8, }, { D3D_OK, D3DFMT_X8R8G8B8 }, - { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, }, @@ -3981,7 +3981,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_A8B8G8R8, NULL, 0x00, { { D3D_OK, D3DFMT_A8B8G8R8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8B8G8R8, .todo_hr = TRUE }, @@ -3992,7 +3992,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_X8B8G8R8, NULL, 0x00, { { D3D_OK, D3DFMT_X8B8G8R8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8B8G8R8, .todo_hr = TRUE }, @@ -4003,7 +4003,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_R5G6B5, NULL, 0x00, { { D3D_OK, D3DFMT_R5G6B5, }, { D3D_OK, D3DFMT_X8R8G8B8 }, - { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_format = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_R5G6B5, }, @@ -4014,7 +4014,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_X1R5G5B5, NULL, 0x00, { { D3D_OK, D3DFMT_X1R5G5B5, }, { D3D_OK, D3DFMT_X8R8G8B8 }, - { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_format = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X1R5G5B5, }, @@ -4025,7 +4025,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_A1R5G5B5, NULL, 0x00, { { D3D_OK, D3DFMT_A1R5G5B5, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A1R5G5B5, .todo_hr = TRUE }, @@ -4036,7 +4036,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_R3G3B2, NULL, 0x00, { { D3D_OK, D3DFMT_P8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_P8, .todo_hr = TRUE }, @@ -4047,7 +4047,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_A8R3G3B2, NULL, 0x00, { { D3D_OK, D3DFMT_A8R3G3B2, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R3G3B2, .todo_hr = TRUE }, @@ -4058,7 +4058,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_A4R4G4B4, NULL, 0x00, { { D3D_OK, D3DFMT_A4R4G4B4, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A4R4G4B4, .todo_hr = TRUE }, @@ -4069,7 +4069,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_X4R4G4B4, NULL, 0x00, { { D3D_OK, D3DFMT_X4R4G4B4, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X4R4G4B4, .todo_hr = TRUE }, @@ -4080,7 +4080,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_A2R10G10B10, NULL, 0x00, { { D3D_OK, D3DFMT_A2R10G10B10, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A2R10G10B10, .todo_hr = TRUE }, @@ -4091,7 +4091,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_A2B10G10R10, NULL, 0x00, { { D3D_OK, D3DFMT_A2B10G10R10, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A2B10G10R10, .todo_hr = TRUE }, @@ -4102,7 +4102,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_A16B16G16R16, NULL, 0x00, { { D3D_OK, D3DFMT_X8R8G8B8, .todo_format = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8 }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_format = TRUE }, @@ -4113,7 +4113,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_G16R16, NULL, 0x00, { { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, @@ -4124,7 +4124,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_A8, NULL, 0x00, { { D3D_OK, D3DFMT_A8R3G3B2, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R3G3B2, .todo_hr = TRUE }, @@ -4135,7 +4135,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_A8L8, NULL, 0x00, { { D3D_OK, D3DFMT_A8L8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8L8, .todo_hr = TRUE }, @@ -4146,7 +4146,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_A4L4, NULL, 0x00, { { D3D_OK, D3DFMT_A4R4G4B4, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A4R4G4B4, .todo_hr = TRUE }, @@ -4163,7 +4163,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_L8, NULL, 0x00, { { D3D_OK, D3DFMT_P8, .todo_format = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_format = TRUE }, - { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_format = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_P8, .todo_format = TRUE }, @@ -4174,7 +4174,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_L16, NULL, 0x00, { { D3D_OK, D3DFMT_L16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_L16, .todo_hr = TRUE }, @@ -4185,7 +4185,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_DXT1, NULL, 0x00, { { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, @@ -4196,7 +4196,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_DXT2, NULL, 0x00, { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4207,7 +4207,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_DXT2, NULL, 0xff, { { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, @@ -4218,7 +4218,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_DXT3, NULL, 0x00, { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4229,7 +4229,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_DXT3, NULL, 0xff, { { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, @@ -4240,7 +4240,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_DXT4, NULL, 0x00, { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4251,7 +4251,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_DXT4, NULL, 0xff, { { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, @@ -4262,7 +4262,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_DXT5, NULL, 0x00, { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4273,7 +4273,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_DXT5, NULL, 0xff, { { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, @@ -4284,7 +4284,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_R16F, NULL, 0x00, { { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, @@ -4295,7 +4295,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_G16R16F, NULL, 0x00, { { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, @@ -4306,7 +4306,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_A16B16G16R16F, NULL, 0x00, { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4317,7 +4317,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_R32F, NULL, 0x00, { { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, @@ -4328,7 +4328,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_G32R32F, NULL, 0x00, { { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, @@ -4339,7 +4339,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_A32B32G32R32F, NULL, 0x00, { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4350,7 +4350,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_Q8W8V8U8, NULL, 0x00, { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, - { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, @@ -4361,7 +4361,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_V8U8, NULL, 0x00, { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, - { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, @@ -4372,7 +4372,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_V16U16, NULL, 0x00, { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, - { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, @@ -4383,7 +4383,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_X8L8V8U8, NULL, 0x00, { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, - { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, @@ -4394,7 +4394,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_A2W10V10U10, NULL, 0x00, { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, - { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, @@ -4405,7 +4405,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_Q16W16V16U16, NULL, 0x00, { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, - { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE },