From: Connor McAdams cmcadams@codeweavers.com
Signed-off-by: Connor McAdams cmcadams@codeweavers.com --- dlls/d3dx9_36/tests/d3dx9_test_images.h | 920 ++++++++++++++++++++++++ dlls/d3dx9_36/tests/surface.c | 270 ++++--- dlls/d3dx9_36/tests/texture.c | 137 ++++ dlls/d3dx9_36/tests/volume.c | 134 +++- 4 files changed, 1351 insertions(+), 110 deletions(-)
diff --git a/dlls/d3dx9_36/tests/d3dx9_test_images.h b/dlls/d3dx9_36/tests/d3dx9_test_images.h index e9ee1623134..49fa4135ca6 100644 --- a/dlls/d3dx9_36/tests/d3dx9_test_images.h +++ b/dlls/d3dx9_36/tests/d3dx9_test_images.h @@ -20,6 +20,7 @@ */
#include <stdint.h> +#include <assert.h> #define COBJMACROS #include "d3dx9tex.h"
@@ -868,6 +869,771 @@ static const uint8_t dds_24bit_8_8[] = 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00 };
+static const uint8_t a8r8g8b8_16_16[] = +{ + 0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x03,0x03,0x03,0x03, + 0x04,0x04,0x04,0x04,0x05,0x05,0x05,0x05,0x06,0x06,0x06,0x06,0x07,0x07,0x07,0x07, + 0x08,0x08,0x08,0x08,0x09,0x09,0x09,0x09,0x0a,0x0a,0x0a,0x0a,0x0b,0x0b,0x0b,0x0b, + 0x0c,0x0c,0x0c,0x0c,0x0d,0x0d,0x0d,0x0d,0x0e,0x0e,0x0e,0x0e,0x0f,0x0f,0x0f,0x0f, + 0x10,0x10,0x10,0x10,0x11,0x11,0x11,0x11,0x12,0x12,0x12,0x12,0x13,0x13,0x13,0x13, + 0x14,0x14,0x14,0x14,0x15,0x15,0x15,0x15,0x16,0x16,0x16,0x16,0x17,0x17,0x17,0x17, + 0x18,0x18,0x18,0x18,0x19,0x19,0x19,0x19,0x1a,0x1a,0x1a,0x1a,0x1b,0x1b,0x1b,0x1b, + 0x1c,0x1c,0x1c,0x1c,0x1d,0x1d,0x1d,0x1d,0x1e,0x1e,0x1e,0x1e,0x1f,0x1f,0x1f,0x1f, + 0x20,0x20,0x20,0x20,0x21,0x21,0x21,0x21,0x22,0x22,0x22,0x22,0x23,0x23,0x23,0x23, + 0x24,0x24,0x24,0x24,0x25,0x25,0x25,0x25,0x26,0x26,0x26,0x26,0x27,0x27,0x27,0x27, + 0x28,0x28,0x28,0x28,0x29,0x29,0x29,0x29,0x2a,0x2a,0x2a,0x2a,0x2b,0x2b,0x2b,0x2b, + 0x2c,0x2c,0x2c,0x2c,0x2d,0x2d,0x2d,0x2d,0x2e,0x2e,0x2e,0x2e,0x2f,0x2f,0x2f,0x2f, + 0x30,0x30,0x30,0x30,0x31,0x31,0x31,0x31,0x32,0x32,0x32,0x32,0x33,0x33,0x33,0x33, + 0x34,0x34,0x34,0x34,0x35,0x35,0x35,0x35,0x36,0x36,0x36,0x36,0x37,0x37,0x37,0x37, + 0x38,0x38,0x38,0x38,0x39,0x39,0x39,0x39,0x3a,0x3a,0x3a,0x3a,0x3b,0x3b,0x3b,0x3b, + 0x3c,0x3c,0x3c,0x3c,0x3d,0x3d,0x3d,0x3d,0x3e,0x3e,0x3e,0x3e,0x3f,0x3f,0x3f,0x3f, + 0x40,0x40,0x40,0x40,0x41,0x41,0x41,0x41,0x42,0x42,0x42,0x42,0x43,0x43,0x43,0x43, + 0x44,0x44,0x44,0x44,0x45,0x45,0x45,0x45,0x46,0x46,0x46,0x46,0x47,0x47,0x47,0x47, + 0x48,0x48,0x48,0x48,0x49,0x49,0x49,0x49,0x4a,0x4a,0x4a,0x4a,0x4b,0x4b,0x4b,0x4b, + 0x4c,0x4c,0x4c,0x4c,0x4d,0x4d,0x4d,0x4d,0x4e,0x4e,0x4e,0x4e,0x4f,0x4f,0x4f,0x4f, + 0x50,0x50,0x50,0x50,0x51,0x51,0x51,0x51,0x52,0x52,0x52,0x52,0x53,0x53,0x53,0x53, + 0x54,0x54,0x54,0x54,0x55,0x55,0x55,0x55,0x56,0x56,0x56,0x56,0x57,0x57,0x57,0x57, + 0x58,0x58,0x58,0x58,0x59,0x59,0x59,0x59,0x5a,0x5a,0x5a,0x5a,0x5b,0x5b,0x5b,0x5b, + 0x5c,0x5c,0x5c,0x5c,0x5d,0x5d,0x5d,0x5d,0x5e,0x5e,0x5e,0x5e,0x5f,0x5f,0x5f,0x5f, + 0x60,0x60,0x60,0x60,0x61,0x61,0x61,0x61,0x62,0x62,0x62,0x62,0x63,0x63,0x63,0x63, + 0x64,0x64,0x64,0x64,0x65,0x65,0x65,0x65,0x66,0x66,0x66,0x66,0x67,0x67,0x67,0x67, + 0x68,0x68,0x68,0x68,0x69,0x69,0x69,0x69,0x6a,0x6a,0x6a,0x6a,0x6b,0x6b,0x6b,0x6b, + 0x6c,0x6c,0x6c,0x6c,0x6d,0x6d,0x6d,0x6d,0x6e,0x6e,0x6e,0x6e,0x6f,0x6f,0x6f,0x6f, + 0x70,0x70,0x70,0x70,0x71,0x71,0x71,0x71,0x72,0x72,0x72,0x72,0x73,0x73,0x73,0x73, + 0x74,0x74,0x74,0x74,0x75,0x75,0x75,0x75,0x76,0x76,0x76,0x76,0x77,0x77,0x77,0x77, + 0x78,0x78,0x78,0x78,0x79,0x79,0x79,0x79,0x7a,0x7a,0x7a,0x7a,0x7b,0x7b,0x7b,0x7b, + 0x7c,0x7c,0x7c,0x7c,0x7d,0x7d,0x7d,0x7d,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f, + 0x80,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x82,0x82,0x82,0x82,0x83,0x83,0x83,0x83, + 0x84,0x84,0x84,0x84,0x85,0x85,0x85,0x85,0x86,0x86,0x86,0x86,0x87,0x87,0x87,0x87, + 0x88,0x88,0x88,0x88,0x89,0x89,0x89,0x89,0x8a,0x8a,0x8a,0x8a,0x8b,0x8b,0x8b,0x8b, + 0x8c,0x8c,0x8c,0x8c,0x8d,0x8d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xf6,0xf6,0xf6,0xf6,0xf7,0xf7,0xf7,0xf7, + 0xf8,0xf8,0xf8,0xf8,0xf9,0xf9,0xf9,0xf9,0xfa,0xfa,0xfa,0xfa,0xfb,0xfb,0xfb,0xfb, + 0xfc,0xfc,0xfc,0xfc,0xfd,0xfd,0xfd,0xfd,0xfe,0xfe,0xfe,0xfe,0xff,0xff,0xff,0xff, +}; + +static const uint8_t a8r8g8b8_16_16_point_filter_8_8[] = +{ + 0x00,0x00,0x00,0x00,0x02,0x02,0x02,0x02,0x04,0x04,0x04,0x04,0x06,0x06,0x06,0x06, + 0x08,0x08,0x08,0x08,0x0a,0x0a,0x0a,0x0a,0x0c,0x0c,0x0c,0x0c,0x0e,0x0e,0x0e,0x0e, + 0x20,0x20,0x20,0x20,0x22,0x22,0x22,0x22,0x24,0x24,0x24,0x24,0x26,0x26,0x26,0x26, + 0x28,0x28,0x28,0x28,0x2a,0x2a,0x2a,0x2a,0x2c,0x2c,0x2c,0x2c,0x2e,0x2e,0x2e,0x2e, + 0x40,0x40,0x40,0x40,0x42,0x42,0x42,0x42,0x44,0x44,0x44,0x44,0x46,0x46,0x46,0x46, + 0x48,0x48,0x48,0x48,0x4a,0x4a,0x4a,0x4a,0x4c,0x4c,0x4c,0x4c,0x4e,0x4e,0x4e,0x4e, + 0x60,0x60,0x60,0x60,0x62,0x62,0x62,0x62,0x64,0x64,0x64,0x64,0x66,0x66,0x66,0x66, + 0x68,0x68,0x68,0x68,0x6a,0x6a,0x6a,0x6a,0x6c,0x6c,0x6c,0x6c,0x6e,0x6e,0x6e,0x6e, + 0x80,0x80,0x80,0x80,0x82,0x82,0x82,0x82,0x84,0x84,0x84,0x84,0x86,0x86,0x86,0x86, + 0x88,0x88,0x88,0x88,0x8a,0x8a,0x8a,0x8a,0x8c,0x8c,0x8c,0x8c,0x8e,0x8e,0x8e,0x8e, + 0xa0,0xa0,0xa0,0xa0,0xa2,0xa2,0xa2,0xa2,0xa4,0xa4,0xa4,0xa4,0xa6,0xa6,0xa6,0xa6, + 0xa8,0xa8,0xa8,0xa8,0xaa,0xaa,0xaa,0xaa,0xac,0xac,0xac,0xac,0xae,0xae,0xae,0xae, + 0xc0,0xc0,0xc0,0xc0,0xc2,0xc2,0xc2,0xc2,0xc4,0xc4,0xc4,0xc4,0xc6,0xc6,0xc6,0xc6, + 0xc8,0xc8,0xc8,0xc8,0xca,0xca,0xca,0xca,0xcc,0xcc,0xcc,0xcc,0xce,0xce,0xce,0xce, + 0xe0,0xe0,0xe0,0xe0,0xe2,0xe2,0xe2,0xe2,0xe4,0xe4,0xe4,0xe4,0xe6,0xe6,0xe6,0xe6, + 0xe8,0xe8,0xe8,0xe8,0xea,0xea,0xea,0xea,0xec,0xec,0xec,0xec,0xee,0xee,0xee,0xee, +}; + +static const uint8_t a8r8g8b8_16_16_linear_filter_8_8[] = +{ + 0x09,0x09,0x09,0x09,0x0b,0x0b,0x0b,0x0b,0x0d,0x0d,0x0d,0x0d,0x0f,0x0f,0x0f,0x0f, + 0x11,0x11,0x11,0x11,0x13,0x13,0x13,0x13,0x15,0x15,0x15,0x15,0x17,0x17,0x17,0x17, + 0x29,0x29,0x29,0x29,0x2b,0x2b,0x2b,0x2b,0x2d,0x2d,0x2d,0x2d,0x2f,0x2f,0x2f,0x2f, + 0x31,0x31,0x31,0x31,0x33,0x33,0x33,0x33,0x35,0x35,0x35,0x35,0x37,0x37,0x37,0x37, + 0x49,0x49,0x49,0x49,0x4b,0x4b,0x4b,0x4b,0x4d,0x4d,0x4d,0x4d,0x4f,0x4f,0x4f,0x4f, + 0x51,0x51,0x51,0x51,0x53,0x53,0x53,0x53,0x55,0x55,0x55,0x55,0x57,0x57,0x57,0x57, + 0x69,0x69,0x69,0x69,0x6b,0x6b,0x6b,0x6b,0x6d,0x6d,0x6d,0x6d,0x6f,0x6f,0x6f,0x6f, + 0x71,0x71,0x71,0x71,0x73,0x73,0x73,0x73,0x75,0x75,0x75,0x75,0x77,0x77,0x77,0x77, + 0x89,0x89,0x89,0x89,0x8b,0x8b,0x8b,0x8b,0x8d,0x8d,0x8d,0x8d,0x8f,0x8f,0x8f,0x8f, + 0x91,0x91,0x91,0x91,0x93,0x93,0x93,0x93,0x95,0x95,0x95,0x95,0x97,0x97,0x97,0x97, + 0xa9,0xa9,0xa9,0xa9,0xab,0xab,0xab,0xab,0xad,0xad,0xad,0xad,0xaf,0xaf,0xaf,0xaf, + 0xb1,0xb1,0xb1,0xb1,0xb3,0xb3,0xb3,0xb3,0xb5,0xb5,0xb5,0xb5,0xb7,0xb7,0xb7,0xb7, + 0xc9,0xc9,0xc9,0xc9,0xcb,0xcb,0xcb,0xcb,0xcd,0xcd,0xcd,0xcd,0xcf,0xcf,0xcf,0xcf, + 0xd1,0xd1,0xd1,0xd1,0xd3,0xd3,0xd3,0xd3,0xd5,0xd5,0xd5,0xd5,0xd7,0xd7,0xd7,0xd7, + 0xe9,0xe9,0xe9,0xe9,0xeb,0xeb,0xeb,0xeb,0xed,0xed,0xed,0xed,0xef,0xef,0xef,0xef, + 0xf1,0xf1,0xf1,0xf1,0xf3,0xf3,0xf3,0xf3,0xf5,0xf5,0xf5,0xf5,0xf7,0xf7,0xf7,0xf7, +}; + +static const uint8_t a8r8g8b8_16_16_triangle_filter_8_8[] = +{ + 0x1a,0x1a,0x1a,0x1a,0x1b,0x1b,0x1b,0x1b,0x1d,0x1d,0x1d,0x1d,0x1f,0x1f,0x1f,0x1f, + 0x21,0x21,0x21,0x21,0x23,0x23,0x23,0x23,0x25,0x25,0x25,0x25,0x26,0x26,0x26,0x26, + 0x2a,0x2a,0x2a,0x2a,0x2b,0x2b,0x2b,0x2b,0x2d,0x2d,0x2d,0x2d,0x2f,0x2f,0x2f,0x2f, + 0x31,0x31,0x31,0x31,0x33,0x33,0x33,0x33,0x35,0x35,0x35,0x35,0x36,0x36,0x36,0x36, + 0x49,0x49,0x49,0x49,0x4b,0x4b,0x4b,0x4b,0x4d,0x4d,0x4d,0x4d,0x4f,0x4f,0x4f,0x4f, + 0x51,0x51,0x51,0x51,0x53,0x53,0x53,0x53,0x55,0x55,0x55,0x55,0x56,0x56,0x56,0x56, + 0x6a,0x6a,0x6a,0x6a,0x6b,0x6b,0x6b,0x6b,0x6d,0x6d,0x6d,0x6d,0x6f,0x6f,0x6f,0x6f, + 0x71,0x71,0x71,0x71,0x73,0x73,0x73,0x73,0x75,0x75,0x75,0x75,0x76,0x76,0x76,0x76, + 0x8a,0x8a,0x8a,0x8a,0x8b,0x8b,0x8b,0x8b,0x8d,0x8d,0x8d,0x8d,0x8f,0x8f,0x8f,0x8f, + 0x91,0x91,0x91,0x91,0x93,0x93,0x93,0x93,0x95,0x95,0x95,0x95,0x96,0x96,0x96,0x96, + 0xaa,0xaa,0xaa,0xaa,0xab,0xab,0xab,0xab,0xad,0xad,0xad,0xad,0xaf,0xaf,0xaf,0xaf, + 0xb1,0xb1,0xb1,0xb1,0xb3,0xb3,0xb3,0xb3,0xb5,0xb5,0xb5,0xb5,0xb6,0xb6,0xb6,0xb6, + 0xca,0xca,0xca,0xca,0xcb,0xcb,0xcb,0xcb,0xcd,0xcd,0xcd,0xcd,0xcf,0xcf,0xcf,0xcf, + 0xd1,0xd1,0xd1,0xd1,0xd3,0xd3,0xd3,0xd3,0xd5,0xd5,0xd5,0xd5,0xd6,0xd6,0xd6,0xd6, + 0xda,0xda,0xda,0xda,0xdb,0xdb,0xdb,0xdb,0xdd,0xdd,0xdd,0xdd,0xdf,0xdf,0xdf,0xdf, + 0xe1,0xe1,0xe1,0xe1,0xe3,0xe3,0xe3,0xe3,0xe5,0xe5,0xe5,0xe5,0xe6,0xe6,0xe6,0xe6, +}; + +static const uint8_t a8r8g8b8_16_16_triangle_filter_8_8_32bit[] = +{ + 0x1a,0x1a,0x1a,0x1a,0x1b,0x1b,0x1b,0x1b,0x1d,0x1d,0x1d,0x1d,0x1f,0x1f,0x1f,0x1f, + 0x21,0x21,0x21,0x21,0x23,0x23,0x23,0x23,0x25,0x25,0x25,0x25,0x26,0x26,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e3,0xe3,0xe5,0xe5,0xe5,0xe5,0xe6,0xe6,0xe6,0xe6, +}; + +static const uint8_t a8r8g8b8_16_16_point_filter_7_7[] = +{ + 0x00,0x00,0x00,0x00,0x02,0x02,0x02,0x02,0x04,0x04,0x04,0x04,0x06,0x06,0x06,0x06, + 0x09,0x09,0x09,0x09,0x0b,0x0b,0x0b,0x0b,0x0d,0x0d,0x0d,0x0d,0x20,0x20,0x20,0x20, + 0x22,0x22,0x22,0x22,0x24,0x24,0x24,0x24,0x26,0x26,0x26,0x26,0x29,0x29,0x29,0x29, + 0x2b,0x2b,0x2b,0x2b,0x2d,0x2d,0x2d,0x2d,0x40,0x40,0x40,0x40,0x42,0x42,0x42,0x42, + 0x44,0x44,0x44,0x44,0x46,0x46,0x46,0x46,0x49,0x49,0x49,0x49,0x4b,0x4b,0x4b,0x4b, + 0x4d,0x4d,0x4d,0x4d,0x60,0x60,0x60,0x60,0x62,0x62,0x62,0x62,0x64,0x64,0x64,0x64, + 0x66,0x66,0x66,0x66,0x69,0x69,0x69,0x69,0x6b,0x6b,0x6b,0x6b,0x6d,0x6d,0x6d,0x6d, + 0x90,0x90,0x90,0x90,0x92,0x92,0x92,0x92,0x94,0x94,0x94,0x94,0x96,0x96,0x96,0x96, + 0x99,0x99,0x99,0x99,0x9b,0x9b,0x9b,0x9b,0x9d,0x9d,0x9d,0x9d,0xb0,0xb0,0xb0,0xb0, + 0xb2,0xb2,0xb2,0xb2,0xb4,0xb4,0xb4,0xb4,0xb6,0xb6,0xb6,0xb6,0xb9,0xb9,0xb9,0xb9, + 0xbb,0xbb,0xbb,0xbb,0xbd,0xbd,0xbd,0xbd,0xd0,0xd0,0xd0,0xd0,0xd2,0xd2,0xd2,0xd2, + 0xd4,0xd4,0xd4,0xd4,0xd6,0xd6,0xd6,0xd6,0xd9,0xd9,0xd9,0xd9,0xdb,0xdb,0xdb,0xdb, + 0xdd,0xdd,0xdd,0xdd, +}; + +static const uint8_t a8r8g8b8_16_16_linear_filter_7_7[] = +{ + 0x0b,0x0b,0x0b,0x0b,0x0d,0x0d,0x0d,0x0d,0x10,0x10,0x10,0x10,0x12,0x12,0x12,0x12, + 0x14,0x14,0x14,0x14,0x16,0x16,0x16,0x16,0x19,0x19,0x19,0x19,0x30,0x30,0x30,0x30, + 0x32,0x32,0x32,0x32,0x34,0x34,0x34,0x34,0x36,0x36,0x36,0x36,0x39,0x39,0x39,0x39, + 0x3b,0x3b,0x3b,0x3b,0x3d,0x3d,0x3d,0x3d,0x54,0x54,0x54,0x54,0x56,0x56,0x56,0x56, + 0x59,0x59,0x59,0x59,0x5b,0x5b,0x5b,0x5b,0x5d,0x5d,0x5d,0x5d,0x60,0x60,0x60,0x60, + 0x62,0x62,0x62,0x62,0x79,0x79,0x79,0x79,0x7b,0x7b,0x7b,0x7b,0x7d,0x7d,0x7d,0x7d, + 0x80,0x80,0x80,0x80,0x82,0x82,0x82,0x82,0x84,0x84,0x84,0x84,0x86,0x86,0x86,0x86, + 0x9d,0x9d,0x9d,0x9d,0xa0,0xa0,0xa0,0xa0,0xa2,0xa2,0xa2,0xa2,0xa4,0xa4,0xa4,0xa4, + 0xa6,0xa6,0xa6,0xa6,0xa9,0xa9,0xa9,0xa9,0xab,0xab,0xab,0xab,0xc2,0xc2,0xc2,0xc2, + 0xc4,0xc4,0xc4,0xc4,0xc6,0xc6,0xc6,0xc6,0xc9,0xc9,0xc9,0xc9,0xcb,0xcb,0xcb,0xcb, + 0xcd,0xcd,0xcd,0xcd,0xd0,0xd0,0xd0,0xd0,0xe6,0xe6,0xe6,0xe6,0xe9,0xe9,0xe9,0xe9, + 0xeb,0xeb,0xeb,0xeb,0xed,0xed,0xed,0xed,0xf0,0xf0,0xf0,0xf0,0xf2,0xf2,0xf2,0xf2, + 0xf4,0xf4,0xf4,0xf4, +}; + +static const uint8_t a8r8g8b8_16_16_triangle_filter_7_7[] = +{ + 0x1a,0x1a,0x1a,0x1a,0x1b,0x1b,0x1b,0x1b,0x1e,0x1e,0x1e,0x1e,0x20,0x20,0x20,0x20, + 0x22,0x22,0x22,0x22,0x24,0x24,0x24,0x24,0x26,0x26,0x26,0x26,0x30,0x30,0x30,0x30, + 0x32,0x32,0x32,0x32,0x34,0x34,0x34,0x34,0x36,0x36,0x36,0x36,0x39,0x39,0x39,0x39, + 0x3b,0x3b,0x3b,0x3b,0x3c,0x3c,0x3c,0x3c,0x55,0x55,0x55,0x55,0x56,0x56,0x56,0x56, + 0x59,0x59,0x59,0x59,0x5b,0x5b,0x5b,0x5b,0x5d,0x5d,0x5d,0x5d,0x60,0x60,0x60,0x60, + 0x61,0x61,0x61,0x61,0x7a,0x7a,0x7a,0x7a,0x7b,0x7b,0x7b,0x7b,0x7d,0x7d,0x7d,0x7d, + 0x80,0x80,0x80,0x80,0x82,0x82,0x82,0x82,0x84,0x84,0x84,0x84,0x85,0x85,0x85,0x85, + 0x9e,0x9e,0x9e,0x9e,0xa0,0xa0,0xa0,0xa0,0xa2,0xa2,0xa2,0xa2,0xa4,0xa4,0xa4,0xa4, + 0xa6,0xa6,0xa6,0xa6,0xa9,0xa9,0xa9,0xa9,0xaa,0xaa,0xaa,0xaa,0xc3,0xc3,0xc3,0xc3, + 0xc4,0xc4,0xc4,0xc4,0xc6,0xc6,0xc6,0xc6,0xc9,0xc9,0xc9,0xc9,0xcb,0xcb,0xcb,0xcb, + 0xcd,0xcd,0xcd,0xcd,0xcf,0xcf,0xcf,0xcf,0xd9,0xd9,0xd9,0xd9,0xdb,0xdb,0xdb,0xdb, + 0xdd,0xdd,0xdd,0xdd,0xdf,0xdf,0xdf,0xdf,0xe1,0xe1,0xe1,0xe1,0xe4,0xe4,0xe4,0xe4, + 0xe5,0xe5,0xe5,0xe5, +}; + +static const uint8_t a8r8g8b8_6_6[] = +{ + 0x00,0x00,0x00,0x00,0x0c,0x0c,0x0c,0x0c,0x18,0x18,0x18,0x18,0x24,0x24,0x24,0x24, + 0x30,0x30,0x30,0x30,0x3c,0x3c,0x3c,0x3c,0x28,0x28,0x28,0x28,0x34,0x34,0x34,0x34, + 0x40,0x40,0x40,0x40,0x4c,0x4c,0x4c,0x4c,0x58,0x58,0x58,0x58,0x64,0x64,0x64,0x64, + 0x50,0x50,0x50,0x50,0x5c,0x5c,0x5c,0x5c,0x68,0x68,0x68,0x68,0x74,0x74,0x74,0x74, + 0x80,0x80,0x80,0x80,0x8c,0x8c,0x8c,0x8c,0x78,0x78,0x78,0x78,0x84,0x84,0x84,0x84, + 0x90,0x90,0x90,0x90,0x9c,0x9c,0x9c,0x9c,0xa8,0xa8,0xa8,0xa8,0xb4,0xb4,0xb4,0xb4, + 0xa0,0xa0,0xa0,0xa0,0xac,0xac,0xac,0xac,0xb8,0xb8,0xb8,0xb8,0xc4,0xc4,0xc4,0xc4, + 0xd0,0xd0,0xd0,0xd0,0xdc,0xdc,0xdc,0xdc,0xc8,0xc8,0xc8,0xc8,0xd4,0xd4,0xd4,0xd4, + 0xe0,0xe0,0xe0,0xe0,0xec,0xec,0xec,0xec,0xf8,0xf8,0xf8,0xf8,0xff,0xff,0xff,0xff, +}; + +static const uint8_t a8r8g8b8_6_6_point_filter_3_3[] = +{ + 0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x30,0x30,0x30,0x30,0x50,0x50,0x50,0x50, + 0x68,0x68,0x68,0x68,0x80,0x80,0x80,0x80,0xa0,0xa0,0xa0,0xa0,0xb8,0xb8,0xb8,0xb8, + 0xd0,0xd0,0xd0,0xd0, +}; +static const uint8_t a8r8g8b8_6_6_linear_filter_3_3[] = +{ + 0x1a,0x1a,0x1a,0x1a,0x32,0x32,0x32,0x32,0x4a,0x4a,0x4a,0x4a,0x6a,0x6a,0x6a,0x6a, + 0x82,0x82,0x82,0x82,0x9a,0x9a,0x9a,0x9a,0xba,0xba,0xba,0xba,0xd2,0xd2,0xd2,0xd2, + 0xe9,0xe9,0xe9,0xe9, +}; + +static const uint8_t a8r8g8b8_6_6_triangle_filter_3_3[] = +{ + 0x2d,0x2d,0x2d,0x2d,0x41,0x41,0x41,0x41,0x54,0x54,0x54,0x54,0x6f,0x6f,0x6f,0x6f, + 0x82,0x82,0x82,0x82,0x96,0x96,0x96,0x96,0xaf,0xaf,0xaf,0xaf,0xc3,0xc3,0xc3,0xc3, + 0xd6,0xd6,0xd6,0xd6, +}; + +static const uint8_t a8r8g8b8_6_6_triangle_dither_filter_3_3[] = +{ + 0x2e,0x2e,0x2e,0x2e,0x41,0x41,0x41,0x41,0x55,0x55,0x55,0x55,0x6e,0x6e,0x6e,0x6e, + 0x82,0x82,0x82,0x82,0x95,0x95,0x95,0x95,0xb0,0xb0,0xb0,0xb0,0xc3,0xc3,0xc3,0xc3, + 0xd6,0xd6,0xd6,0xd6, +}; + +static const uint8_t a8r8g8b8_6_6_point_filter_4_4[] = +{ + 0x00,0x00,0x00,0x00,0x0c,0x0c,0x0c,0x0c,0x24,0x24,0x24,0x24,0x30,0x30,0x30,0x30, + 0x28,0x28,0x28,0x28,0x34,0x34,0x34,0x34,0x4c,0x4c,0x4c,0x4c,0x58,0x58,0x58,0x58, + 0x78,0x78,0x78,0x78,0x84,0x84,0x84,0x84,0x9c,0x9c,0x9c,0x9c,0xa8,0xa8,0xa8,0xa8, + 0xa0,0xa0,0xa0,0xa0,0xac,0xac,0xac,0xac,0xc4,0xc4,0xc4,0xc4,0xd0,0xd0,0xd0,0xd0, +}; + +static const uint8_t a8r8g8b8_6_6_linear_filter_4_4[] = +{ + 0x0d,0x0d,0x0d,0x0d,0x1f,0x1f,0x1f,0x1f,0x31,0x31,0x31,0x31,0x43,0x43,0x43,0x43, + 0x49,0x49,0x49,0x49,0x5b,0x5b,0x5b,0x5b,0x6d,0x6d,0x6d,0x6d,0x7f,0x7f,0x7f,0x7f, + 0x85,0x85,0x85,0x85,0x97,0x97,0x97,0x97,0xa9,0xa9,0xa9,0xa9,0xbb,0xbb,0xbb,0xbb, + 0xc1,0xc1,0xc1,0xc1,0xd3,0xd3,0xd3,0xd3,0xe5,0xe5,0xe5,0xe5,0xf4,0xf4,0xf4,0xf4, +}; + +static const uint8_t a8r8g8b8_6_6_triangle_filter_4_4[] = +{ + 0x27,0x27,0x27,0x27,0x33,0x33,0x33,0x33,0x45,0x45,0x45,0x45,0x51,0x51,0x51,0x51, + 0x4f,0x4f,0x4f,0x4f,0x5b,0x5b,0x5b,0x5b,0x6d,0x6d,0x6d,0x6d,0x79,0x79,0x79,0x79, + 0x8b,0x8b,0x8b,0x8b,0x97,0x97,0x97,0x97,0xa9,0xa9,0xa9,0xa9,0xb5,0xb5,0xb5,0xb5, + 0xb3,0xb3,0xb3,0xb3,0xbf,0xbf,0xbf,0xbf,0xd1,0xd1,0xd1,0xd1,0xdb,0xdb,0xdb,0xdb, +}; + +static const uint8_t a8r8g8b8_4_4[] = +{ + 0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x20,0x20,0x20,0x20,0x30,0x30,0x30,0x30, + 0x40,0x40,0x40,0x40,0x50,0x50,0x50,0x50,0x60,0x60,0x60,0x60,0x70,0x70,0x70,0x70, + 0x80,0x80,0x80,0x80,0x90,0x90,0x90,0x90,0xa0,0xa0,0xa0,0xa0,0xb0,0xb0,0xb0,0xb0, + 0xc0,0xc0,0xc0,0xc0,0xd0,0xd0,0xd0,0xd0,0xe0,0xe0,0xe0,0xe0,0xf0,0xf0,0xf0,0xf0, +}; + +static const uint8_t a8r8g8b8_4_4_point_filter_12_12[] = +{ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, + 0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x60,0x60,0x60,0x60, + 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70, + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, + 0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x60,0x60,0x60,0x60, + 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70, + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, + 0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x60,0x60,0x60,0x60, + 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70, + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, + 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0xa0,0xa0,0xa0,0xa0, + 0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0, + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, + 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0xa0,0xa0,0xa0,0xa0, + 0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0, + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, + 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0xa0,0xa0,0xa0,0xa0, + 0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0, + 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, + 0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xe0,0xe0,0xe0,0xe0, + 0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, + 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, + 0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xe0,0xe0,0xe0,0xe0, + 0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, +}; + +static const uint8_t a8r8g8b8_4_4_linear_filter_12_12[] = +{ + 0x50,0x50,0x50,0x50,0x40,0x40,0x40,0x40,0x45,0x45,0x45,0x45,0x4b,0x4b,0x4b,0x4b, + 0x50,0x50,0x50,0x50,0x55,0x55,0x55,0x55,0x5b,0x5b,0x5b,0x5b,0x60,0x60,0x60,0x60, + 0x65,0x65,0x65,0x65,0x6b,0x6b,0x6b,0x6b,0x70,0x70,0x70,0x70,0x60,0x60,0x60,0x60, + 0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x05,0x05,0x05,0x05,0x0b,0x0b,0x0b,0x0b, + 0x10,0x10,0x10,0x10,0x15,0x15,0x15,0x15,0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20, + 0x25,0x25,0x25,0x25,0x2b,0x2b,0x2b,0x2b,0x30,0x30,0x30,0x30,0x20,0x20,0x20,0x20, + 0x25,0x25,0x25,0x25,0x15,0x15,0x15,0x15,0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20, + 0x25,0x25,0x25,0x25,0x2b,0x2b,0x2b,0x2b,0x30,0x30,0x30,0x30,0x35,0x35,0x35,0x35, + 0x3b,0x3b,0x3b,0x3b,0x40,0x40,0x40,0x40,0x45,0x45,0x45,0x45,0x35,0x35,0x35,0x35, + 0x3b,0x3b,0x3b,0x3b,0x2b,0x2b,0x2b,0x2b,0x30,0x30,0x30,0x30,0x35,0x35,0x35,0x35, + 0x3b,0x3b,0x3b,0x3b,0x40,0x40,0x40,0x40,0x45,0x45,0x45,0x45,0x4b,0x4b,0x4b,0x4b, + 0x50,0x50,0x50,0x50,0x55,0x55,0x55,0x55,0x5b,0x5b,0x5b,0x5b,0x4b,0x4b,0x4b,0x4b, + 0x50,0x50,0x50,0x50,0x40,0x40,0x40,0x40,0x45,0x45,0x45,0x45,0x4b,0x4b,0x4b,0x4b, + 0x50,0x50,0x50,0x50,0x55,0x55,0x55,0x55,0x5b,0x5b,0x5b,0x5b,0x60,0x60,0x60,0x60, + 0x65,0x65,0x65,0x65,0x6b,0x6b,0x6b,0x6b,0x70,0x70,0x70,0x70,0x60,0x60,0x60,0x60, + 0x65,0x65,0x65,0x65,0x55,0x55,0x55,0x55,0x5b,0x5b,0x5b,0x5b,0x60,0x60,0x60,0x60, + 0x65,0x65,0x65,0x65,0x6b,0x6b,0x6b,0x6b,0x70,0x70,0x70,0x70,0x75,0x75,0x75,0x75, + 0x7b,0x7b,0x7b,0x7b,0x80,0x80,0x80,0x80,0x85,0x85,0x85,0x85,0x75,0x75,0x75,0x75, + 0x7b,0x7b,0x7b,0x7b,0x6b,0x6b,0x6b,0x6b,0x70,0x70,0x70,0x70,0x75,0x75,0x75,0x75, + 0x7b,0x7b,0x7b,0x7b,0x80,0x80,0x80,0x80,0x85,0x85,0x85,0x85,0x8b,0x8b,0x8b,0x8b, + 0x90,0x90,0x90,0x90,0x95,0x95,0x95,0x95,0x9b,0x9b,0x9b,0x9b,0x8b,0x8b,0x8b,0x8b, + 0x90,0x90,0x90,0x90,0x80,0x80,0x80,0x80,0x85,0x85,0x85,0x85,0x8b,0x8b,0x8b,0x8b, + 0x90,0x90,0x90,0x90,0x95,0x95,0x95,0x95,0x9b,0x9b,0x9b,0x9b,0xa0,0xa0,0xa0,0xa0, + 0xa5,0xa5,0xa5,0xa5,0xab,0xab,0xab,0xab,0xb0,0xb0,0xb0,0xb0,0xa0,0xa0,0xa0,0xa0, + 0xa5,0xa5,0xa5,0xa5,0x95,0x95,0x95,0x95,0x9b,0x9b,0x9b,0x9b,0xa0,0xa0,0xa0,0xa0, + 0xa5,0xa5,0xa5,0xa5,0xab,0xab,0xab,0x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,0x65,0x65,0x6b,0x6b,0x6b,0x6b,0x6d,0x6d,0x6d,0x6d,0x60,0x60,0x60,0x60, + 0x1b,0x1b,0x1b,0x1b,0x0d,0x0d,0x0d,0x0d,0x10,0x10,0x10,0x10,0x15,0x15,0x15,0x15, + 0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20,0x25,0x25,0x25,0x25,0x2b,0x2b,0x2b,0x2b, + 0x30,0x30,0x30,0x30,0x35,0x35,0x35,0x35,0x38,0x38,0x38,0x38,0x2b,0x2b,0x2b,0x2b, + 0x25,0x25,0x25,0x25,0x18,0x18,0x18,0x18,0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20, + 0x25,0x25,0x25,0x25,0x2b,0x2b,0x2b,0x2b,0x30,0x30,0x30,0x30,0x35,0x35,0x35,0x35, + 0x3b,0x3b,0x3b,0x3b,0x40,0x40,0x40,0x40,0x43,0x43,0x43,0x43,0x35,0x35,0x35,0x35, + 0x3b,0x3b,0x3b,0x3b,0x2d,0x2d,0x2d,0x2d,0x30,0x30,0x30,0x30,0x35,0x35,0x35,0x35, + 0x3b,0x3b,0x3b,0x3b,0x40,0x40,0x40,0x40,0x45,0x45,0x45,0x45,0x4b,0x4b,0x4b,0x4b, + 0x50,0x50,0x50,0x50,0x55,0x55,0x55,0x55,0x58,0x58,0x58,0x58,0x4b,0x4b,0x4b,0x4b, + 0x50,0x50,0x50,0x50,0x43,0x43,0x43,0x43,0x45,0x45,0x45,0x45,0x4b,0x4b,0x4b,0x4b, + 0x50,0x50,0x50,0x50,0x55,0x55,0x55,0x55,0x5b,0x5b,0x5b,0x5b,0x60,0x60,0x60,0x60, + 0x65,0x65,0x65,0x65,0x6b,0x6b,0x6b,0x6b,0x6d,0x6d,0x6d,0x6d,0x60,0x60,0x60,0x60, + 0x65,0x65,0x65,0x65,0x58,0x58,0x58,0x58,0x5b,0x5b,0x5b,0x5b,0x60,0x60,0x60,0x60, + 0x65,0x65,0x65,0x65,0x6b,0x6b,0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cb, + 0xc5,0xc5,0xc5,0xc5,0xb8,0xb8,0xb8,0xb8,0xbb,0xbb,0xbb,0xbb,0xc0,0xc0,0xc0,0xc0, + 0xc5,0xc5,0xc5,0xc5,0xcb,0xcb,0xcb,0xcb,0xd0,0xd0,0xd0,0xd0,0xd5,0xd5,0xd5,0xd5, + 0xdb,0xdb,0xdb,0xdb,0xe0,0xe0,0xe0,0xe0,0xe3,0xe3,0xe3,0xe3,0xd5,0xd5,0xd5,0xd5, + 0x90,0x90,0x90,0x90,0x83,0x83,0x83,0x83,0x85,0x85,0x85,0x85,0x8b,0x8b,0x8b,0x8b, + 0x90,0x90,0x90,0x90,0x95,0x95,0x95,0x95,0x9b,0x9b,0x9b,0x9b,0xa0,0xa0,0xa0,0xa0, + 0xa5,0xa5,0xa5,0xa5,0xab,0xab,0xab,0xab,0xad,0xad,0xad,0xad,0xa0,0xa0,0xa0,0xa0, +}; + +static const uint8_t a8r8g8b8_4_4_point_filter_8_8[] = +{ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50, + 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70, + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50, + 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70, + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90, + 0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0, + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90, + 0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0, + 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0, + 0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, + 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0, + 0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, +}; + +static const uint8_t a8r8g8b8_4_4_linear_filter_8_8[] = +{ + 0x3c,0x3c,0x3c,0x3c,0x34,0x34,0x34,0x34,0x3c,0x3c,0x3c,0x3c,0x44,0x44,0x44,0x44, + 0x4c,0x4c,0x4c,0x4c,0x54,0x54,0x54,0x54,0x5c,0x5c,0x5c,0x5c,0x54,0x54,0x54,0x54, + 0x1c,0x1c,0x1c,0x1c,0x14,0x14,0x14,0x14,0x1c,0x1c,0x1c,0x1c,0x24,0x24,0x24,0x24, + 0x2c,0x2c,0x2c,0x2c,0x34,0x34,0x34,0x34,0x3c,0x3c,0x3c,0x3c,0x34,0x34,0x34,0x34, + 0x3c,0x3c,0x3c,0x3c,0x34,0x34,0x34,0x34,0x3c,0x3c,0x3c,0x3c,0x44,0x44,0x44,0x44, + 0x4c,0x4c,0x4c,0x4c,0x54,0x54,0x54,0x54,0x5c,0x5c,0x5c,0x5c,0x54,0x54,0x54,0x54, + 0x5c,0x5c,0x5c,0x5c,0x54,0x54,0x54,0x54,0x5c,0x5c,0x5c,0x5c,0x64,0x64,0x64,0x64, + 0x6c,0x6c,0x6c,0x6c,0x74,0x74,0x74,0x74,0x7c,0x7c,0x7c,0x7c,0x74,0x74,0x74,0x74, + 0x7c,0x7c,0x7c,0x7c,0x74,0x74,0x74,0x74,0x7c,0x7c,0x7c,0x7c,0x84,0x84,0x84,0x84, + 0x8c,0x8c,0x8c,0x8c,0x94,0x94,0x94,0x94,0x9c,0x9c,0x9c,0x9c,0x94,0x94,0x94,0x94, + 0x9c,0x9c,0x9c,0x9c,0x94,0x94,0x94,0x94,0x9c,0x9c,0x9c,0x9c,0xa4,0xa4,0xa4,0xa4, + 0xac,0xac,0xac,0xac,0xb4,0xb4,0xb4,0xb4,0xbc,0xbc,0xbc,0xbc,0xb4,0xb4,0xb4,0xb4, + 0xbc,0xbc,0xbc,0xbc,0xb4,0xb4,0xb4,0xb4,0xbc,0xbc,0xbc,0xbc,0xc4,0xc4,0xc4,0xc4, + 0xcc,0xcc,0xcc,0xcc,0xd4,0xd4,0xd4,0xd4,0xdc,0xdc,0xdc,0xdc,0xd4,0xd4,0xd4,0xd4, + 0x9c,0x9c,0x9c,0x9c,0x94,0x94,0x94,0x94,0x9c,0x9c,0x9c,0x9c,0xa4,0xa4,0xa4,0xa4, + 0xac,0xac,0xac,0xac,0xb4,0xb4,0xb4,0xb4,0xbc,0xbc,0xbc,0xbc,0xb4,0xb4,0xb4,0xb4, +}; + +static const uint8_t a8r8g8b8_8_8_8[] = +{ + 0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x03,0x03,0x03,0x03, + 0x04,0x04,0x04,0x04,0x05,0x05,0x05,0x05,0x06,0x06,0x06,0x06,0x07,0x07,0x07,0x07, + 0x08,0x08,0x08,0x08,0x09,0x09,0x09,0x09,0x0a,0x0a,0x0a,0x0a,0x0b,0x0b,0x0b,0x0b, + 0x0c,0x0c,0x0c,0x0c,0x0d,0x0d,0x0d,0x0d,0x0e,0x0e,0x0e,0x0e,0x0f,0x0f,0x0f,0x0f, + 0x10,0x10,0x10,0x10,0x11,0x11,0x11,0x11,0x12,0x12,0x12,0x12,0x13,0x13,0x13,0x13, + 0x14,0x14,0x14,0x14,0x15,0x15,0x15,0x15,0x16,0x16,0x16,0x16,0x17,0x17,0x17,0x17, + 0x18,0x18,0x18,0x18,0x19,0x19,0x19,0x19,0x1a,0x1a,0x1a,0x1a,0x1b,0x1b,0x1b,0x1b, + 0x1c,0x1c,0x1c,0x1c,0x1d,0x1d,0x1d,0x1d,0x1e,0x1e,0x1e,0x1e,0x1f,0x1f,0x1f,0x1f, + 0x20,0x20,0x20,0x20,0x21,0x21,0x21,0x21,0x22,0x22,0x22,0x22,0x23,0x23,0x23,0x23, + 0x24,0x24,0x24,0x24,0x25,0x25,0x25,0x25,0x26,0x26,0x26,0x26,0x27,0x27,0x27,0x27, + 0x28,0x28,0x28,0x28,0x29,0x29,0x29,0x29,0x2a,0x2a,0x2a,0x2a,0x2b,0x2b,0x2b,0x2b, + 0x2c,0x2c,0x2c,0x2c,0x2d,0x2d,0x2d,0x2d,0x2e,0x2e,0x2e,0x2e,0x2f,0x2f,0x2f,0x2f, + 0x30,0x30,0x30,0x30,0x31,0x31,0x31,0x31,0x32,0x32,0x32,0x32,0x33,0x33,0x33,0x33, + 0x34,0x34,0x34,0x34,0x35,0x35,0x35,0x35,0x36,0x36,0x36,0x36,0x37,0x37,0x37,0x37, + 0x38,0x38,0x38,0x38,0x39,0x39,0x39,0x39,0x3a,0x3a,0x3a,0x3a,0x3b,0x3b,0x3b,0x3b, + 0x3c,0x3c,0x3c,0x3c,0x3d,0x3d,0x3d,0x3d,0x3e,0x3e,0x3e,0x3e,0x3f,0x3f,0x3f,0x3f, + 0x40,0x40,0x40,0x40,0x41,0x41,0x41,0x41,0x42,0x42,0x42,0x42,0x43,0x43,0x43,0x43, + 0x44,0x44,0x44,0x44,0x45,0x45,0x45,0x45,0x46,0x46,0x46,0x46,0x47,0x47,0x47,0x47, + 0x48,0x48,0x48,0x48,0x49,0x49,0x49,0x49,0x4a,0x4a,0x4a,0x4a,0x4b,0x4b,0x4b,0x4b, + 0x4c,0x4c,0x4c,0x4c,0x4d,0x4d,0x4d,0x4d,0x4e,0x4e,0x4e,0x4e,0x4f,0x4f,0x4f,0x4f, + 0x50,0x50,0x50,0x50,0x51,0x51,0x51,0x51,0x52,0x52,0x52,0x52,0x53,0x53,0x53,0x53, + 0x54,0x54,0x54,0x54,0x55,0x55,0x55,0x55,0x56,0x56,0x56,0x56,0x57,0x57,0x57,0x57, + 0x58,0x58,0x58,0x58,0x59,0x59,0x59,0x59,0x5a,0x5a,0x5a,0x5a,0x5b,0x5b,0x5b,0x5b, + 0x5c,0x5c,0x5c,0x5c,0x5d,0x5d,0x5d,0x5d,0x5e,0x5e,0x5e,0x5e,0x5f,0x5f,0x5f,0x5f, + 0x60,0x60,0x60,0x60,0x61,0x61,0x61,0x61,0x62,0x62,0x62,0x62,0x63,0x63,0x63,0x63, + 0x64,0x64,0x64,0x64,0x65,0x65,0x65,0x65,0x66,0x66,0x66,0x66,0x67,0x67,0x67,0x67, + 0x68,0x68,0x68,0x68,0x69,0x69,0x69,0x69,0x6a,0x6a,0x6a,0x6a,0x6b,0x6b,0x6b,0x6b, + 0x6c,0x6c,0x6c,0x6c,0x6d,0x6d,0x6d,0x6d,0x6e,0x6e,0x6e,0x6e,0x6f,0x6f,0x6f,0x6f, + 0x70,0x70,0x70,0x70,0x71,0x71,0x71,0x71,0x72,0x72,0x72,0x72,0x73,0x73,0x73,0x73, + 0x74,0x74,0x74,0x74,0x75,0x75,0x75,0x75,0x76,0x76,0x76,0x76,0x77,0x77,0x77,0x77, + 0x78,0x78,0x78,0x78,0x79,0x79,0x79,0x79,0x7a,0x7a,0x7a,0x7a,0x7b,0x7b,0x7b,0x7b, + 0x7c,0x7c,0x7c,0x7c,0x7d,0x7d,0x7d,0x7d,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f, + 0x80,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x82,0x82,0x82,0x82,0x83,0x83,0x83,0x83, + 0x84,0x84,0x84,0x84,0x85,0x85,0x85,0x85,0x86,0x86,0x86,0x86,0x87,0x87,0x87,0x87, + 0x88,0x88,0x88,0x88,0x89,0x89,0x89,0x89,0x8a,0x8a,0x8a,0x8a,0x8b,0x8b,0x8b,0x8b, + 0x8c,0x8c,0x8c,0x8c,0x8d,0x8d,0x8d,0x8d,0x8e,0x8e,0x8e,0x8e,0x8f,0x8f,0x8f,0x8f, + 0x90,0x90,0x90,0x90,0x91,0x91,0x91,0x91,0x92,0x92,0x92,0x92,0x93,0x93,0x93,0x93, + 0x94,0x94,0x94,0x94,0x95,0x95,0x95,0x95,0x96,0x96,0x96,0x96,0x97,0x97,0x97,0x97, + 0x98,0x98,0x98,0x98,0x99,0x99,0x99,0x99,0x9a,0x9a,0x9a,0x9a,0x9b,0x9b,0x9b,0x9b, + 0x9c,0x9c,0x9c,0x9c,0x9d,0x9d,0x9d,0x9d,0x9e,0x9e,0x9e,0x9e,0x9f,0x9f,0x9f,0x9f, + 0xa0,0xa0,0xa0,0xa0,0xa1,0xa1,0xa1,0xa1,0xa2,0xa2,0xa2,0xa2,0xa3,0xa3,0xa3,0xa3, + 0xa4,0xa4,0xa4,0xa4,0xa5,0xa5,0xa5,0xa5,0xa6,0xa6,0xa6,0xa6,0xa7,0xa7,0xa7,0xa7, + 0xa8,0xa8,0xa8,0xa8,0xa9,0xa9,0xa9,0xa9,0xaa,0xaa,0xaa,0xaa,0xab,0xab,0xab,0xab, + 0xac,0xac,0xac,0xac,0xad,0xad,0xad,0xad,0xae,0xae,0xae,0xae,0xaf,0xaf,0xaf,0xaf, + 0xb0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,0xe3,0xe3,0xe3, + 0xe4,0xe4,0xe4,0xe4,0xe5,0xe5,0xe5,0xe5,0xe6,0xe6,0xe6,0xe6,0xe7,0xe7,0xe7,0xe7, + 0xe8,0xe8,0xe8,0xe8,0xe9,0xe9,0xe9,0xe9,0xea,0xea,0xea,0xea,0xeb,0xeb,0xeb,0xeb, + 0xec,0xec,0xec,0xec,0xed,0xed,0xed,0xed,0xee,0xee,0xee,0xee,0xef,0xef,0xef,0xef, + 0xf0,0xf0,0xf0,0xf0,0xf1,0xf1,0xf1,0xf1,0xf2,0xf2,0xf2,0xf2,0xf3,0xf3,0xf3,0xf3, + 0xf4,0xf4,0xf4,0xf4,0xf5,0xf5,0xf5,0xf5,0xf6,0xf6,0xf6,0xf6,0xf7,0xf7,0xf7,0xf7, + 0xf8,0xf8,0xf8,0xf8,0xf9,0xf9,0xf9,0xf9,0xfa,0xfa,0xfa,0xfa,0xfb,0xfb,0xfb,0xfb, + 0xfc,0xfc,0xfc,0xfc,0xfd,0xfd,0xfd,0xfd,0xfe,0xfe,0xfe,0xfe,0xff,0xff,0xff,0xff, + 0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x03,0x03,0x03,0x03, + 0x04,0x04,0x04,0x04,0x05,0x05,0x05,0x05,0x06,0x06,0x06,0x06,0x07,0x07,0x07,0x07, + 0x08,0x08,0x08,0x08,0x09,0x09,0x09,0x09,0x0a,0x0a,0x0a,0x0a,0x0b,0x0b,0x0b,0x0b, + 0x0c,0x0c,0x0c,0x0c,0x0d,0x0d,0x0d,0x0d,0x0e,0x0e,0x0e,0x0e,0x0f,0x0f,0x0f,0x0f, + 0x10,0x10,0x10,0x10,0x11,0x11,0x11,0x11,0x12,0x12,0x12,0x12,0x13,0x13,0x13,0x13, + 0x14,0x14,0x14,0x14,0x15,0x15,0x15,0x15,0x16,0x16,0x16,0x16,0x17,0x17,0x17,0x17, + 0x18,0x18,0x18,0x18,0x19,0x19,0x19,0x19,0x1a,0x1a,0x1a,0x1a,0x1b,0x1b,0x1b,0x1b, + 0x1c,0x1c,0x1c,0x1c,0x1d,0x1d,0x1d,0x1d,0x1e,0x1e,0x1e,0x1e,0x1f,0x1f,0x1f,0x1f, + 0x20,0x20,0x20,0x20,0x21,0x21,0x21,0x21,0x22,0x22,0x22,0x22,0x23,0x23,0x23,0x23, + 0x24,0x24,0x24,0x24,0x25,0x25,0x25,0x25,0x26,0x26,0x26,0x26,0x27,0x27,0x27,0x27, + 0x28,0x28,0x28,0x28,0x29,0x29,0x29,0x29,0x2a,0x2a,0x2a,0x2a,0x2b,0x2b,0x2b,0x2b, + 0x2c,0x2c,0x2c,0x2c,0x2d,0x2d,0x2d,0x2d,0x2e,0x2e,0x2e,0x2e,0x2f,0x2f,0x2f,0x2f, + 0x30,0x30,0x30,0x30,0x31,0x31,0x31,0x31,0x32,0x32,0x32,0x32,0x33,0x33,0x33,0x33, + 0x34,0x34,0x34,0x34,0x35,0x35,0x35,0x35,0x36,0x36,0x36,0x36,0x37,0x37,0x37,0x37, + 0x38,0x38,0x38,0x38,0x39,0x39,0x39,0x39,0x3a,0x3a,0x3a,0x3a,0x3b,0x3b,0x3b,0x3b, + 0x3c,0x3c,0x3c,0x3c,0x3d,0x3d,0x3d,0x3d,0x3e,0x3e,0x3e,0x3e,0x3f,0x3f,0x3f,0x3f, + 0x40,0x40,0x40,0x40,0x41,0x41,0x41,0x41,0x42,0x42,0x42,0x42,0x43,0x43,0x43,0x43, + 0x44,0x44,0x44,0x44,0x45,0x45,0x45,0x45,0x46,0x46,0x46,0x46,0x47,0x47,0x47,0x47, + 0x48,0x48,0x48,0x48,0x49,0x49,0x49,0x49,0x4a,0x4a,0x4a,0x4a,0x4b,0x4b,0x4b,0x4b, + 0x4c,0x4c,0x4c,0x4c,0x4d,0x4d,0x4d,0x4d,0x4e,0x4e,0x4e,0x4e,0x4f,0x4f,0x4f,0x4f, + 0x50,0x50,0x50,0x50,0x51,0x51,0x51,0x51,0x52,0x52,0x52,0x52,0x53,0x53,0x53,0x53, + 0x54,0x54,0x54,0x54,0x55,0x55,0x55,0x55,0x56,0x56,0x56,0x56,0x57,0x57,0x57,0x57, + 0x58,0x58,0x58,0x58,0x59,0x59,0x59,0x59,0x5a,0x5a,0x5a,0x5a,0x5b,0x5b,0x5b,0x5b, + 0x5c,0x5c,0x5c,0x5c,0x5d,0x5d,0x5d,0x5d,0x5e,0x5e,0x5e,0x5e,0x5f,0x5f,0x5f,0x5f, + 0x60,0x60,0x60,0x60,0x61,0x61,0x61,0x61,0x62,0x62,0x62,0x62,0x63,0x63,0x63,0x63, + 0x64,0x64,0x64,0x64,0x65,0x65,0x65,0x65,0x66,0x66,0x66,0x66,0x67,0x67,0x67,0x67, + 0x68,0x68,0x68,0x68,0x69,0x69,0x69,0x69,0x6a,0x6a,0x6a,0x6a,0x6b,0x6b,0x6b,0x6b, + 0x6c,0x6c,0x6c,0x6c,0x6d,0x6d,0x6d,0x6d,0x6e,0x6e,0x6e,0x6e,0x6f,0x6f,0x6f,0x6f, + 0x70,0x70,0x70,0x70,0x71,0x71,0x71,0x71,0x72,0x72,0x72,0x72,0x73,0x73,0x73,0x73, + 0x74,0x74,0x74,0x74,0x75,0x75,0x75,0x75,0x76,0x76,0x76,0x76,0x77,0x77,0x77,0x77, + 0x78,0x78,0x78,0x78,0x79,0x79,0x79,0x79,0x7a,0x7a,0x7a,0x7a,0x7b,0x7b,0x7b,0x7b, + 0x7c,0x7c,0x7c,0x7c,0x7d,0x7d,0x7d,0x7d,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f, + 0x80,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x82,0x82,0x82,0x82,0x83,0x83,0x83,0x83, + 0x84,0x84,0x84,0x84,0x85,0x85,0x85,0x85,0x86,0x86,0x86,0x86,0x87,0x87,0x87,0x87, + 0x88,0x88,0x88,0x88,0x89,0x89,0x89,0x89,0x8a,0x8a,0x8a,0x8a,0x8b,0x8b,0x8b,0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xf4,0xf4,0xf4,0xf5,0xf5,0xf5,0xf5,0xf6,0xf6,0xf6,0xf6,0xf7,0xf7,0xf7,0xf7, + 0xf8,0xf8,0xf8,0xf8,0xf9,0xf9,0xf9,0xf9,0xfa,0xfa,0xfa,0xfa,0xfb,0xfb,0xfb,0xfb, + 0xfc,0xfc,0xfc,0xfc,0xfd,0xfd,0xfd,0xfd,0xfe,0xfe,0xfe,0xfe,0xff,0xff,0xff,0xff, +}; + +static const uint8_t a8r8g8b8_8_8_8_point_filter_4_4_4[] = +{ + 0x00,0x00,0x00,0x00,0x02,0x02,0x02,0x02,0x04,0x04,0x04,0x04,0x06,0x06,0x06,0x06, + 0x10,0x10,0x10,0x10,0x12,0x12,0x12,0x12,0x14,0x14,0x14,0x14,0x16,0x16,0x16,0x16, + 0x20,0x20,0x20,0x20,0x22,0x22,0x22,0x22,0x24,0x24,0x24,0x24,0x26,0x26,0x26,0x26, + 0x30,0x30,0x30,0x30,0x32,0x32,0x32,0x32,0x34,0x34,0x34,0x34,0x36,0x36,0x36,0x36, + 0x80,0x80,0x80,0x80,0x82,0x82,0x82,0x82,0x84,0x84,0x84,0x84,0x86,0x86,0x86,0x86, + 0x90,0x90,0x90,0x90,0x92,0x92,0x92,0x92,0x94,0x94,0x94,0x94,0x96,0x96,0x96,0x96, + 0xa0,0xa0,0xa0,0xa0,0xa2,0xa2,0xa2,0xa2,0xa4,0xa4,0xa4,0xa4,0xa6,0xa6,0xa6,0xa6, + 0xb0,0xb0,0xb0,0xb0,0xb2,0xb2,0xb2,0xb2,0xb4,0xb4,0xb4,0xb4,0xb6,0xb6,0xb6,0xb6, + 0x00,0x00,0x00,0x00,0x02,0x02,0x02,0x02,0x04,0x04,0x04,0x04,0x06,0x06,0x06,0x06, + 0x10,0x10,0x10,0x10,0x12,0x12,0x12,0x12,0x14,0x14,0x14,0x14,0x16,0x16,0x16,0x16, + 0x20,0x20,0x20,0x20,0x22,0x22,0x22,0x22,0x24,0x24,0x24,0x24,0x26,0x26,0x26,0x26, + 0x30,0x30,0x30,0x30,0x32,0x32,0x32,0x32,0x34,0x34,0x34,0x34,0x36,0x36,0x36,0x36, + 0x80,0x80,0x80,0x80,0x82,0x82,0x82,0x82,0x84,0x84,0x84,0x84,0x86,0x86,0x86,0x86, + 0x90,0x90,0x90,0x90,0x92,0x92,0x92,0x92,0x94,0x94,0x94,0x94,0x96,0x96,0x96,0x96, + 0xa0,0xa0,0xa0,0xa0,0xa2,0xa2,0xa2,0xa2,0xa4,0xa4,0xa4,0xa4,0xa6,0xa6,0xa6,0xa6, + 0xb0,0xb0,0xb0,0xb0,0xb2,0xb2,0xb2,0xb2,0xb4,0xb4,0xb4,0xb4,0xb6,0xb6,0xb6,0xb6, +}; + +static const uint8_t a8r8g8b8_8_8_8_linear_filter_4_4_4[] = +{ + 0x25,0x25,0x25,0x25,0x27,0x27,0x27,0x27,0x29,0x29,0x29,0x29,0x2b,0x2b,0x2b,0x2b, + 0x35,0x35,0x35,0x35,0x37,0x37,0x37,0x37,0x39,0x39,0x39,0x39,0x3b,0x3b,0x3b,0x3b, + 0x45,0x45,0x45,0x45,0x47,0x47,0x47,0x47,0x49,0x49,0x49,0x49,0x4b,0x4b,0x4b,0x4b, + 0x55,0x55,0x55,0x55,0x57,0x57,0x57,0x57,0x59,0x59,0x59,0x59,0x5b,0x5b,0x5b,0x5b, + 0xa5,0xa5,0xa5,0xa5,0xa7,0xa7,0xa7,0xa7,0xa9,0xa9,0xa9,0xa9,0xab,0xab,0xab,0xab, + 0xb5,0xb5,0xb5,0xb5,0xb7,0xb7,0xb7,0xb7,0xb9,0xb9,0xb9,0xb9,0xbb,0xbb,0xbb,0xbb, + 0xc5,0xc5,0xc5,0xc5,0xc7,0xc7,0xc7,0xc7,0xc9,0xc9,0xc9,0xc9,0xcb,0xcb,0xcb,0xcb, + 0xd5,0xd5,0xd5,0xd5,0xd7,0xd7,0xd7,0xd7,0xd9,0xd9,0xd9,0xd9,0xdb,0xdb,0xdb,0xdb, + 0x25,0x25,0x25,0x25,0x27,0x27,0x27,0x27,0x29,0x29,0x29,0x29,0x2b,0x2b,0x2b,0x2b, + 0x35,0x35,0x35,0x35,0x37,0x37,0x37,0x37,0x39,0x39,0x39,0x39,0x3b,0x3b,0x3b,0x3b, + 0x45,0x45,0x45,0x45,0x47,0x47,0x47,0x47,0x49,0x49,0x49,0x49,0x4b,0x4b,0x4b,0x4b, + 0x55,0x55,0x55,0x55,0x57,0x57,0x57,0x57,0x59,0x59,0x59,0x59,0x5b,0x5b,0x5b,0x5b, + 0xa5,0xa5,0xa5,0xa5,0xa7,0xa7,0xa7,0xa7,0xa9,0xa9,0xa9,0xa9,0xab,0xab,0xab,0xab, + 0xb5,0xb5,0xb5,0xb5,0xb7,0xb7,0xb7,0xb7,0xb9,0xb9,0xb9,0xb9,0xbb,0xbb,0xbb,0xbb, + 0xc5,0xc5,0xc5,0xc5,0xc7,0xc7,0xc7,0xc7,0xc9,0xc9,0xc9,0xc9,0xcb,0xcb,0xcb,0xcb, + 0xd5,0xd5,0xd5,0xd5,0xd7,0xd7,0xd7,0xd7,0xd9,0xd9,0xd9,0xd9,0xdb,0xdb,0xdb,0xdb, +}; + +static const uint8_t a8r8g8b8_8_8_8_triangle_filter_4_4_4[] = +{ + 0x39,0x39,0x39,0x39,0x3b,0x3b,0x3b,0x3b,0x3d,0x3d,0x3d,0x3d,0x3e,0x3e,0x3e,0x3e, + 0x45,0x45,0x45,0x45,0x46,0x46,0x46,0x46,0x48,0x48,0x48,0x48,0x4a,0x4a,0x4a,0x4a, + 0x55,0x55,0x55,0x55,0x56,0x56,0x56,0x56,0x58,0x58,0x58,0x58,0x5a,0x5a,0x5a,0x5a, + 0x61,0x61,0x61,0x61,0x62,0x62,0x62,0x62,0x64,0x64,0x64,0x64,0x66,0x66,0x66,0x66, + 0x99,0x99,0x99,0x99,0x9b,0x9b,0x9b,0x9b,0x9d,0x9d,0x9d,0x9d,0x9e,0x9e,0x9e,0x9e, + 0xa5,0xa5,0xa5,0xa5,0xa6,0xa6,0xa6,0xa6,0xa9,0xa9,0xa9,0xa9,0xaa,0xaa,0xaa,0xaa, + 0xb5,0xb5,0xb5,0xb5,0xb7,0xb7,0xb7,0xb7,0xb9,0xb9,0xb9,0xb9,0xba,0xba,0xba,0xba, + 0xc1,0xc1,0xc1,0xc1,0xc3,0xc3,0xc3,0xc3,0xc5,0xc5,0xc5,0xc5,0xc6,0xc6,0xc6,0xc6, + 0x39,0x39,0x39,0x39,0x3b,0x3b,0x3b,0x3b,0x3d,0x3d,0x3d,0x3d,0x3e,0x3e,0x3e,0x3e, + 0x45,0x45,0x45,0x45,0x46,0x46,0x46,0x46,0x48,0x48,0x48,0x48,0x4a,0x4a,0x4a,0x4a, + 0x55,0x55,0x55,0x55,0x56,0x56,0x56,0x56,0x59,0x59,0x59,0x59,0x5a,0x5a,0x5a,0x5a, + 0x61,0x61,0x61,0x61,0x63,0x63,0x63,0x63,0x64,0x64,0x64,0x64,0x66,0x66,0x66,0x66, + 0x99,0x99,0x99,0x99,0x9b,0x9b,0x9b,0x9b,0x9d,0x9d,0x9d,0x9d,0x9e,0x9e,0x9e,0x9e, + 0xa5,0xa5,0xa5,0xa5,0xa7,0xa7,0xa7,0xa7,0xa9,0xa9,0xa9,0xa9,0xaa,0xaa,0xaa,0xaa, + 0xb5,0xb5,0xb5,0xb5,0xb7,0xb7,0xb7,0xb7,0xb9,0xb9,0xb9,0xb9,0xba,0xba,0xba,0xba, + 0xc1,0xc1,0xc1,0xc1,0xc3,0xc3,0xc3,0xc3,0xc4,0xc4,0xc4,0xc4,0xc6,0xc6,0xc6,0xc6, +}; + +static const uint8_t a8r8g8b8_8_8_8_triangle_filter_4_4_4_32bit[] = +{ + 0x39,0x39,0x39,0x39,0x3b,0x3b,0x3b,0x3b,0x3d,0x3d,0x3d,0x3d,0x3e,0x3e,0x3e,0x3e, + 0x45,0x45,0x45,0x45,0x46,0x46,0x46,0x46,0x48,0x48,0x48,0x48,0x4a,0x4a,0x4a,0x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xc4,0xc4,0xc4,0xc4,0xc6,0xc6,0xc6,0xc6, +}; + +static const uint8_t a8r8g8b8_8_8_8_box_filter_4_4_4_32bit[] = +{ + 0x25,0x25,0x25,0x25,0x27,0x27,0x27,0x27,0x29,0x29,0x29,0x29,0x2b,0x2b,0x2b,0x2b, + 0x35,0x35,0x35,0x35,0x37,0x37,0x37,0x37,0x39,0x39,0x39,0x39,0x3b,0x3b,0x3b,0x3b, + 0x45,0x45,0x45,0x45,0x47,0x47,0x47,0x47,0x49,0x49,0x49,0x49,0x4b,0x4b,0x4b,0x4b, + 0x55,0x55,0x55,0x55,0x57,0x57,0x57,0x57,0x59,0x59,0x59,0x59,0x5b,0x5b,0x5b,0x5b, + 0xa4,0xa4,0xa4,0xa4,0xa7,0xa7,0xa7,0xa7,0xa9,0xa9,0xa9,0xa9,0xab,0xab,0xab,0xab, + 0xb4,0xb4,0xb4,0xb4,0xb7,0xb7,0xb7,0xb7,0xb9,0xb9,0xb9,0xb9,0xbb,0xbb,0xbb,0xbb, + 0xc5,0xc5,0xc5,0xc5,0xc7,0xc7,0xc7,0xc7,0xc9,0xc9,0xc9,0xc9,0xcb,0xcb,0xcb,0xcb, + 0xd5,0xd5,0xd5,0xd5,0xd7,0xd7,0xd7,0xd7,0xd9,0xd9,0xd9,0xd9,0xdb,0xdb,0xdb,0xdb, + 0x25,0x25,0x25,0x25,0x27,0x27,0x27,0x27,0x29,0x29,0x29,0x29,0x2b,0x2b,0x2b,0x2b, + 0x35,0x35,0x35,0x35,0x37,0x37,0x37,0x37,0x39,0x39,0x39,0x39,0x3b,0x3b,0x3b,0x3b, + 0x45,0x45,0x45,0x45,0x47,0x47,0x47,0x47,0x49,0x49,0x49,0x49,0x4b,0x4b,0x4b,0x4b, + 0x55,0x55,0x55,0x55,0x57,0x57,0x57,0x57,0x59,0x59,0x59,0x59,0x5b,0x5b,0x5b,0x5b, + 0xa4,0xa4,0xa4,0xa4,0xa7,0xa7,0xa7,0xa7,0xa9,0xa9,0xa9,0xa9,0xab,0xab,0xab,0xab, + 0xb4,0xb4,0xb4,0xb4,0xb7,0xb7,0xb7,0xb7,0xb9,0xb9,0xb9,0xb9,0xbb,0xbb,0xbb,0xbb, + 0xc5,0xc5,0xc5,0xc5,0xc7,0xc7,0xc7,0xc7,0xc9,0xc9,0xc9,0xc9,0xcb,0xcb,0xcb,0xcb, + 0xd5,0xd5,0xd5,0xd5,0xd7,0xd7,0xd7,0xd7,0xd9,0xd9,0xd9,0xd9,0xdb,0xdb,0xdb,0xdb, +}; + +static const uint8_t a8r8g8b8_6_6_6[] = +{ + 0x00,0x00,0x00,0x00,0x0c,0x0c,0x0c,0x0c,0x18,0x18,0x18,0x18,0x24,0x24,0x24,0x24, + 0x30,0x30,0x30,0x30,0x3c,0x3c,0x3c,0x3c,0x28,0x28,0x28,0x28,0x34,0x34,0x34,0x34, + 0x40,0x40,0x40,0x40,0x4c,0x4c,0x4c,0x4c,0x58,0x58,0x58,0x58,0x64,0x64,0x64,0x64, + 0x50,0x50,0x50,0x50,0x5c,0x5c,0x5c,0x5c,0x68,0x68,0x68,0x68,0x74,0x74,0x74,0x74, + 0x80,0x80,0x80,0x80,0x8c,0x8c,0x8c,0x8c,0x78,0x78,0x78,0x78,0x84,0x84,0x84,0x84, + 0x90,0x90,0x90,0x90,0x9c,0x9c,0x9c,0x9c,0xa8,0xa8,0xa8,0xa8,0xb4,0xb4,0xb4,0xb4, + 0xa0,0xa0,0xa0,0xa0,0xac,0xac,0xac,0xac,0xb8,0xb8,0xb8,0xb8,0xc4,0xc4,0xc4,0xc4, + 0xd0,0xd0,0xd0,0xd0,0xdc,0xdc,0xdc,0xdc,0xc8,0xc8,0xc8,0xc8,0xd4,0xd4,0xd4,0xd4, + 0xe0,0xe0,0xe0,0xe0,0xec,0xec,0xec,0xec,0xf8,0xf8,0xf8,0xf8,0xff,0xff,0xff,0xff, + 0x00,0x00,0x00,0x00,0x0c,0x0c,0x0c,0x0c,0x18,0x18,0x18,0x18,0x24,0x24,0x24,0x24, + 0x30,0x30,0x30,0x30,0x3c,0x3c,0x3c,0x3c,0x28,0x28,0x28,0x28,0x34,0x34,0x34,0x34, + 0x40,0x40,0x40,0x40,0x4c,0x4c,0x4c,0x4c,0x58,0x58,0x58,0x58,0x64,0x64,0x64,0x64, + 0x50,0x50,0x50,0x50,0x5c,0x5c,0x5c,0x5c,0x68,0x68,0x68,0x68,0x74,0x74,0x74,0x74, + 0x80,0x80,0x80,0x80,0x8c,0x8c,0x8c,0x8c,0x78,0x78,0x78,0x78,0x84,0x84,0x84,0x84, + 0x90,0x90,0x90,0x90,0x9c,0x9c,0x9c,0x9c,0xa8,0xa8,0xa8,0xa8,0xb4,0xb4,0xb4,0xb4, + 0xa0,0xa0,0xa0,0xa0,0xac,0xac,0xac,0xac,0xb8,0xb8,0xb8,0xb8,0xc4,0xc4,0xc4,0xc4, + 0xd0,0xd0,0xd0,0xd0,0xdc,0xdc,0xdc,0xdc,0xc8,0xc8,0xc8,0xc8,0xd4,0xd4,0xd4,0xd4, + 0xe0,0xe0,0xe0,0xe0,0xec,0xec,0xec,0xec,0xf8,0xf8,0xf8,0xf8,0xff,0xff,0xff,0xff, + 0x00,0x00,0x00,0x00,0x0c,0x0c,0x0c,0x0c,0x18,0x18,0x18,0x18,0x24,0x24,0x24,0x24, + 0x30,0x30,0x30,0x30,0x3c,0x3c,0x3c,0x3c,0x28,0x28,0x28,0x28,0x34,0x34,0x34,0x34, + 0x40,0x40,0x40,0x40,0x4c,0x4c,0x4c,0x4c,0x58,0x58,0x58,0x58,0x64,0x64,0x64,0x64, + 0x50,0x50,0x50,0x50,0x5c,0x5c,0x5c,0x5c,0x68,0x68,0x68,0x68,0x74,0x74,0x74,0x74, + 0x80,0x80,0x80,0x80,0x8c,0x8c,0x8c,0x8c,0x78,0x78,0x78,0x78,0x84,0x84,0x84,0x84, + 0x90,0x90,0x90,0x90,0x9c,0x9c,0x9c,0x9c,0xa8,0xa8,0xa8,0xa8,0xb4,0xb4,0xb4,0xb4, + 0xa0,0xa0,0xa0,0xa0,0xac,0xac,0xac,0xac,0xb8,0xb8,0xb8,0xb8,0xc4,0xc4,0xc4,0xc4, + 0xd0,0xd0,0xd0,0xd0,0xdc,0xdc,0xdc,0xdc,0xc8,0xc8,0xc8,0xc8,0xd4,0xd4,0xd4,0xd4, + 0xe0,0xe0,0xe0,0xe0,0xec,0xec,0xec,0xec,0xf8,0xf8,0xf8,0xf8,0xff,0xff,0xff,0xff, + 0x00,0x00,0x00,0x00,0x0c,0x0c,0x0c,0x0c,0x18,0x18,0x18,0x18,0x24,0x24,0x24,0x24, + 0x30,0x30,0x30,0x30,0x3c,0x3c,0x3c,0x3c,0x28,0x28,0x28,0x28,0x34,0x34,0x34,0x34, + 0x40,0x40,0x40,0x40,0x4c,0x4c,0x4c,0x4c,0x58,0x58,0x58,0x58,0x64,0x64,0x64,0x64, + 0x50,0x50,0x50,0x50,0x5c,0x5c,0x5c,0x5c,0x68,0x68,0x68,0x68,0x74,0x74,0x74,0x74, + 0x80,0x80,0x80,0x80,0x8c,0x8c,0x8c,0x8c,0x78,0x78,0x78,0x78,0x84,0x84,0x84,0x84, + 0x90,0x90,0x90,0x90,0x9c,0x9c,0x9c,0x9c,0xa8,0xa8,0xa8,0xa8,0xb4,0xb4,0xb4,0xb4, + 0xa0,0xa0,0xa0,0xa0,0xac,0xac,0xac,0xac,0xb8,0xb8,0xb8,0xb8,0xc4,0xc4,0xc4,0xc4, + 0xd0,0xd0,0xd0,0xd0,0xdc,0xdc,0xdc,0xdc,0xc8,0xc8,0xc8,0xc8,0xd4,0xd4,0xd4,0xd4, + 0xe0,0xe0,0xe0,0xe0,0xec,0xec,0xec,0xec,0xf8,0xf8,0xf8,0xf8,0xff,0xff,0xff,0xff, + 0x00,0x00,0x00,0x00,0x0c,0x0c,0x0c,0x0c,0x18,0x18,0x18,0x18,0x24,0x24,0x24,0x24, + 0x30,0x30,0x30,0x30,0x3c,0x3c,0x3c,0x3c,0x28,0x28,0x28,0x28,0x34,0x34,0x34,0x34, + 0x40,0x40,0x40,0x40,0x4c,0x4c,0x4c,0x4c,0x58,0x58,0x58,0x58,0x64,0x64,0x64,0x64, + 0x50,0x50,0x50,0x50,0x5c,0x5c,0x5c,0x5c,0x68,0x68,0x68,0x68,0x74,0x74,0x74,0x74, + 0x80,0x80,0x80,0x80,0x8c,0x8c,0x8c,0x8c,0x78,0x78,0x78,0x78,0x84,0x84,0x84,0x84, + 0x90,0x90,0x90,0x90,0x9c,0x9c,0x9c,0x9c,0xa8,0xa8,0xa8,0xa8,0xb4,0xb4,0xb4,0xb4, + 0xa0,0xa0,0xa0,0xa0,0xac,0xac,0xac,0xac,0xb8,0xb8,0xb8,0xb8,0xc4,0xc4,0xc4,0xc4, + 0xd0,0xd0,0xd0,0xd0,0xdc,0xdc,0xdc,0xdc,0xc8,0xc8,0xc8,0xc8,0xd4,0xd4,0xd4,0xd4, + 0xe0,0xe0,0xe0,0xe0,0xec,0xec,0xec,0xec,0xf8,0xf8,0xf8,0xf8,0xff,0xff,0xff,0xff, + 0x00,0x00,0x00,0x00,0x0c,0x0c,0x0c,0x0c,0x18,0x18,0x18,0x18,0x24,0x24,0x24,0x24, + 0x30,0x30,0x30,0x30,0x3c,0x3c,0x3c,0x3c,0x28,0x28,0x28,0x28,0x34,0x34,0x34,0x34, + 0x40,0x40,0x40,0x40,0x4c,0x4c,0x4c,0x4c,0x58,0x58,0x58,0x58,0x64,0x64,0x64,0x64, + 0x50,0x50,0x50,0x50,0x5c,0x5c,0x5c,0x5c,0x68,0x68,0x68,0x68,0x74,0x74,0x74,0x74, + 0x80,0x80,0x80,0x80,0x8c,0x8c,0x8c,0x8c,0x78,0x78,0x78,0x78,0x84,0x84,0x84,0x84, + 0x90,0x90,0x90,0x90,0x9c,0x9c,0x9c,0x9c,0xa8,0xa8,0xa8,0xa8,0xb4,0xb4,0xb4,0xb4, + 0xa0,0xa0,0xa0,0xa0,0xac,0xac,0xac,0xac,0xb8,0xb8,0xb8,0xb8,0xc4,0xc4,0xc4,0xc4, + 0xd0,0xd0,0xd0,0xd0,0xdc,0xdc,0xdc,0xdc,0xc8,0xc8,0xc8,0xc8,0xd4,0xd4,0xd4,0xd4, + 0xe0,0xe0,0xe0,0xe0,0xec,0xec,0xec,0xec,0xf8,0xf8,0xf8,0xf8,0xff,0xff,0xff,0xff, +}; + +static const uint8_t a8r8g8b8_6_6_6_point_filter_3_3_3[] = +{ + 0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x30,0x30,0x30,0x30,0x50,0x50,0x50,0x50, + 0x68,0x68,0x68,0x68,0x80,0x80,0x80,0x80,0xa0,0xa0,0xa0,0xa0,0xb8,0xb8,0xb8,0xb8, + 0xd0,0xd0,0xd0,0xd0,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x30,0x30,0x30,0x30, + 0x50,0x50,0x50,0x50,0x68,0x68,0x68,0x68,0x80,0x80,0x80,0x80,0xa0,0xa0,0xa0,0xa0, + 0xb8,0xb8,0xb8,0xb8,0xd0,0xd0,0xd0,0xd0,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18, + 0x30,0x30,0x30,0x30,0x50,0x50,0x50,0x50,0x68,0x68,0x68,0x68,0x80,0x80,0x80,0x80, + 0xa0,0xa0,0xa0,0xa0,0xb8,0xb8,0xb8,0xb8,0xd0,0xd0,0xd0,0xd0, +}; + +static const uint8_t a8r8g8b8_6_6_6_linear_filter_3_3_3[] = +{ + 0x1a,0x1a,0x1a,0x1a,0x32,0x32,0x32,0x32,0x4a,0x4a,0x4a,0x4a,0x6a,0x6a,0x6a,0x6a, + 0x82,0x82,0x82,0x82,0x9a,0x9a,0x9a,0x9a,0xba,0xba,0xba,0xba,0xd2,0xd2,0xd2,0xd2, + 0xe9,0xe9,0xe9,0xe9,0x1a,0x1a,0x1a,0x1a,0x32,0x32,0x32,0x32,0x4a,0x4a,0x4a,0x4a, + 0x6a,0x6a,0x6a,0x6a,0x82,0x82,0x82,0x82,0x9a,0x9a,0x9a,0x9a,0xba,0xba,0xba,0xba, + 0xd2,0xd2,0xd2,0xd2,0xe9,0xe9,0xe9,0xe9,0x1a,0x1a,0x1a,0x1a,0x32,0x32,0x32,0x32, + 0x4a,0x4a,0x4a,0x4a,0x6a,0x6a,0x6a,0x6a,0x82,0x82,0x82,0x82,0x9a,0x9a,0x9a,0x9a, + 0xba,0xba,0xba,0xba,0xd2,0xd2,0xd2,0xd2,0xe9,0xe9,0xe9,0xe9, +}; + +static const uint8_t a8r8g8b8_6_6_6_triangle_filter_3_3_3[] = +{ + 0x2d,0x2d,0x2d,0x2d,0x41,0x41,0x41,0x41,0x54,0x54,0x54,0x54,0x6f,0x6f,0x6f,0x6f, + 0x82,0x82,0x82,0x82,0x96,0x96,0x96,0x96,0xaf,0xaf,0xaf,0xaf,0xc3,0xc3,0xc3,0xc3, + 0xd6,0xd6,0xd6,0xd6,0x2d,0x2d,0x2d,0x2d,0x41,0x41,0x41,0x41,0x54,0x54,0x54,0x54, + 0x6f,0x6f,0x6f,0x6f,0x82,0x82,0x82,0x82,0x96,0x96,0x96,0x96,0xaf,0xaf,0xaf,0xaf, + 0xc3,0xc3,0xc3,0xc3,0xd6,0xd6,0xd6,0xd6,0x2d,0x2d,0x2d,0x2d,0x41,0x41,0x41,0x41, + 0x54,0x54,0x54,0x54,0x6f,0x6f,0x6f,0x6f,0x82,0x82,0x82,0x82,0x96,0x96,0x96,0x96, + 0xaf,0xaf,0xaf,0xaf,0xc3,0xc3,0xc3,0xc3,0xd6,0xd6,0xd6,0xd6, +}; + +static const uint8_t a8r8g8b8_6_6_6_triangle_dither_filter_3_3_3[] = +{ + 0x2e,0x2e,0x2e,0x2e,0x41,0x41,0x41,0x41,0x55,0x55,0x55,0x55,0x6e,0x6e,0x6e,0x6e, + 0x82,0x82,0x82,0x82,0x95,0x95,0x95,0x95,0xb0,0xb0,0xb0,0xb0,0xc3,0xc3,0xc3,0xc3, + 0xd6,0xd6,0xd6,0xd6,0x2d,0x2d,0x2d,0x2d,0x41,0x41,0x41,0x41,0x54,0x54,0x54,0x54, + 0x6f,0x6f,0x6f,0x6f,0x82,0x82,0x82,0x82,0x96,0x96,0x96,0x96,0xaf,0xaf,0xaf,0xaf, + 0xc3,0xc3,0xc3,0xc3,0xd5,0xd5,0xd5,0xd5,0x2e,0x2e,0x2e,0x2e,0x41,0x41,0x41,0x41, + 0x55,0x55,0x55,0x55,0x6e,0x6e,0x6e,0x6e,0x82,0x82,0x82,0x82,0x95,0x95,0x95,0x95, + 0xb0,0xb0,0xb0,0xb0,0xc3,0xc3,0xc3,0xc3,0xd6,0xd6,0xd6,0xd6, +}; + static inline const char *debug_d3dformat(D3DFORMAT format_id) { switch (format_id) @@ -944,6 +1710,50 @@ static inline const char *debug_d3dformat(D3DFORMAT format_id) } }
+static inline uint32_t get_bpp_for_d3dformat(D3DFORMAT format) +{ + switch (format) + { + case D3DFMT_A32B32G32R32F: + return 16; + + case D3DFMT_A16B16G16R16: + case D3DFMT_Q16W16V16U16: + return 8; + + case D3DFMT_Q8W8V8U8: + case D3DFMT_A8B8G8R8: + case D3DFMT_A8R8G8B8: + case D3DFMT_V16U16: + case D3DFMT_G16R16: + case D3DFMT_R32F: + return 4; + + case D3DFMT_R8G8B8: + return 3; + + case D3DFMT_A4R4G4B4: + case D3DFMT_X1R5G5B5: + case D3DFMT_A1R5G5B5: + case D3DFMT_R5G6B5: + case D3DFMT_V8U8: + case D3DFMT_A8P8: + return 2; + + case D3DFMT_R3G3B2: + case D3DFMT_DXT5: + case D3DFMT_DXT4: + case D3DFMT_A4L4: + case D3DFMT_L8: + case D3DFMT_P8: + return 1; + + default: + assert(0 && "Need to add format to get_bpp_for_d3dformat()."); + return 0; + } +} + #define check_image_info(info, width, height, depth, mip_levels, format, resource_type, image_file_format, wine_todo) \ check_image_info_(__FILE__, __LINE__, info, width, height, depth, mip_levels, format, resource_type, \ image_file_format, wine_todo) @@ -1145,6 +1955,16 @@ exit: } }
+static inline void set_box(D3DBOX *box, UINT left, UINT top, UINT right, UINT bottom, UINT front, UINT back) +{ + box->Left = left; + box->Top = top; + box->Right = right; + box->Bottom = bottom; + box->Front = front; + box->Back = back; +} + static inline BOOL compare_uint(uint32_t x, uint32_t y, uint32_t max_diff) { uint32_t diff = x > y ? x - y : y - x; @@ -1179,3 +1999,103 @@ static inline void _check_volume_readback_pixel_4bpp(const char *file, uint32_t uint32_t color = get_volume_readback_color(rb, x, y, z); todo_wine_if(todo) ok_(file, line)(color == expected_color, "Got color 0x%08x, expected 0x%08x.\n", color, expected_color); } + +static inline BOOL check_readback_pixel_4bpp_rgba(const void *got, const void *expected, uint32_t max_diff) +{ + const uint32_t *a = got; + const uint32_t *b = expected; + + return compare_color_4bpp(*a, *b, max_diff); +} + +typedef BOOL (*check_readback_pixel_func)(const void *, const void *, uint32_t); +static inline check_readback_pixel_func get_readback_pixel_func_for_d3dformat(D3DFORMAT format) +{ + switch (format) + { + case D3DFMT_A8B8G8R8: + case D3DFMT_A8R8G8B8: + return check_readback_pixel_4bpp_rgba; + + default: + assert(0 && "Need to add format to get_readback_pixel_func_for_d3dformat()."); + return 0; + } +} + +#define check_test_readback(got, got_row_pitch, got_slice_pitch, expected, width, height, depth, format, max_diff) \ + _check_test_readback(__FILE__, __LINE__, got, got_row_pitch, got_slice_pitch, expected, width, height, depth, \ + format, max_diff) +static inline void _check_test_readback(const char *file, uint32_t line, const void *got, int32_t got_row_pitch, + int32_t got_slice_pitch, const void *expected, uint32_t width, uint32_t height, uint32_t depth, + D3DFORMAT format, uint32_t max_diff) +{ + check_readback_pixel_func check_readback_pixel = get_readback_pixel_func_for_d3dformat(format); + unsigned int x, y, z, mismatch_count, expected_row_pitch, expected_slice_pitch; + const unsigned int fmt_bpp = get_bpp_for_d3dformat(format); + + expected_row_pitch = fmt_bpp * width; + expected_slice_pitch = expected_row_pitch * height; + mismatch_count = 0; + for (z = 0; z < depth; ++z) + { + const uint8_t *expected_slice = ((const uint8_t *)expected) + z * expected_slice_pitch; + const uint8_t *got_slice = ((const uint8_t *)got) + z * got_slice_pitch; + + for (y = 0; y < height; ++y) + { + const uint8_t *expected_row = expected_slice + y * expected_row_pitch; + const uint8_t *got_row = got_slice + y * got_row_pitch; + + for (x = 0; x < width; ++x) + { + const uint8_t *expected_ptr = expected_row + x * fmt_bpp; + const uint8_t *got_ptr = got_row + x * fmt_bpp; + + if (!check_readback_pixel(got_ptr, expected_ptr, max_diff)) + mismatch_count++; + } + } + } + ok_(file, line)(!mismatch_count, "Unexpected number of mismatched pixels %u.\n", mismatch_count); +} + +static inline IDirect3DDevice9 *create_device(HWND *window) +{ + D3DPRESENT_PARAMETERS present_parameters = { 0 }; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + HRESULT hr; + HWND wnd; + + *window = NULL; + + if (!(wnd = CreateWindowA("static", "d3dx9_test", WS_OVERLAPPEDWINDOW, 0, 0, + 640, 480, NULL, NULL, NULL, NULL))) + { + skip("Couldn't create application window.\n"); + return NULL; + } + + if (!(d3d = Direct3DCreate9(D3D_SDK_VERSION))) + { + skip("Couldn't create IDirect3D9 object.\n"); + DestroyWindow(wnd); + return NULL; + } + + present_parameters.Windowed = TRUE; + present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD; + hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, + &present_parameters, &device); + IDirect3D9_Release(d3d); + if (FAILED(hr)) + { + skip("Failed to create IDirect3DDevice9 object %#lx.\n", hr); + DestroyWindow(wnd); + return NULL; + } + + *window = wnd; + return device; +} diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c index 7789a709e84..20f3866ded3 100644 --- a/dlls/d3dx9_36/tests/surface.c +++ b/dlls/d3dx9_36/tests/surface.c @@ -133,46 +133,6 @@ static HRESULT create_file(const char *filename, const unsigned char *data, cons return D3DERR_INVALIDCALL; }
-static IDirect3DDevice9 *create_device(HWND *window) -{ - D3DPRESENT_PARAMETERS present_parameters = { 0 }; - IDirect3DDevice9 *device; - IDirect3D9 *d3d; - HRESULT hr; - HWND wnd; - - *window = NULL; - - if (!(wnd = CreateWindowA("static", "d3dx9_test", WS_OVERLAPPEDWINDOW, 0, 0, - 640, 480, NULL, NULL, NULL, NULL))) - { - skip("Couldn't create application window.\n"); - return NULL; - } - - if (!(d3d = Direct3DCreate9(D3D_SDK_VERSION))) - { - skip("Couldn't create IDirect3D9 object.\n"); - DestroyWindow(wnd); - return NULL; - } - - present_parameters.Windowed = TRUE; - present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD; - hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, - &present_parameters, &device); - IDirect3D9_Release(d3d); - if (FAILED(hr)) - { - skip("Failed to create IDirect3DDevice9 object %#lx.\n", hr); - DestroyWindow(wnd); - return NULL; - } - - *window = wnd; - return device; -} - /* fills dds_header with reasonable default values */ static void fill_dds_header(struct dds_header *header) { @@ -1193,50 +1153,6 @@ static const uint8_t a8p8_2_2_expected[] = 0x00,0x00,0x00,0x10,0x00,0x00,0x40,0x20,0x00,0x00,0x80,0x30,0xff,0xff,0xff,0x40, };
-static uint32_t get_bpp_for_d3dformat(D3DFORMAT format) -{ - switch (format) - { - case D3DFMT_A32B32G32R32F: - return 16; - - case D3DFMT_A16B16G16R16: - case D3DFMT_Q16W16V16U16: - return 8; - - case D3DFMT_Q8W8V8U8: - case D3DFMT_A8B8G8R8: - case D3DFMT_A8R8G8B8: - case D3DFMT_V16U16: - case D3DFMT_G16R16: - case D3DFMT_R32F: - return 4; - - case D3DFMT_R8G8B8: - return 3; - - case D3DFMT_A4R4G4B4: - case D3DFMT_X1R5G5B5: - case D3DFMT_A1R5G5B5: - case D3DFMT_R5G6B5: - case D3DFMT_V8U8: - case D3DFMT_A8P8: - return 2; - - case D3DFMT_R3G3B2: - case D3DFMT_DXT5: - case D3DFMT_DXT4: - case D3DFMT_A4L4: - case D3DFMT_L8: - case D3DFMT_P8: - return 1; - - default: - assert(0 && "Need to add format to get_bpp_for_d3dformat()."); - return 0; - } -} - static void test_format_conversion(IDirect3DDevice9 *device) { struct @@ -2221,22 +2137,6 @@ static const uint8_t q8w8v8u8_4_4_expected[] = 0xac,0x9c,0x8c,0xbc,0xec,0xdc,0xcc,0xfc,0x2b,0x1b,0x0b,0x3b,0x6b,0x5b,0x4b,0x7b, };
-static const uint8_t a8r8g8b8_4_4[] = -{ - 0x00,0xff,0x00,0x80,0x00,0xff,0x00,0x80,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff, - 0x80,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff, - 0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff, - 0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff, -}; - -static const uint8_t a8r8g8b8_4_4_expected[] = -{ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff, - 0x80,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff, - 0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff, - 0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff, -}; - static const uint8_t a4r4g4b4_4_4[] = { 0xff,0x00,0x0f,0x00,0x00,0xf0,0x00,0x0f,0xf0,0x00,0xf0,0x00,0xf0,0x00,0xf0,0x00, @@ -2324,6 +2224,21 @@ static const uint8_t r3g3b2_4_4_expected[] = static BOOL is_dxt_d3dformat(D3DFORMAT fmt); static void test_color_key(void) { + static const uint8_t a8r8g8b8_4_4[] = + { + 0x00,0xff,0x00,0x80,0x00,0xff,0x00,0x80,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff, + 0x80,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff, + 0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff, + 0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff, + }; + static const uint8_t a8r8g8b8_4_4_expected[] = + { + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff, + 0x80,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff, + 0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff, + 0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff, + }; + static const struct { D3DFORMAT src_format; @@ -5219,6 +5134,160 @@ static void test_D3DXSaveSurfaceToFile(IDirect3DDevice9 *device) IDirect3DSurface9_Release(surface); }
+static void test_image_filters(void) +{ + static const struct + { + DWORD filter; + const char *name; + } + test_filters[] = + { + { D3DX_FILTER_POINT, "D3DX_FILTER_POINT" }, + { D3DX_FILTER_LINEAR, "D3DX_FILTER_LINEAR" }, + { D3DX_FILTER_TRIANGLE, "D3DX_FILTER_TRIANGLE" }, + { D3DX_FILTER_BOX, "D3DX_FILTER_BOX" }, + }; + static const struct + { + const RECT src_rect; + const void *src_data; + D3DFORMAT format; + + unsigned int dst_width; + unsigned int dst_height; + struct + { + const void *expected_dst_data; + const void *expected_dst_data_32; + BOOL todo; + } + filter_expected[4]; + } tests[] = + { + { + { 0, 0, 16, 16 }, a8r8g8b8_16_16, D3DFMT_A8R8G8B8, 8, 8, + { + { a8r8g8b8_16_16_point_filter_8_8 }, + { a8r8g8b8_16_16_linear_filter_8_8, .todo = TRUE }, + { a8r8g8b8_16_16_triangle_filter_8_8, a8r8g8b8_16_16_triangle_filter_8_8_32bit, .todo = TRUE }, + /* Linear and box filters match. */ + { a8r8g8b8_16_16_linear_filter_8_8, .todo = TRUE }, + }, + }, + { + { 0, 0, 16, 16 }, a8r8g8b8_16_16, D3DFMT_A8R8G8B8, 7, 7, + { + { a8r8g8b8_16_16_point_filter_7_7, 0, }, + { a8r8g8b8_16_16_linear_filter_7_7, .todo = TRUE }, + { a8r8g8b8_16_16_triangle_filter_7_7, .todo = TRUE }, + /* + * If scaling down to a size that isn't a power of two, the + * box filter is replaced with the triangle filter. + */ + { a8r8g8b8_16_16_triangle_filter_7_7, .todo = TRUE }, + }, + }, + { + { 0, 0, 6, 6 }, a8r8g8b8_6_6, D3DFMT_A8R8G8B8, 3, 3, + { + { a8r8g8b8_6_6_point_filter_3_3, 0, }, + { a8r8g8b8_6_6_linear_filter_3_3, .todo = TRUE }, + { a8r8g8b8_6_6_triangle_filter_3_3, .todo = TRUE }, + /* + * If scaling down to a size that is half but isn't a power of + * two, the box filter is replaced with the linear filter. + */ + { a8r8g8b8_6_6_linear_filter_3_3, .todo = TRUE }, + }, + }, + { + { 0, 0, 6, 6 }, a8r8g8b8_6_6, D3DFMT_A8R8G8B8, 4, 4, + { + { a8r8g8b8_6_6_point_filter_4_4, 0, }, + { a8r8g8b8_6_6_linear_filter_4_4, .todo = TRUE }, + { a8r8g8b8_6_6_triangle_filter_4_4, .todo = TRUE }, + /* + * If scaling down to a size that is not half and isn't a power of + * two, the box filter is replaced with the triangle filter. + */ + { a8r8g8b8_6_6_triangle_filter_4_4, .todo = TRUE }, + }, + }, + { + { 0, 0, 4, 4 }, a8r8g8b8_4_4, D3DFMT_A8R8G8B8, 12, 12, + { + { a8r8g8b8_4_4_point_filter_12_12, .todo = TRUE }, + { a8r8g8b8_4_4_linear_filter_12_12, .todo = TRUE }, + { a8r8g8b8_4_4_triangle_filter_12_12, .todo = TRUE }, + { a8r8g8b8_4_4_triangle_filter_12_12, .todo = TRUE }, + }, + }, + { + { 0, 0, 4, 4 }, a8r8g8b8_4_4, D3DFMT_A8R8G8B8, 8, 8, + { + { a8r8g8b8_4_4_point_filter_8_8 }, + /* + * When scaling up by 2, linear and triangle filters behave + * the same. + */ + { a8r8g8b8_4_4_linear_filter_8_8, .todo = TRUE }, + { a8r8g8b8_4_4_linear_filter_8_8, .todo = TRUE }, + { a8r8g8b8_4_4_linear_filter_8_8, .todo = TRUE }, + }, + }, + }; + const uint8_t *expected_dst; + IDirect3DDevice9 *device; + D3DLOCKED_RECT lock_rect; + IDirect3DSurface9 *surf; + uint32_t src_pitch; + unsigned int i, j; + HRESULT hr; + HWND hwnd; + + if (!(device = create_device(&hwnd))) + return; + + for (i = 0; i < ARRAY_SIZE(tests); ++i) + { + const unsigned int fmt_bpp = get_bpp_for_d3dformat(tests[i].format); + + winetest_push_context("Test %u", i); + + hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, tests[i].dst_width, tests[i].dst_height, + tests[i].format, D3DPOOL_SCRATCH, &surf, NULL); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + + src_pitch = fmt_bpp * (tests[i].src_rect.right - tests[i].src_rect.left); + for (j = 0; j < ARRAY_SIZE(test_filters); ++j) + { + winetest_push_context("Filter %s", test_filters[j].name); + + hr = D3DXLoadSurfaceFromMemory(surf, NULL, NULL, tests[i].src_data, tests[i].format, + src_pitch, NULL, &tests[i].src_rect, test_filters[j].filter, 0); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + if (sizeof(void *) == 4 && tests[i].filter_expected[j].expected_dst_data_32) + expected_dst = tests[i].filter_expected[j].expected_dst_data_32; + else + expected_dst = tests[i].filter_expected[j].expected_dst_data; + + IDirect3DSurface9_LockRect(surf, &lock_rect, NULL, D3DLOCK_READONLY); + todo_wine_if(tests[i].filter_expected[j].todo) check_test_readback(lock_rect.pBits, lock_rect.Pitch, 0, + expected_dst, tests[i].dst_width, tests[i].dst_height, 1, tests[i].format, 0); + IDirect3DSurface9_UnlockRect(surf); + + winetest_pop_context(); + } + + check_release((IUnknown *)surf, 0); + winetest_pop_context(); + } + + check_release((IUnknown *)device, 0); + DestroyWindow(hwnd); +} + START_TEST(surface) { HWND wnd; @@ -5261,4 +5330,5 @@ START_TEST(surface) DestroyWindow(wnd);
test_color_key(); + test_image_filters(); } diff --git a/dlls/d3dx9_36/tests/texture.c b/dlls/d3dx9_36/tests/texture.c index f3f45a8eacd..a87152fc2ac 100644 --- a/dlls/d3dx9_36/tests/texture.c +++ b/dlls/d3dx9_36/tests/texture.c @@ -1077,8 +1077,14 @@ static void test_D3DXFilterTexture(IDirect3DDevice9 *device) IDirect3DTexture9 *tex; IDirect3DCubeTexture9 *cubetex; IDirect3DVolumeTexture9 *voltex; + D3DLOCKED_RECT lock_rect; + IDirect3DSurface9 *surf; + D3DLOCKED_BOX lock_box; + IDirect3DVolume9 *vol; + D3DBOX box; HRESULT hr; uint32_t i; + RECT rect;
hr = IDirect3DDevice9_CreateTexture(device, 256, 256, 5, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &tex, NULL);
@@ -1221,6 +1227,137 @@ static void test_D3DXFilterTexture(IDirect3DDevice9 *device) else skip("Failed to create volume texture\n");
+ /* Test D3DXFilterTexture() D3DX_DEFAULT behavior. */ + hr = IDirect3DDevice9_CreateTexture(device, 16, 16, 2, 0, D3DFMT_A8R8G8B8, D3DPOOL_SCRATCH, &tex, NULL); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + IDirect3DTexture9_GetSurfaceLevel(tex, 0, &surf); + SetRect(&rect, 0, 0, 16, 16); + + hr = D3DXLoadSurfaceFromMemory(surf, NULL, NULL, a8r8g8b8_16_16, D3DFMT_A8R8G8B8, 64, NULL, + &rect, D3DX_FILTER_NONE, 0); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + IDirect3DSurface9_Release(surf); + + /* Default matches D3DX_FILTER_BOX. */ + hr = D3DXFilterTexture((IDirect3DBaseTexture9 *)tex, NULL, 0, D3DX_DEFAULT); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + + IDirect3DTexture9_LockRect(tex, 1, &lock_rect, NULL, D3DLOCK_READONLY); + todo_wine check_test_readback(lock_rect.pBits, lock_rect.Pitch, 0, a8r8g8b8_16_16_linear_filter_8_8, 8, 8, 1, + D3DFMT_A8R8G8B8, 0); + IDirect3DTexture9_UnlockRect(tex, 1); + IDirect3DTexture9_Release(tex); + + /* Test with a non power of 2 texture size. */ + hr = IDirect3DDevice9_CreateTexture(device, 6, 6, 2, 0, D3DFMT_A8R8G8B8, D3DPOOL_SCRATCH, &tex, NULL); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + + IDirect3DTexture9_GetSurfaceLevel(tex, 0, &surf); + SetRect(&rect, 0, 0, 6, 6); + hr = D3DXLoadSurfaceFromMemory(surf, NULL, NULL, a8r8g8b8_6_6, D3DFMT_A8R8G8B8, 24, NULL, + &rect, D3DX_FILTER_NONE, 0); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + IDirect3DSurface9_Release(surf); + + /* + * MSDN claims non power of 2 textures default to + * D3DX_FILTER_BOX | D3DX_FILTER_DITHER, which doesn't make much sense. + * It's actually D3DX_FILTER_TRIANGLE | D3DX_FILTER_DITHER, which matches + * the behavior of using D3DX_DEFAULT as the filter argument for all other + * functions. + */ + hr = D3DXFilterTexture((IDirect3DBaseTexture9 *)tex, NULL, 0, D3DX_DEFAULT); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + + IDirect3DTexture9_LockRect(tex, 1, &lock_rect, NULL, D3DLOCK_READONLY); + todo_wine check_test_readback(lock_rect.pBits, lock_rect.Pitch, 0, a8r8g8b8_6_6_triangle_dither_filter_3_3, 3, 3, 1, + D3DFMT_A8R8G8B8, 0); + IDirect3DTexture9_UnlockRect(tex, 1); + + /* + * Do the same thing as D3DXFilterTexture() using D3DXLoadSurfaceFromMemory() + * to confirm behavior. + */ + IDirect3DTexture9_GetSurfaceLevel(tex, 1, &surf); + SetRect(&rect, 0, 0, 6, 6); + hr = D3DXLoadSurfaceFromMemory(surf, NULL, NULL, a8r8g8b8_6_6, D3DFMT_A8R8G8B8, 24, NULL, + &rect, D3DX_FILTER_TRIANGLE | D3DX_FILTER_DITHER, 0); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + IDirect3DSurface9_Release(surf); + + IDirect3DTexture9_LockRect(tex, 1, &lock_rect, NULL, D3DLOCK_READONLY); + todo_wine check_test_readback(lock_rect.pBits, lock_rect.Pitch, 0, a8r8g8b8_6_6_triangle_dither_filter_3_3, 3, 3, 1, + D3DFMT_A8R8G8B8, 0); + IDirect3DTexture9_UnlockRect(tex, 1); + + IDirect3DTexture9_Release(tex); + + /* D3DX_DEFAULT behavior for volume textures. */ + hr = IDirect3DDevice9_CreateVolumeTexture(device, 8, 8, 8, 0, 0, D3DFMT_A8R8G8B8, D3DPOOL_SCRATCH, &voltex, NULL); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + IDirect3DVolumeTexture9_GetVolumeLevel(voltex, 0, &vol); + set_box(&box, 0, 0, 8, 8, 0, 8); + + hr = D3DXLoadVolumeFromMemory(vol, NULL, NULL, a8r8g8b8_8_8_8, D3DFMT_A8R8G8B8, 32, 256, NULL, &box, + D3DX_FILTER_NONE, 0); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + IDirect3DVolume9_Release(vol); + + /* Default matches D3DX_FILTER_BOX. */ + hr = D3DXFilterTexture((IDirect3DBaseTexture9 *)voltex, NULL, 0, D3DX_DEFAULT); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + + IDirect3DVolumeTexture9_LockBox(voltex, 1, &lock_box, NULL, D3DLOCK_READONLY); + if (sizeof(void *) == 4) + { + todo_wine check_test_readback(lock_box.pBits, lock_box.RowPitch, lock_box.SlicePitch, + a8r8g8b8_8_8_8_box_filter_4_4_4_32bit, 4, 4, 4, D3DFMT_A8R8G8B8, 0); + } + else + { + todo_wine check_test_readback(lock_box.pBits, lock_box.RowPitch, lock_box.SlicePitch, + a8r8g8b8_8_8_8_linear_filter_4_4_4, 4, 4, 4, D3DFMT_A8R8G8B8, 0); + } + IDirect3DVolumeTexture9_UnlockBox(voltex, 1); + IDirect3DVolumeTexture9_Release(voltex); + + /* Test with a non power of 2 volume texture size. */ + hr = IDirect3DDevice9_CreateVolumeTexture(device, 6, 6, 6, 0, 0, D3DFMT_A8R8G8B8, D3DPOOL_SCRATCH, &voltex, NULL); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + IDirect3DVolumeTexture9_GetVolumeLevel(voltex, 0, &vol); + set_box(&box, 0, 0, 6, 6, 0, 6); + + hr = D3DXLoadVolumeFromMemory(vol, NULL, NULL, a8r8g8b8_6_6_6, D3DFMT_A8R8G8B8, 24, 144, NULL, &box, + D3DX_FILTER_NONE, 0); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + IDirect3DVolume9_Release(vol); + + /* + * Default on non power of 2 volume texture, matches + * D3DX_FILTER_TRIANGLE | D3DX_FILTER_DITHER. + */ + hr = D3DXFilterTexture((IDirect3DBaseTexture9 *)voltex, NULL, 0, D3DX_DEFAULT); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + + IDirect3DVolumeTexture9_LockBox(voltex, 1, &lock_box, NULL, D3DLOCK_READONLY); + todo_wine check_test_readback(lock_box.pBits, lock_box.RowPitch, lock_box.SlicePitch, + a8r8g8b8_6_6_6_triangle_dither_filter_3_3_3, 3, 3, 3, D3DFMT_A8R8G8B8, 0); + IDirect3DVolumeTexture9_UnlockBox(voltex, 1); + + IDirect3DVolumeTexture9_GetVolumeLevel(voltex, 1, &vol); + set_box(&box, 0, 0, 6, 6, 0, 6); + + hr = D3DXLoadVolumeFromMemory(vol, NULL, NULL, a8r8g8b8_6_6_6, D3DFMT_A8R8G8B8, 24, 144, NULL, &box, + D3DX_FILTER_TRIANGLE | D3DX_FILTER_DITHER, 0); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + IDirect3DVolume9_Release(vol); + + IDirect3DVolumeTexture9_LockBox(voltex, 1, &lock_box, NULL, D3DLOCK_READONLY); + todo_wine check_test_readback(lock_box.pBits, lock_box.RowPitch, lock_box.SlicePitch, + a8r8g8b8_6_6_6_triangle_dither_filter_3_3_3, 3, 3, 3, D3DFMT_A8R8G8B8, 0); + IDirect3DVolumeTexture9_UnlockBox(voltex, 1); + IDirect3DVolumeTexture9_Release(voltex); + /* Test textures with D3DUSAGE_AUTOGENMIPMAP usage */ if (!is_autogenmipmap_supported(device, D3DRTYPE_TEXTURE)) { diff --git a/dlls/d3dx9_36/tests/volume.c b/dlls/d3dx9_36/tests/volume.c index 4acebe1a181..9ed435e5edd 100644 --- a/dlls/d3dx9_36/tests/volume.c +++ b/dlls/d3dx9_36/tests/volume.c @@ -23,6 +23,13 @@ #include "d3dx9tex.h" #include "d3dx9_test_images.h"
+#define check_release(obj, exp) _check_release(__LINE__, obj, exp) +static inline void _check_release(unsigned int line, IUnknown *obj, int exp) +{ + int ref = IUnknown_Release(obj); + ok_(__FILE__, line)(ref == exp, "Invalid refcount. Expected %d, got %d\n", exp, ref); +} + #define check_pixel_4bpp(box, x, y, z, color) _check_pixel_4bpp(__LINE__, box, x, y, z, color) static inline void _check_pixel_4bpp(unsigned int line, const D3DLOCKED_BOX *box, int x, int y, int z, DWORD expected_color) { @@ -37,16 +44,6 @@ static inline void _check_pixel_8bpp(unsigned int line, const D3DLOCKED_BOX *box ok_(__FILE__, line)(color == expected_color, "Got color %#I64x, expected %#I64x.\n", color, expected_color); }
-static inline void set_box(D3DBOX *box, UINT left, UINT top, UINT right, UINT bottom, UINT front, UINT back) -{ - box->Left = left; - box->Top = top; - box->Right = right; - box->Bottom = bottom; - box->Front = front; - box->Back = back; -} - static void test_D3DXLoadVolumeFromMemory(IDirect3DDevice9 *device) { int i, x, y, z; @@ -659,6 +656,121 @@ static void test_d3dx_save_volume_to_file(IDirect3DDevice9 *device) IDirect3DVolumeTexture9_Release(volume_texture); }
+static void test_image_filters(void) +{ + static const struct + { + DWORD filter; + const char *name; + } + test_filters[] = + { + { D3DX_FILTER_POINT, "D3DX_FILTER_POINT" }, + { D3DX_FILTER_LINEAR, "D3DX_FILTER_LINEAR" }, + { D3DX_FILTER_TRIANGLE, "D3DX_FILTER_TRIANGLE" }, + { D3DX_FILTER_BOX, "D3DX_FILTER_BOX" }, + }; + static const struct + { + const D3DBOX src_box; + const void *src_data; + D3DFORMAT format; + + unsigned int dst_width; + unsigned int dst_height; + unsigned int dst_depth; + struct + { + const void *expected_dst_data; + const void *expected_dst_data_32; + BOOL todo; + } + filter_expected[4]; + } tests[] = + { + { + { 0, 0, 8, 8, 0, 8 }, a8r8g8b8_8_8_8, D3DFMT_A8R8G8B8, 4, 4, 4, + { + { a8r8g8b8_8_8_8_point_filter_4_4_4 }, + { a8r8g8b8_8_8_8_linear_filter_4_4_4, .todo = TRUE }, + { + a8r8g8b8_8_8_8_triangle_filter_4_4_4, a8r8g8b8_8_8_8_triangle_filter_4_4_4_32bit, + .todo = TRUE + }, + /* Linear and box filters match on 64bit, but not 32bit. */ + { + a8r8g8b8_8_8_8_linear_filter_4_4_4, a8r8g8b8_8_8_8_box_filter_4_4_4_32bit, + .todo = TRUE + }, + }, + }, + { + { 0, 0, 6, 6, 0, 6 }, a8r8g8b8_6_6_6, D3DFMT_A8R8G8B8, 3, 3, 3, + { + { a8r8g8b8_6_6_6_point_filter_3_3_3 }, + { a8r8g8b8_6_6_6_linear_filter_3_3_3, .todo = TRUE }, + { a8r8g8b8_6_6_6_triangle_filter_3_3_3, .todo = TRUE }, + { a8r8g8b8_6_6_6_linear_filter_3_3_3, .todo = TRUE }, + }, + }, + }; + IDirect3DVolumeTexture9 *volume_texture; + uint32_t src_pitch, src_slice_pitch; + const uint8_t *expected_dst; + D3DLOCKED_BOX locked_box; + IDirect3DVolume9 *volume; + IDirect3DDevice9 *device; + unsigned int i, j; + HRESULT hr; + HWND hwnd; + + if (!(device = create_device(&hwnd))) + return; + + for (i = 0; i < ARRAY_SIZE(tests); ++i) + { + const unsigned int fmt_bpp = get_bpp_for_d3dformat(tests[i].format); + + winetest_push_context("Test %u", i); + + hr = IDirect3DDevice9_CreateVolumeTexture(device, tests[i].dst_width, tests[i].dst_height, tests[i].dst_depth, 1, + 0, tests[i].format, D3DPOOL_SCRATCH, &volume_texture, NULL); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + + IDirect3DVolumeTexture9_GetVolumeLevel(volume_texture, 0, &volume); + + src_pitch = fmt_bpp * (tests[i].src_box.Right - tests[i].src_box.Left); + src_slice_pitch = src_pitch * (tests[i].src_box.Back - tests[i].src_box.Front); + for (j = 0; j < ARRAY_SIZE(test_filters); ++j) + { + winetest_push_context("Filter %s", test_filters[j].name); + + hr = D3DXLoadVolumeFromMemory(volume, NULL, NULL, tests[i].src_data, tests[i].format, src_pitch, + src_slice_pitch, NULL, &tests[i].src_box, test_filters[j].filter, 0); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + if (sizeof(void *) == 4 && tests[i].filter_expected[j].expected_dst_data_32) + expected_dst = tests[i].filter_expected[j].expected_dst_data_32; + else + expected_dst = tests[i].filter_expected[j].expected_dst_data; + + IDirect3DVolume9_LockBox(volume, &locked_box, NULL, D3DLOCK_READONLY); + todo_wine_if(tests[i].filter_expected[j].todo) check_test_readback(locked_box.pBits, locked_box.RowPitch, + locked_box.SlicePitch, expected_dst, tests[i].dst_width, tests[i].dst_height, tests[i].dst_depth, + tests[i].format, 0); + IDirect3DVolume9_UnlockBox(volume); + + winetest_pop_context(); + } + + check_release((IUnknown *)volume_texture, 1); + check_release((IUnknown *)volume, 0); + winetest_pop_context(); + } + + check_release((IUnknown *)device, 0); + DestroyWindow(hwnd); +} + START_TEST(volume) { HWND wnd; @@ -700,4 +812,6 @@ START_TEST(volume) IDirect3DDevice9_Release(device); IDirect3D9_Release(d3d); DestroyWindow(wnd); + + test_image_filters(); }