Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
-- v2: d3d10/effect: Add support for 'or' instruction. d3d10/effect: Add support for 'not' instruction. d3d10/effect: Add support for 'exp' instruction. d3d10/effect: Add support for 'log' instruction.
From: Nikolay Sivov nsivov@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/effect.c | 15 ++++ dlls/d3d10/tests/effect.c | 169 ++++++++++++++++++++++++-------------- 2 files changed, 121 insertions(+), 63 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 07da80cba62..46149433ec7 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -433,6 +433,20 @@ static void pres_iadd(float **args, unsigned int n, const struct preshader_instr } }
+static void pres_imul(float **args, unsigned int n, const struct preshader_instr *instr) +{ + int *arg1 = (int *)args[0]; + int *arg2 = (int *)args[1]; + float *retval = args[2]; + unsigned int i; + + for (i = 0; i < instr->comp_count; ++i) + { + int v = arg1[instr->scalar ? 0 : i] * arg2[i]; + retval[i] = *(float *)&v; + } +} + static void pres_bilt(float **args, unsigned int n, const struct preshader_instr *instr) { int *arg1 = (int *)args[0]; @@ -686,6 +700,7 @@ static const struct preshader_op_info preshader_ops[] = { 0x214, "buge", pres_buge }, { 0x215, "bult", pres_bult }, { 0x216, "iadd", pres_iadd }, + { 0x219, "imul", pres_imul }, { 0x21a, "udiv", pres_udiv }, { 0x21d, "imin", pres_imin }, { 0x21e, "imax", pres_imax }, diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 919a4b70459..16ac867384b 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -8016,6 +8016,14 @@ static void set_vec4(float *v, float x, float y, float z, float w) v[3] = w; }
+static void set_int4(int *v, int x, int y, int z, int w) +{ + v[0] = x; + v[1] = y; + v[2] = z; + v[3] = w; +} + static void test_effect_index_expression(void) { D3D10_PASS_SHADER_DESC shader_desc; @@ -8296,13 +8304,17 @@ technique10 tech { SetBlendState( NULL, dot(g_var.zyx, g_var2.yzw), 0 ); } + pass p28 + { + SetBlendState( NULL, g_var3.x * g_var3.y, 0 ); + } } #endif static DWORD fx_test_value_expression[] = { - 0x43425844, 0xfbc3e92d, 0x29ab7dd0, 0x8ec4e666, 0x39446377, 0x00000001, 0x00003984, 0x00000001, - 0x00000024, 0x30315846, 0x00003958, 0xfeff1001, 0x00000001, 0x00000004, 0x00000001, 0x00000000, - 0x00000000, 0x00000000, 0x00000001, 0x000031c0, 0x00000000, 0x00000000, 0x00000001, 0x00000000, + 0x43425844, 0xd12394ba, 0xb7afc3da, 0x34982efa, 0xdb732fa2, 0x00000001, 0x00003b58, 0x00000001, + 0x00000024, 0x30315846, 0x00003b2c, 0xfeff1001, 0x00000001, 0x00000004, 0x00000001, 0x00000000, + 0x00000000, 0x00000000, 0x00000001, 0x00003358, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x6f6c4724, 0x736c6162, 0x6f6c6600, 0x00347461, 0x0000000d, 0x00000001, 0x00000000, 0x00000010, 0x00000010, 0x00000010, 0x0000210a, 0x61765f67, 0x5f670072, 0x32726176, 0x746e6900, 0x003d0034, 0x00010000, @@ -8701,66 +8713,80 @@ static DWORD fx_test_value_expression[] = 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000002, 0x10000001, 0x00000001, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, - 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00000004, 0x00000040, - 0x00000000, 0x00000004, 0xffffffff, 0x00000000, 0x00000030, 0x00000014, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000036, 0x00000014, 0x00000000, 0x00000010, 0x00000000, - 0x00000000, 0x00000000, 0x0000005e, 0x00000042, 0x00000000, 0x00000020, 0x00000000, 0x00000000, - 0x00000000, 0x00000087, 0x0000006b, 0x00000000, 0x00000030, 0x00000000, 0x00000000, 0x00000000, - 0x000000bc, 0x000000a0, 0x00000000, 0xffffffff, 0x00000001, 0x00000019, 0x00000000, 0x00000006, - 0x000000c5, 0x00000000, 0x000001b5, 0x0000001c, 0x00000000, 0x000001ba, 0x00000003, 0x00000000, - 0x0000000a, 0x00000000, 0x00000006, 0x000001bd, 0x0000000b, 0x00000000, 0x00000001, 0x00000405, - 0x00000002, 0x00000000, 0x00000001, 0x00000411, 0x0000041d, 0x00000003, 0x00000000, 0x0000000a, - 0x00000000, 0x00000006, 0x00000420, 0x0000000b, 0x00000000, 0x00000001, 0x00000574, 0x00000002, - 0x00000000, 0x00000001, 0x00000580, 0x0000058c, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, - 0x00000006, 0x0000058f, 0x0000000b, 0x00000000, 0x00000001, 0x000007bf, 0x00000002, 0x00000000, - 0x00000001, 0x000007cb, 0x000007d7, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, - 0x000007da, 0x0000000b, 0x00000000, 0x00000001, 0x00000902, 0x00000002, 0x00000000, 0x00000001, - 0x0000090e, 0x0000091a, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000091d, - 0x0000000b, 0x00000000, 0x00000001, 0x00000a45, 0x00000002, 0x00000000, 0x00000001, 0x00000a51, - 0x00000a5d, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000a60, 0x0000000b, - 0x00000000, 0x00000001, 0x00000b5c, 0x00000002, 0x00000000, 0x00000001, 0x00000b68, 0x00000b74, - 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000b77, 0x0000000b, 0x00000000, - 0x00000001, 0x00000cc7, 0x00000002, 0x00000000, 0x00000001, 0x00000cd3, 0x00000cdf, 0x00000003, - 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000ce2, 0x0000000b, 0x00000000, 0x00000001, - 0x00000dd2, 0x00000002, 0x00000000, 0x00000001, 0x00000dde, 0x00000dea, 0x00000003, 0x00000000, - 0x0000000a, 0x00000000, 0x00000006, 0x00000ded, 0x0000000b, 0x00000000, 0x00000001, 0x00000fe9, - 0x00000002, 0x00000000, 0x00000001, 0x00000ff5, 0x00001001, 0x00000003, 0x00000000, 0x0000000a, - 0x00000000, 0x00000006, 0x00001004, 0x0000000b, 0x00000000, 0x00000001, 0x00001180, 0x00000002, - 0x00000000, 0x00000001, 0x0000118c, 0x00001198, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, - 0x00000006, 0x0000119c, 0x0000000b, 0x00000000, 0x00000001, 0x0000136c, 0x00000002, 0x00000000, - 0x00000001, 0x00001378, 0x00001384, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, - 0x00001388, 0x0000000b, 0x00000000, 0x00000001, 0x00001504, 0x00000002, 0x00000000, 0x00000001, - 0x00001510, 0x0000151c, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001520, - 0x0000000b, 0x00000000, 0x00000001, 0x0000169c, 0x00000002, 0x00000000, 0x00000001, 0x000016a8, - 0x000016b4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000016b8, 0x0000000b, - 0x00000000, 0x00000001, 0x00001834, 0x00000002, 0x00000000, 0x00000001, 0x00001840, 0x0000184c, - 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001850, 0x0000000b, 0x00000000, - 0x00000001, 0x000019cc, 0x00000002, 0x00000000, 0x00000001, 0x000019d8, 0x000019e4, 0x00000003, - 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000019e8, 0x0000000b, 0x00000000, 0x00000001, - 0x00001b38, 0x00000002, 0x00000000, 0x00000001, 0x00001b44, 0x00001b50, 0x00000003, 0x00000000, - 0x0000000a, 0x00000000, 0x00000006, 0x00001b54, 0x0000000b, 0x00000000, 0x00000001, 0x00001ca4, - 0x00000002, 0x00000000, 0x00000001, 0x00001cb0, 0x00001cbc, 0x00000003, 0x00000000, 0x0000000a, - 0x00000000, 0x00000006, 0x00001cc0, 0x0000000b, 0x00000000, 0x00000001, 0x00001e10, 0x00000002, - 0x00000000, 0x00000001, 0x00001e1c, 0x00001e28, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, - 0x00000006, 0x00001e2c, 0x0000000b, 0x00000000, 0x00000001, 0x00001fac, 0x00000002, 0x00000000, - 0x00000001, 0x00001fb8, 0x00001fc4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, - 0x00001fc8, 0x0000000b, 0x00000000, 0x00000001, 0x0000229c, 0x00000002, 0x00000000, 0x00000001, - 0x000022a8, 0x000022b4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000022b8, - 0x0000000b, 0x00000000, 0x00000001, 0x0000259c, 0x00000002, 0x00000000, 0x00000001, 0x000025a8, - 0x000025b4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000025b8, 0x0000000b, - 0x00000000, 0x00000001, 0x00002808, 0x00000002, 0x00000000, 0x00000001, 0x00002814, 0x00002820, - 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002824, 0x0000000b, 0x00000000, - 0x00000001, 0x00002914, 0x00000002, 0x00000000, 0x00000001, 0x00002920, 0x0000292c, 0x00000003, - 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002930, 0x0000000b, 0x00000000, 0x00000001, - 0x00002a20, 0x00000002, 0x00000000, 0x00000001, 0x00002a2c, 0x00002a38, 0x00000003, 0x00000000, - 0x0000000a, 0x00000000, 0x00000006, 0x00002a3c, 0x0000000b, 0x00000000, 0x00000001, 0x00002be4, - 0x00000002, 0x00000000, 0x00000001, 0x00002bf0, 0x00002bfc, 0x00000003, 0x00000000, 0x0000000a, - 0x00000000, 0x00000006, 0x00002c00, 0x0000000b, 0x00000000, 0x00000001, 0x00002da8, 0x00000002, - 0x00000000, 0x00000001, 0x00002db4, 0x00002dc0, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, - 0x00000006, 0x00002dc4, 0x0000000b, 0x00000000, 0x00000001, 0x00002fb4, 0x00000002, 0x00000000, - 0x00000001, 0x00002fc0, 0x00002fcc, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, - 0x00002fd0, 0x0000000b, 0x00000000, 0x00000001, 0x000031a8, 0x00000002, 0x00000000, 0x00000001, - 0x000031b4, + 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00383270, 0x00000178, + 0x43425844, 0x40465071, 0x33ca1cb9, 0x8d1d7192, 0xedd86abd, 0x00000001, 0x00000178, 0x00000003, + 0x0000002c, 0x000000a8, 0x000000b4, 0x42415443, 0x00000074, 0x0000001c, 0x0000004b, 0x46580400, + 0x00000001, 0x0000001c, 0x00000100, 0x00000048, 0x00000030, 0x00000002, 0x00000001, 0x00000038, + 0x00000000, 0x61765f67, 0xab003372, 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874, + 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, + 0x30312072, 0xab00312e, 0x34494c43, 0x00000004, 0x00000000, 0x434c5846, 0x000000bc, 0x00000005, + 0x21900001, 0x00000002, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000002, 0x00000000, + 0x00000000, 0x00000007, 0x00000000, 0x13000001, 0x00000001, 0x00000000, 0x00000007, 0x00000000, + 0x00000000, 0x00000004, 0x00000000, 0x13000001, 0x00000001, 0x00000000, 0x00000007, 0x00000000, + 0x00000000, 0x00000004, 0x00000001, 0x13000001, 0x00000001, 0x00000000, 0x00000007, 0x00000000, + 0x00000000, 0x00000004, 0x00000002, 0x13000001, 0x00000001, 0x00000000, 0x00000007, 0x00000000, + 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000001, 0x00000002, + 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00000004, 0x00000040, 0x00000000, 0x00000004, + 0xffffffff, 0x00000000, 0x00000030, 0x00000014, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000036, 0x00000014, 0x00000000, 0x00000010, 0x00000000, 0x00000000, 0x00000000, + 0x0000005e, 0x00000042, 0x00000000, 0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000087, + 0x0000006b, 0x00000000, 0x00000030, 0x00000000, 0x00000000, 0x00000000, 0x000000bc, 0x000000a0, + 0x00000000, 0xffffffff, 0x00000001, 0x00000019, 0x00000000, 0x00000006, 0x000000c5, 0x00000000, + 0x000001b5, 0x0000001d, 0x00000000, 0x000001ba, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, + 0x00000006, 0x000001bd, 0x0000000b, 0x00000000, 0x00000001, 0x00000405, 0x00000002, 0x00000000, + 0x00000001, 0x00000411, 0x0000041d, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, + 0x00000420, 0x0000000b, 0x00000000, 0x00000001, 0x00000574, 0x00000002, 0x00000000, 0x00000001, + 0x00000580, 0x0000058c, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000058f, + 0x0000000b, 0x00000000, 0x00000001, 0x000007bf, 0x00000002, 0x00000000, 0x00000001, 0x000007cb, + 0x000007d7, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000007da, 0x0000000b, + 0x00000000, 0x00000001, 0x00000902, 0x00000002, 0x00000000, 0x00000001, 0x0000090e, 0x0000091a, + 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000091d, 0x0000000b, 0x00000000, + 0x00000001, 0x00000a45, 0x00000002, 0x00000000, 0x00000001, 0x00000a51, 0x00000a5d, 0x00000003, + 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000a60, 0x0000000b, 0x00000000, 0x00000001, + 0x00000b5c, 0x00000002, 0x00000000, 0x00000001, 0x00000b68, 0x00000b74, 0x00000003, 0x00000000, + 0x0000000a, 0x00000000, 0x00000006, 0x00000b77, 0x0000000b, 0x00000000, 0x00000001, 0x00000cc7, + 0x00000002, 0x00000000, 0x00000001, 0x00000cd3, 0x00000cdf, 0x00000003, 0x00000000, 0x0000000a, + 0x00000000, 0x00000006, 0x00000ce2, 0x0000000b, 0x00000000, 0x00000001, 0x00000dd2, 0x00000002, + 0x00000000, 0x00000001, 0x00000dde, 0x00000dea, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, + 0x00000006, 0x00000ded, 0x0000000b, 0x00000000, 0x00000001, 0x00000fe9, 0x00000002, 0x00000000, + 0x00000001, 0x00000ff5, 0x00001001, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, + 0x00001004, 0x0000000b, 0x00000000, 0x00000001, 0x00001180, 0x00000002, 0x00000000, 0x00000001, + 0x0000118c, 0x00001198, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000119c, + 0x0000000b, 0x00000000, 0x00000001, 0x0000136c, 0x00000002, 0x00000000, 0x00000001, 0x00001378, + 0x00001384, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001388, 0x0000000b, + 0x00000000, 0x00000001, 0x00001504, 0x00000002, 0x00000000, 0x00000001, 0x00001510, 0x0000151c, + 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001520, 0x0000000b, 0x00000000, + 0x00000001, 0x0000169c, 0x00000002, 0x00000000, 0x00000001, 0x000016a8, 0x000016b4, 0x00000003, + 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000016b8, 0x0000000b, 0x00000000, 0x00000001, + 0x00001834, 0x00000002, 0x00000000, 0x00000001, 0x00001840, 0x0000184c, 0x00000003, 0x00000000, + 0x0000000a, 0x00000000, 0x00000006, 0x00001850, 0x0000000b, 0x00000000, 0x00000001, 0x000019cc, + 0x00000002, 0x00000000, 0x00000001, 0x000019d8, 0x000019e4, 0x00000003, 0x00000000, 0x0000000a, + 0x00000000, 0x00000006, 0x000019e8, 0x0000000b, 0x00000000, 0x00000001, 0x00001b38, 0x00000002, + 0x00000000, 0x00000001, 0x00001b44, 0x00001b50, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, + 0x00000006, 0x00001b54, 0x0000000b, 0x00000000, 0x00000001, 0x00001ca4, 0x00000002, 0x00000000, + 0x00000001, 0x00001cb0, 0x00001cbc, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, + 0x00001cc0, 0x0000000b, 0x00000000, 0x00000001, 0x00001e10, 0x00000002, 0x00000000, 0x00000001, + 0x00001e1c, 0x00001e28, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001e2c, + 0x0000000b, 0x00000000, 0x00000001, 0x00001fac, 0x00000002, 0x00000000, 0x00000001, 0x00001fb8, + 0x00001fc4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001fc8, 0x0000000b, + 0x00000000, 0x00000001, 0x0000229c, 0x00000002, 0x00000000, 0x00000001, 0x000022a8, 0x000022b4, + 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000022b8, 0x0000000b, 0x00000000, + 0x00000001, 0x0000259c, 0x00000002, 0x00000000, 0x00000001, 0x000025a8, 0x000025b4, 0x00000003, + 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000025b8, 0x0000000b, 0x00000000, 0x00000001, + 0x00002808, 0x00000002, 0x00000000, 0x00000001, 0x00002814, 0x00002820, 0x00000003, 0x00000000, + 0x0000000a, 0x00000000, 0x00000006, 0x00002824, 0x0000000b, 0x00000000, 0x00000001, 0x00002914, + 0x00000002, 0x00000000, 0x00000001, 0x00002920, 0x0000292c, 0x00000003, 0x00000000, 0x0000000a, + 0x00000000, 0x00000006, 0x00002930, 0x0000000b, 0x00000000, 0x00000001, 0x00002a20, 0x00000002, + 0x00000000, 0x00000001, 0x00002a2c, 0x00002a38, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, + 0x00000006, 0x00002a3c, 0x0000000b, 0x00000000, 0x00000001, 0x00002be4, 0x00000002, 0x00000000, + 0x00000001, 0x00002bf0, 0x00002bfc, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, + 0x00002c00, 0x0000000b, 0x00000000, 0x00000001, 0x00002da8, 0x00000002, 0x00000000, 0x00000001, + 0x00002db4, 0x00002dc0, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002dc4, + 0x0000000b, 0x00000000, 0x00000001, 0x00002fb4, 0x00000002, 0x00000000, 0x00000001, 0x00002fc0, + 0x00002fcc, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002fd0, 0x0000000b, + 0x00000000, 0x00000001, 0x000031a8, 0x00000002, 0x00000000, 0x00000001, 0x000031b4, 0x000031c0, + 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000031c4, 0x0000000b, 0x00000000, + 0x00000001, 0x00003340, 0x00000002, 0x00000000, 0x00000001, 0x0000334c, };
static float get_frc(float v) @@ -9425,6 +9451,23 @@ static void test_effect_value_expression(void) ok(blend_factor[idx] == 40.0f, "Got unexpected blend_factor[%u] %.8e.\n", idx, blend_factor[idx]); ok(!sample_mask, "Got unexpected sample_mask %#x.\n", sample_mask);
+ /* Signed integer multiplication */ + pass = t->lpVtbl->GetPassByName(t, "p28"); + ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n"); + + set_int4(i, 3, -2, 5, -4); + hr = g_var3->lpVtbl->SetIntVector(g_var3, i); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = pass->lpVtbl->Apply(pass, 0); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + ID3D10Device_OMGetBlendState(device, &blend_state, blend_factor, &sample_mask); + ok(!blend_state, "Unexpected blend state %p.\n", blend_state); + for (idx = 0; idx < ARRAY_SIZE(blend_factor); ++idx) + ok(blend_factor[idx] == -6.0f, "Got unexpected blend_factor[%u] %.8e.\n", idx, blend_factor[idx]); + ok(!sample_mask, "Got unexpected sample_mask %#x.\n", sample_mask); + effect->lpVtbl->Release(effect);
refcount = ID3D10Device_Release(device);
From: Nikolay Sivov nsivov@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/tests/effect.c | 114 +++++++++++++++----------------------- 1 file changed, 45 insertions(+), 69 deletions(-)
diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 16ac867384b..5ce828ab889 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -26,6 +26,22 @@
#define D3DERR_INVALIDCALL 0x8876086c
+static void set_vec4(float *v, float x, float y, float z, float w) +{ + v[0] = x; + v[1] = y; + v[2] = z; + v[3] = w; +} + +static void set_int4(int *v, int x, int y, int z, int w) +{ + v[0] = x; + v[1] = y; + v[2] = z; + v[3] = w; +} + static ULONG get_refcount(void *iface) { IUnknown *unknown = iface; @@ -5380,7 +5396,7 @@ static void test_vector_methods(ID3D10EffectVectorVariable *var, D3D10_SHADER_VA unsigned int i; HRESULT hr;
- set_f[0] = 1.0f; set_f[1] = 2.0f; set_f[2] = 3.0f; set_f[3] = 4.0f; + set_vec4(set_f, 1.0f, 2.0f, 3.0f, 4.0f); hr = var->lpVtbl->SetFloatVector(var, set_f); ok(hr == S_OK, "Variable %s, got unexpected hr %#lx.\n", name, hr);
@@ -5405,7 +5421,7 @@ static void test_vector_methods(ID3D10EffectVectorVariable *var, D3D10_SHADER_VA for (i = 0; i < components; ++i) ok(ret_b[i] == -1, "Variable %s, got unexpected value %#x.\n", name, ret_b[i]);
- set_i[0] = 5; set_i[1] = 6; set_i[2] = 7; set_i[3] = 8; + set_int4(set_i, 5, 6, 7, 8); hr = var->lpVtbl->SetIntVector(var, set_i); ok(hr == S_OK, "Variable %s, got unexpected hr %#lx.\n", name, hr);
@@ -8008,22 +8024,6 @@ static DWORD fx_test_index_expression[] = 0x00000005, 0x00000488, 0x00000008, 0x00000000, 0x00000005, 0x00000580, };
-static void set_vec4(float *v, float x, float y, float z, float w) -{ - v[0] = x; - v[1] = y; - v[2] = z; - v[3] = w; -} - -static void set_int4(int *v, int x, int y, int z, int w) -{ - v[0] = x; - v[1] = y; - v[2] = z; - v[3] = w; -} - static void test_effect_index_expression(void) { D3D10_PASS_SHADER_DESC shader_desc; @@ -8850,10 +8850,10 @@ static void test_effect_value_expression(void) ok(blend_factor[idx] == 0.0f, "Got unexpected blend_factor[%u] %.8e.\n", idx, blend_factor[idx]); ok(!sample_mask, "Got unexpected sample_mask %#x.\n", sample_mask);
- f[0] = 1.0f; f[1] = 2.0f; f[2] = 3.0f; f[3] = 4.0f; + set_vec4(f, 1.0f, 2.0f, 3.0f, 4.0f); hr = g_var->lpVtbl->SetFloatVector(g_var, f); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - f[0] = 2.0f; f[1] = 1.1f; f[2] = 0.1f; f[3] = -3.0f; + set_vec4(f, 2.0f, 1.1f, 0.1f, -3.0f); hr = g_var2->lpVtbl->SetFloatVector(g_var2, f); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
@@ -8886,7 +8886,7 @@ static void test_effect_value_expression(void) pass = t->lpVtbl->GetPassByName(t, "p5"); ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n");
- f[0] = 1.0f; f[1] = 2.0f; f[2] = 3.0f; f[3] = 4.0f; + set_vec4(f, 1.0f, 2.0f, 3.0f, 4.0f); hr = g_var->lpVtbl->SetFloatVector(g_var, f); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
@@ -8905,7 +8905,7 @@ static void test_effect_value_expression(void) pass = t->lpVtbl->GetPassByName(t, "p6"); ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n");
- f[0] = 2.0f; f[1] = 3.0f; f[2] = 4.0f; f[3] = 5.0f; + set_vec4(f, 2.0f, 3.0f, 4.0f, 5.0f); hr = g_var->lpVtbl->SetFloatVector(g_var, f); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
@@ -8924,7 +8924,7 @@ static void test_effect_value_expression(void) pass = t->lpVtbl->GetPassByName(t, "p7"); ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n");
- f[0] = 0.0f; f[1] = 3.1f; f[2] = -4.2f; f[3] = 0.1f; + set_vec4(f, 0.0f, 3.1f, -4.2f, 0.1f); hr = g_var->lpVtbl->SetFloatVector(g_var, f); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
@@ -8941,31 +8941,31 @@ static void test_effect_value_expression(void) v = effect->lpVtbl->GetVariableByName(effect, "ds_state"); ds = v->lpVtbl->AsDepthStencil(v);
- f[0] = 1.0f; f[1] = 2.0f; f[2] = 3.0f; f[3] = 4.0f; + set_vec4(f, 1.0f, 2.0f, 3.0f, 4.0f); hr = g_var->lpVtbl->SetFloatVector(g_var, f); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ds->lpVtbl->GetBackingStore(ds, 0, &ds_desc); ok(ds_desc.StencilEnable == 0xffffffff, "Got unexpected StencilEnable %#x.\n", ds_desc.StencilEnable);
- f[0] = 0.0f; + set_vec4(f, 0.0f, 2.0f, 3.0f, 4.0f); hr = g_var->lpVtbl->SetFloatVector(g_var, f); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ds->lpVtbl->GetBackingStore(ds, 0, &ds_desc); ok(!ds_desc.StencilEnable, "Got unexpected StencilEnable %#x.\n", ds_desc.StencilEnable);
- f[0] = -0.1f; + set_vec4(f, -0.1f, 2.0f, 3.0f, 4.0f); hr = g_var->lpVtbl->SetFloatVector(g_var, f); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ds->lpVtbl->GetBackingStore(ds, 0, &ds_desc); ok(ds_desc.StencilEnable == 0xffffffff, "Got unexpected StencilEnable %#x.\n", ds_desc.StencilEnable);
- f[0] = 0.0f; + set_vec4(f, 0.0f, 2.0f, 3.0f, 4.0f); hr = g_var->lpVtbl->SetFloatVector(g_var, f); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ds->lpVtbl->GetBackingStore(ds, 0, &ds_desc); ok(!ds_desc.StencilEnable, "Got unexpected StencilEnable %#x.\n", ds_desc.StencilEnable);
- f[0] = NAN; + set_vec4(f, NAN, 2.0f, 3.0f, 4.0f); hr = g_var->lpVtbl->SetFloatVector(g_var, f); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ds->lpVtbl->GetBackingStore(ds, 0, &ds_desc); @@ -8975,8 +8975,7 @@ static void test_effect_value_expression(void) pass = t->lpVtbl->GetPassByName(t, "p8"); ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n");
- f[0] = -4.0f; - f[1] = -3.0f; + set_vec4(f, -4.0f, -3.0f, 3.0f, 4.0f); hr = g_var3->lpVtbl->SetFloatVector(g_var3, f); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
@@ -8993,8 +8992,7 @@ static void test_effect_value_expression(void) pass = t->lpVtbl->GetPassByName(t, "p9"); ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n");
- f[0] = 2.0f; - f[1] = 0.0f; + set_vec4(f, 2.0f, 0.0f, 3.0f, 4.0f); hr = g_var3->lpVtbl->SetFloatVector(g_var3, f); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
@@ -9011,9 +9009,7 @@ static void test_effect_value_expression(void) pass = t->lpVtbl->GetPassByName(t, "p10"); ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n");
- f[0] = 0.0f; - f[1] = 1.1f; - f[2] = 2.2f; + set_vec4(f, 0.0f, 1.1f, 2.2f, 4.0f); hr = g_var->lpVtbl->SetFloatVector(g_var, f); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
@@ -9026,9 +9022,7 @@ static void test_effect_value_expression(void) ok(blend_factor[idx] == 2.2f, "Got unexpected blend_factor[%u] %.8e.\n", idx, blend_factor[idx]); ok(!sample_mask, "Got unexpected sample_mask %#x.\n", sample_mask);
- f[0] = 0.1f; - f[1] = 0.1f; - f[2] = 0.2f; + set_vec4(f, 0.1f, 0.1f, 0.2f, 4.0f); hr = g_var->lpVtbl->SetFloatVector(g_var, f); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
@@ -9045,8 +9039,7 @@ static void test_effect_value_expression(void) pass = t->lpVtbl->GetPassByName(t, "p11"); ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n");
- i[0] = 3; - i[1] = 2; + set_int4(i, 3, 2, 0, 0); hr = g_var4->lpVtbl->SetIntVector(g_var4, i); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
@@ -9062,8 +9055,7 @@ static void test_effect_value_expression(void) pass = t->lpVtbl->GetPassByName(t, "p12"); ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n");
- i[0] = 2; - i[1] = 5; + set_int4(i, 2, 5, 0, 0); hr = g_var4->lpVtbl->SetIntVector(g_var4, i); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
@@ -9080,8 +9072,7 @@ static void test_effect_value_expression(void) pass = t->lpVtbl->GetPassByName(t, "p13"); ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n");
- i[0] = 3; - i[1] = 5; + set_int4(i, 3, 5, 0, 0); hr = g_var3->lpVtbl->SetIntVector(g_var3, i); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
@@ -9098,8 +9089,7 @@ static void test_effect_value_expression(void) pass = t->lpVtbl->GetPassByName(t, "p14"); ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n");
- i[0] = 3; - i[1] = 5; + set_int4(i, 3, 5, 0, 0); hr = g_var4->lpVtbl->SetIntVector(g_var4, i); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
@@ -9116,7 +9106,7 @@ static void test_effect_value_expression(void) pass = t->lpVtbl->GetPassByName(t, "p15"); ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n");
- f[0] = 0.1234567f; + set_vec4(f, 0.1234567f, 0.0f, 0.0f, 0.0f); hr = g_var->lpVtbl->SetFloatVector(g_var, f); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
@@ -9130,7 +9120,7 @@ static void test_effect_value_expression(void) pass = t->lpVtbl->GetPassByName(t, "p16"); ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n");
- f[0] = 0.1234567f; + set_vec4(f, 0.1234567f, 0.0f, 0.0f, 0.0f); hr = g_var->lpVtbl->SetFloatVector(g_var, f); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
@@ -9144,7 +9134,7 @@ static void test_effect_value_expression(void) pass = t->lpVtbl->GetPassByName(t, "p17"); ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n");
- f[0] = 0.1234567f; + set_vec4(f, 0.1234567f, 0.0f, 0.0f, 0.0f); hr = g_var->lpVtbl->SetFloatVector(g_var, f); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
@@ -9158,8 +9148,7 @@ static void test_effect_value_expression(void) pass = t->lpVtbl->GetPassByName(t, "p18"); ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n");
- f[0] = 0.1234567f; - f[1] = 0.7654321f; + set_vec4(f, 0.1234567f, 0.7654321f, 0.0f, 0.0f); hr = g_var->lpVtbl->SetFloatVector(g_var, f); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
@@ -9173,8 +9162,7 @@ static void test_effect_value_expression(void) pass = t->lpVtbl->GetPassByName(t, "p19"); ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n");
- i[0] = 10; - i[1] = 5; + set_int4(i, 10, 5, 0, 0); hr = g_var3->lpVtbl->SetIntVector(g_var3, i); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
@@ -9191,10 +9179,7 @@ static void test_effect_value_expression(void) pass = t->lpVtbl->GetPassByName(t, "p20"); ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n");
- i[0] = 1; - i[1] = 5; - i[2] = 6; - i[3] = 5; + set_int4(i, 1, 5, 6, 5); hr = g_var3->lpVtbl->SetIntVector(g_var3, i); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
@@ -9207,10 +9192,7 @@ static void test_effect_value_expression(void) ok(blend_factor[idx] == 1.0f, "Got unexpected blend_factor[%u] %.8e.\n", idx, blend_factor[idx]); ok(!sample_mask, "Got unexpected sample_mask %#x.\n", sample_mask);
- i[0] = 2; - i[1] = 1; - i[2] = 2; - i[3] = 5; + set_int4(i, 2, 1, 2, 5); hr = g_var3->lpVtbl->SetIntVector(g_var3, i); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
@@ -9227,10 +9209,7 @@ static void test_effect_value_expression(void) pass = t->lpVtbl->GetPassByName(t, "p21"); ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n");
- i[0] = 6; - i[1] = 5; - i[2] = 7; - i[3] = 1; + set_int4(i, 6, 5, 7, 1); hr = g_var4->lpVtbl->SetIntVector(g_var4, i); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
@@ -9243,10 +9222,7 @@ static void test_effect_value_expression(void) ok(blend_factor[idx] == 0.0f, "Got unexpected blend_factor[%u] %.8e.\n", idx, blend_factor[idx]); ok(!sample_mask, "Got unexpected sample_mask %#x.\n", sample_mask);
- i[0] = 2; - i[1] = 5; - i[2] = 7; - i[3] = 1; + set_int4(i, 2, 5, 7, 1); hr = g_var4->lpVtbl->SetIntVector(g_var4, i); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
From: Nikolay Sivov nsivov@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/effect.c | 10 +++ dlls/d3d10/tests/effect.c | 161 +++++++++++++++++++++++--------------- 2 files changed, 107 insertions(+), 64 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 46149433ec7..ed09b8095b6 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -288,6 +288,15 @@ static void pres_atan(float **args, unsigned int n, const struct preshader_instr retval[i] = atanf(args[0][i]); }
+static void pres_sqrt(float **args, unsigned int n, const struct preshader_instr *instr) +{ + float *retval = args[1]; + unsigned int i; + + for (i = 0; i < instr->comp_count; ++i) + retval[i] = sqrtf(args[0][i]); +} + static void pres_ineg(float **args, unsigned int n, const struct preshader_instr *instr) { int *arg1 = (int *)args[0]; @@ -680,6 +689,7 @@ static const struct preshader_op_info preshader_ops[] = { 0x10a, "asin", pres_asin }, { 0x10b, "acos", pres_acos }, { 0x10c, "atan", pres_atan }, + { 0x112, "sqrt", pres_sqrt }, { 0x120, "ineg", pres_ineg }, { 0x130, "itof", pres_itof }, { 0x131, "utof", pres_utof }, diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 5ce828ab889..bbdca0bcfd1 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -8308,13 +8308,17 @@ technique10 tech { SetBlendState( NULL, g_var3.x * g_var3.y, 0 ); } + pass p29 + { + SetBlendState( NULL, sqrt(g_var), 0 ); + } } #endif static DWORD fx_test_value_expression[] = { - 0x43425844, 0xd12394ba, 0xb7afc3da, 0x34982efa, 0xdb732fa2, 0x00000001, 0x00003b58, 0x00000001, - 0x00000024, 0x30315846, 0x00003b2c, 0xfeff1001, 0x00000001, 0x00000004, 0x00000001, 0x00000000, - 0x00000000, 0x00000000, 0x00000001, 0x00003358, 0x00000000, 0x00000000, 0x00000001, 0x00000000, + 0x43425844, 0x20d36331, 0x8fdc8786, 0x22a1fed5, 0x1a16e07d, 0x00000001, 0x00003ca0, 0x00000001, + 0x00000024, 0x30315846, 0x00003c74, 0xfeff1001, 0x00000001, 0x00000004, 0x00000001, 0x00000000, + 0x00000000, 0x00000000, 0x00000001, 0x00003464, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x6f6c4724, 0x736c6162, 0x6f6c6600, 0x00347461, 0x0000000d, 0x00000001, 0x00000000, 0x00000010, 0x00000010, 0x00000010, 0x0000210a, 0x61765f67, 0x5f670072, 0x32726176, 0x746e6900, 0x003d0034, 0x00010000, @@ -8726,67 +8730,77 @@ static DWORD fx_test_value_expression[] = 0x00000000, 0x00000004, 0x00000001, 0x13000001, 0x00000001, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000002, 0x13000001, 0x00000001, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000001, 0x00000002, - 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00000004, 0x00000040, 0x00000000, 0x00000004, - 0xffffffff, 0x00000000, 0x00000030, 0x00000014, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000036, 0x00000014, 0x00000000, 0x00000010, 0x00000000, 0x00000000, 0x00000000, - 0x0000005e, 0x00000042, 0x00000000, 0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000087, - 0x0000006b, 0x00000000, 0x00000030, 0x00000000, 0x00000000, 0x00000000, 0x000000bc, 0x000000a0, - 0x00000000, 0xffffffff, 0x00000001, 0x00000019, 0x00000000, 0x00000006, 0x000000c5, 0x00000000, - 0x000001b5, 0x0000001d, 0x00000000, 0x000001ba, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, - 0x00000006, 0x000001bd, 0x0000000b, 0x00000000, 0x00000001, 0x00000405, 0x00000002, 0x00000000, - 0x00000001, 0x00000411, 0x0000041d, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, - 0x00000420, 0x0000000b, 0x00000000, 0x00000001, 0x00000574, 0x00000002, 0x00000000, 0x00000001, - 0x00000580, 0x0000058c, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000058f, - 0x0000000b, 0x00000000, 0x00000001, 0x000007bf, 0x00000002, 0x00000000, 0x00000001, 0x000007cb, - 0x000007d7, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000007da, 0x0000000b, - 0x00000000, 0x00000001, 0x00000902, 0x00000002, 0x00000000, 0x00000001, 0x0000090e, 0x0000091a, - 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000091d, 0x0000000b, 0x00000000, - 0x00000001, 0x00000a45, 0x00000002, 0x00000000, 0x00000001, 0x00000a51, 0x00000a5d, 0x00000003, - 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000a60, 0x0000000b, 0x00000000, 0x00000001, - 0x00000b5c, 0x00000002, 0x00000000, 0x00000001, 0x00000b68, 0x00000b74, 0x00000003, 0x00000000, - 0x0000000a, 0x00000000, 0x00000006, 0x00000b77, 0x0000000b, 0x00000000, 0x00000001, 0x00000cc7, - 0x00000002, 0x00000000, 0x00000001, 0x00000cd3, 0x00000cdf, 0x00000003, 0x00000000, 0x0000000a, - 0x00000000, 0x00000006, 0x00000ce2, 0x0000000b, 0x00000000, 0x00000001, 0x00000dd2, 0x00000002, - 0x00000000, 0x00000001, 0x00000dde, 0x00000dea, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, - 0x00000006, 0x00000ded, 0x0000000b, 0x00000000, 0x00000001, 0x00000fe9, 0x00000002, 0x00000000, - 0x00000001, 0x00000ff5, 0x00001001, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, - 0x00001004, 0x0000000b, 0x00000000, 0x00000001, 0x00001180, 0x00000002, 0x00000000, 0x00000001, - 0x0000118c, 0x00001198, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000119c, - 0x0000000b, 0x00000000, 0x00000001, 0x0000136c, 0x00000002, 0x00000000, 0x00000001, 0x00001378, - 0x00001384, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001388, 0x0000000b, - 0x00000000, 0x00000001, 0x00001504, 0x00000002, 0x00000000, 0x00000001, 0x00001510, 0x0000151c, - 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001520, 0x0000000b, 0x00000000, - 0x00000001, 0x0000169c, 0x00000002, 0x00000000, 0x00000001, 0x000016a8, 0x000016b4, 0x00000003, - 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000016b8, 0x0000000b, 0x00000000, 0x00000001, - 0x00001834, 0x00000002, 0x00000000, 0x00000001, 0x00001840, 0x0000184c, 0x00000003, 0x00000000, - 0x0000000a, 0x00000000, 0x00000006, 0x00001850, 0x0000000b, 0x00000000, 0x00000001, 0x000019cc, - 0x00000002, 0x00000000, 0x00000001, 0x000019d8, 0x000019e4, 0x00000003, 0x00000000, 0x0000000a, - 0x00000000, 0x00000006, 0x000019e8, 0x0000000b, 0x00000000, 0x00000001, 0x00001b38, 0x00000002, - 0x00000000, 0x00000001, 0x00001b44, 0x00001b50, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, - 0x00000006, 0x00001b54, 0x0000000b, 0x00000000, 0x00000001, 0x00001ca4, 0x00000002, 0x00000000, - 0x00000001, 0x00001cb0, 0x00001cbc, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, - 0x00001cc0, 0x0000000b, 0x00000000, 0x00000001, 0x00001e10, 0x00000002, 0x00000000, 0x00000001, - 0x00001e1c, 0x00001e28, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001e2c, - 0x0000000b, 0x00000000, 0x00000001, 0x00001fac, 0x00000002, 0x00000000, 0x00000001, 0x00001fb8, - 0x00001fc4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001fc8, 0x0000000b, - 0x00000000, 0x00000001, 0x0000229c, 0x00000002, 0x00000000, 0x00000001, 0x000022a8, 0x000022b4, - 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000022b8, 0x0000000b, 0x00000000, - 0x00000001, 0x0000259c, 0x00000002, 0x00000000, 0x00000001, 0x000025a8, 0x000025b4, 0x00000003, - 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000025b8, 0x0000000b, 0x00000000, 0x00000001, - 0x00002808, 0x00000002, 0x00000000, 0x00000001, 0x00002814, 0x00002820, 0x00000003, 0x00000000, - 0x0000000a, 0x00000000, 0x00000006, 0x00002824, 0x0000000b, 0x00000000, 0x00000001, 0x00002914, - 0x00000002, 0x00000000, 0x00000001, 0x00002920, 0x0000292c, 0x00000003, 0x00000000, 0x0000000a, - 0x00000000, 0x00000006, 0x00002930, 0x0000000b, 0x00000000, 0x00000001, 0x00002a20, 0x00000002, - 0x00000000, 0x00000001, 0x00002a2c, 0x00002a38, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, - 0x00000006, 0x00002a3c, 0x0000000b, 0x00000000, 0x00000001, 0x00002be4, 0x00000002, 0x00000000, - 0x00000001, 0x00002bf0, 0x00002bfc, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, - 0x00002c00, 0x0000000b, 0x00000000, 0x00000001, 0x00002da8, 0x00000002, 0x00000000, 0x00000001, - 0x00002db4, 0x00002dc0, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002dc4, - 0x0000000b, 0x00000000, 0x00000001, 0x00002fb4, 0x00000002, 0x00000000, 0x00000001, 0x00002fc0, - 0x00002fcc, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002fd0, 0x0000000b, - 0x00000000, 0x00000001, 0x000031a8, 0x00000002, 0x00000000, 0x00000001, 0x000031b4, 0x000031c0, - 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000031c4, 0x0000000b, 0x00000000, - 0x00000001, 0x00003340, 0x00000002, 0x00000000, 0x00000001, 0x0000334c, + 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00393270, 0x000000ec, 0x43425844, 0xc5784377, + 0x16c9ce18, 0x67a07021, 0xb9eaebe9, 0x00000001, 0x000000ec, 0x00000003, 0x0000002c, 0x000000a8, + 0x000000b4, 0x42415443, 0x00000074, 0x0000001c, 0x0000004b, 0x46580400, 0x00000001, 0x0000001c, + 0x00000100, 0x00000048, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000000, 0x61765f67, + 0xabab0072, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, + 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x30312072, 0xab00312e, + 0x34494c43, 0x00000004, 0x00000000, 0x434c5846, 0x00000030, 0x00000001, 0x11200004, 0x00000001, + 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, + 0x0000ffff, 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00000004, + 0x00000040, 0x00000000, 0x00000004, 0xffffffff, 0x00000000, 0x00000030, 0x00000014, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000036, 0x00000014, 0x00000000, 0x00000010, + 0x00000000, 0x00000000, 0x00000000, 0x0000005e, 0x00000042, 0x00000000, 0x00000020, 0x00000000, + 0x00000000, 0x00000000, 0x00000087, 0x0000006b, 0x00000000, 0x00000030, 0x00000000, 0x00000000, + 0x00000000, 0x000000bc, 0x000000a0, 0x00000000, 0xffffffff, 0x00000001, 0x00000019, 0x00000000, + 0x00000006, 0x000000c5, 0x00000000, 0x000001b5, 0x0000001e, 0x00000000, 0x000001ba, 0x00000003, + 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000001bd, 0x0000000b, 0x00000000, 0x00000001, + 0x00000405, 0x00000002, 0x00000000, 0x00000001, 0x00000411, 0x0000041d, 0x00000003, 0x00000000, + 0x0000000a, 0x00000000, 0x00000006, 0x00000420, 0x0000000b, 0x00000000, 0x00000001, 0x00000574, + 0x00000002, 0x00000000, 0x00000001, 0x00000580, 0x0000058c, 0x00000003, 0x00000000, 0x0000000a, + 0x00000000, 0x00000006, 0x0000058f, 0x0000000b, 0x00000000, 0x00000001, 0x000007bf, 0x00000002, + 0x00000000, 0x00000001, 0x000007cb, 0x000007d7, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, + 0x00000006, 0x000007da, 0x0000000b, 0x00000000, 0x00000001, 0x00000902, 0x00000002, 0x00000000, + 0x00000001, 0x0000090e, 0x0000091a, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, + 0x0000091d, 0x0000000b, 0x00000000, 0x00000001, 0x00000a45, 0x00000002, 0x00000000, 0x00000001, + 0x00000a51, 0x00000a5d, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000a60, + 0x0000000b, 0x00000000, 0x00000001, 0x00000b5c, 0x00000002, 0x00000000, 0x00000001, 0x00000b68, + 0x00000b74, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000b77, 0x0000000b, + 0x00000000, 0x00000001, 0x00000cc7, 0x00000002, 0x00000000, 0x00000001, 0x00000cd3, 0x00000cdf, + 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000ce2, 0x0000000b, 0x00000000, + 0x00000001, 0x00000dd2, 0x00000002, 0x00000000, 0x00000001, 0x00000dde, 0x00000dea, 0x00000003, + 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000ded, 0x0000000b, 0x00000000, 0x00000001, + 0x00000fe9, 0x00000002, 0x00000000, 0x00000001, 0x00000ff5, 0x00001001, 0x00000003, 0x00000000, + 0x0000000a, 0x00000000, 0x00000006, 0x00001004, 0x0000000b, 0x00000000, 0x00000001, 0x00001180, + 0x00000002, 0x00000000, 0x00000001, 0x0000118c, 0x00001198, 0x00000003, 0x00000000, 0x0000000a, + 0x00000000, 0x00000006, 0x0000119c, 0x0000000b, 0x00000000, 0x00000001, 0x0000136c, 0x00000002, + 0x00000000, 0x00000001, 0x00001378, 0x00001384, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, + 0x00000006, 0x00001388, 0x0000000b, 0x00000000, 0x00000001, 0x00001504, 0x00000002, 0x00000000, + 0x00000001, 0x00001510, 0x0000151c, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, + 0x00001520, 0x0000000b, 0x00000000, 0x00000001, 0x0000169c, 0x00000002, 0x00000000, 0x00000001, + 0x000016a8, 0x000016b4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000016b8, + 0x0000000b, 0x00000000, 0x00000001, 0x00001834, 0x00000002, 0x00000000, 0x00000001, 0x00001840, + 0x0000184c, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001850, 0x0000000b, + 0x00000000, 0x00000001, 0x000019cc, 0x00000002, 0x00000000, 0x00000001, 0x000019d8, 0x000019e4, + 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000019e8, 0x0000000b, 0x00000000, + 0x00000001, 0x00001b38, 0x00000002, 0x00000000, 0x00000001, 0x00001b44, 0x00001b50, 0x00000003, + 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001b54, 0x0000000b, 0x00000000, 0x00000001, + 0x00001ca4, 0x00000002, 0x00000000, 0x00000001, 0x00001cb0, 0x00001cbc, 0x00000003, 0x00000000, + 0x0000000a, 0x00000000, 0x00000006, 0x00001cc0, 0x0000000b, 0x00000000, 0x00000001, 0x00001e10, + 0x00000002, 0x00000000, 0x00000001, 0x00001e1c, 0x00001e28, 0x00000003, 0x00000000, 0x0000000a, + 0x00000000, 0x00000006, 0x00001e2c, 0x0000000b, 0x00000000, 0x00000001, 0x00001fac, 0x00000002, + 0x00000000, 0x00000001, 0x00001fb8, 0x00001fc4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, + 0x00000006, 0x00001fc8, 0x0000000b, 0x00000000, 0x00000001, 0x0000229c, 0x00000002, 0x00000000, + 0x00000001, 0x000022a8, 0x000022b4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, + 0x000022b8, 0x0000000b, 0x00000000, 0x00000001, 0x0000259c, 0x00000002, 0x00000000, 0x00000001, + 0x000025a8, 0x000025b4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000025b8, + 0x0000000b, 0x00000000, 0x00000001, 0x00002808, 0x00000002, 0x00000000, 0x00000001, 0x00002814, + 0x00002820, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002824, 0x0000000b, + 0x00000000, 0x00000001, 0x00002914, 0x00000002, 0x00000000, 0x00000001, 0x00002920, 0x0000292c, + 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002930, 0x0000000b, 0x00000000, + 0x00000001, 0x00002a20, 0x00000002, 0x00000000, 0x00000001, 0x00002a2c, 0x00002a38, 0x00000003, + 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002a3c, 0x0000000b, 0x00000000, 0x00000001, + 0x00002be4, 0x00000002, 0x00000000, 0x00000001, 0x00002bf0, 0x00002bfc, 0x00000003, 0x00000000, + 0x0000000a, 0x00000000, 0x00000006, 0x00002c00, 0x0000000b, 0x00000000, 0x00000001, 0x00002da8, + 0x00000002, 0x00000000, 0x00000001, 0x00002db4, 0x00002dc0, 0x00000003, 0x00000000, 0x0000000a, + 0x00000000, 0x00000006, 0x00002dc4, 0x0000000b, 0x00000000, 0x00000001, 0x00002fb4, 0x00000002, + 0x00000000, 0x00000001, 0x00002fc0, 0x00002fcc, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, + 0x00000006, 0x00002fd0, 0x0000000b, 0x00000000, 0x00000001, 0x000031a8, 0x00000002, 0x00000000, + 0x00000001, 0x000031b4, 0x000031c0, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, + 0x000031c4, 0x0000000b, 0x00000000, 0x00000001, 0x00003340, 0x00000002, 0x00000000, 0x00000001, + 0x0000334c, 0x00003358, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000335c, + 0x0000000b, 0x00000000, 0x00000001, 0x0000344c, 0x00000002, 0x00000000, 0x00000001, 0x00003458, };
static float get_frc(float v) @@ -9444,6 +9458,25 @@ static void test_effect_value_expression(void) ok(blend_factor[idx] == -6.0f, "Got unexpected blend_factor[%u] %.8e.\n", idx, blend_factor[idx]); ok(!sample_mask, "Got unexpected sample_mask %#x.\n", sample_mask);
+ /* sqrt() */ + pass = t->lpVtbl->GetPassByName(t, "p29"); + ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n"); + + set_vec4(f, 4.0f, 0.0f, 1.0f, 64.0f); + hr = g_var->lpVtbl->SetFloatVector(g_var, f); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = pass->lpVtbl->Apply(pass, 0); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + ID3D10Device_OMGetBlendState(device, &blend_state, blend_factor, &sample_mask); + ok(!blend_state, "Unexpected blend state %p.\n", blend_state); + ok(blend_factor[0] == 2.0f, "Got unexpected blend_factor[0] %.8e.\n", blend_factor[0]); + ok(blend_factor[1] == 0.0f, "Got unexpected blend_factor[1] %.8e.\n", blend_factor[1]); + ok(blend_factor[2] == 1.0f, "Got unexpected blend_factor[2] %.8e.\n", blend_factor[2]); + ok(blend_factor[3] == 8.0f, "Got unexpected blend_factor[3] %.8e.\n", blend_factor[3]); + ok(!sample_mask, "Got unexpected sample_mask %#x.\n", sample_mask); + effect->lpVtbl->Release(effect);
refcount = ID3D10Device_Release(device);
From: Nikolay Sivov nsivov@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/effect.c | 10 +++ dlls/d3d10/tests/effect.c | 169 +++++++++++++++++++++++--------------- 2 files changed, 113 insertions(+), 66 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index ed09b8095b6..f409dae39cc 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -243,6 +243,15 @@ static void pres_frc(float **args, unsigned int n, const struct preshader_instr retval[i] = args[0][i] - floor(args[0][i]); }
+static void pres_rsq(float **args, unsigned int n, const struct preshader_instr *instr) +{ + float *retval = args[1]; + unsigned int i; + + for (i = 0; i < instr->comp_count; ++i) + retval[i] = 1.0f / sqrtf(args[0][i]); +} + static void pres_sin(float **args, unsigned int n, const struct preshader_instr *instr) { float *retval = args[1]; @@ -684,6 +693,7 @@ static const struct preshader_op_info preshader_ops[] = { 0x101, "neg", pres_neg }, { 0x103, "rcp", pres_rcp }, { 0x104, "frc", pres_frc }, + { 0x107, "rsq", pres_rsq }, { 0x108, "sin", pres_sin }, { 0x109, "cos", pres_cos }, { 0x10a, "asin", pres_asin }, diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index bbdca0bcfd1..3be40940873 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -8312,13 +8312,17 @@ technique10 tech { SetBlendState( NULL, sqrt(g_var), 0 ); } + pass p30 + { + SetBlendState( NULL, rsqrt(g_var), 0 ); + } } #endif static DWORD fx_test_value_expression[] = { - 0x43425844, 0x20d36331, 0x8fdc8786, 0x22a1fed5, 0x1a16e07d, 0x00000001, 0x00003ca0, 0x00000001, - 0x00000024, 0x30315846, 0x00003c74, 0xfeff1001, 0x00000001, 0x00000004, 0x00000001, 0x00000000, - 0x00000000, 0x00000000, 0x00000001, 0x00003464, 0x00000000, 0x00000000, 0x00000001, 0x00000000, + 0x43425844, 0xaab186c7, 0x133eb40a, 0x7e8c63f0, 0xd38ef6ac, 0x00000001, 0x00003e48, 0x00000001, + 0x00000024, 0x30315846, 0x00003e1c, 0xfeff1001, 0x00000001, 0x00000004, 0x00000001, 0x00000000, + 0x00000000, 0x00000000, 0x00000001, 0x000035d0, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x6f6c4724, 0x736c6162, 0x6f6c6600, 0x00347461, 0x0000000d, 0x00000001, 0x00000000, 0x00000010, 0x00000010, 0x00000010, 0x0000210a, 0x61765f67, 0x5f670072, 0x32726176, 0x746e6900, 0x003d0034, 0x00010000, @@ -8738,69 +8742,83 @@ static DWORD fx_test_value_expression[] = 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x30312072, 0xab00312e, 0x34494c43, 0x00000004, 0x00000000, 0x434c5846, 0x00000030, 0x00000001, 0x11200004, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, - 0x0000ffff, 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00000004, - 0x00000040, 0x00000000, 0x00000004, 0xffffffff, 0x00000000, 0x00000030, 0x00000014, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000036, 0x00000014, 0x00000000, 0x00000010, - 0x00000000, 0x00000000, 0x00000000, 0x0000005e, 0x00000042, 0x00000000, 0x00000020, 0x00000000, - 0x00000000, 0x00000000, 0x00000087, 0x0000006b, 0x00000000, 0x00000030, 0x00000000, 0x00000000, - 0x00000000, 0x000000bc, 0x000000a0, 0x00000000, 0xffffffff, 0x00000001, 0x00000019, 0x00000000, - 0x00000006, 0x000000c5, 0x00000000, 0x000001b5, 0x0000001e, 0x00000000, 0x000001ba, 0x00000003, - 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000001bd, 0x0000000b, 0x00000000, 0x00000001, - 0x00000405, 0x00000002, 0x00000000, 0x00000001, 0x00000411, 0x0000041d, 0x00000003, 0x00000000, - 0x0000000a, 0x00000000, 0x00000006, 0x00000420, 0x0000000b, 0x00000000, 0x00000001, 0x00000574, - 0x00000002, 0x00000000, 0x00000001, 0x00000580, 0x0000058c, 0x00000003, 0x00000000, 0x0000000a, - 0x00000000, 0x00000006, 0x0000058f, 0x0000000b, 0x00000000, 0x00000001, 0x000007bf, 0x00000002, - 0x00000000, 0x00000001, 0x000007cb, 0x000007d7, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, - 0x00000006, 0x000007da, 0x0000000b, 0x00000000, 0x00000001, 0x00000902, 0x00000002, 0x00000000, - 0x00000001, 0x0000090e, 0x0000091a, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, - 0x0000091d, 0x0000000b, 0x00000000, 0x00000001, 0x00000a45, 0x00000002, 0x00000000, 0x00000001, - 0x00000a51, 0x00000a5d, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000a60, - 0x0000000b, 0x00000000, 0x00000001, 0x00000b5c, 0x00000002, 0x00000000, 0x00000001, 0x00000b68, - 0x00000b74, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000b77, 0x0000000b, - 0x00000000, 0x00000001, 0x00000cc7, 0x00000002, 0x00000000, 0x00000001, 0x00000cd3, 0x00000cdf, - 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000ce2, 0x0000000b, 0x00000000, - 0x00000001, 0x00000dd2, 0x00000002, 0x00000000, 0x00000001, 0x00000dde, 0x00000dea, 0x00000003, - 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000ded, 0x0000000b, 0x00000000, 0x00000001, - 0x00000fe9, 0x00000002, 0x00000000, 0x00000001, 0x00000ff5, 0x00001001, 0x00000003, 0x00000000, - 0x0000000a, 0x00000000, 0x00000006, 0x00001004, 0x0000000b, 0x00000000, 0x00000001, 0x00001180, - 0x00000002, 0x00000000, 0x00000001, 0x0000118c, 0x00001198, 0x00000003, 0x00000000, 0x0000000a, - 0x00000000, 0x00000006, 0x0000119c, 0x0000000b, 0x00000000, 0x00000001, 0x0000136c, 0x00000002, - 0x00000000, 0x00000001, 0x00001378, 0x00001384, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, - 0x00000006, 0x00001388, 0x0000000b, 0x00000000, 0x00000001, 0x00001504, 0x00000002, 0x00000000, - 0x00000001, 0x00001510, 0x0000151c, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, - 0x00001520, 0x0000000b, 0x00000000, 0x00000001, 0x0000169c, 0x00000002, 0x00000000, 0x00000001, - 0x000016a8, 0x000016b4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000016b8, - 0x0000000b, 0x00000000, 0x00000001, 0x00001834, 0x00000002, 0x00000000, 0x00000001, 0x00001840, - 0x0000184c, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001850, 0x0000000b, - 0x00000000, 0x00000001, 0x000019cc, 0x00000002, 0x00000000, 0x00000001, 0x000019d8, 0x000019e4, - 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000019e8, 0x0000000b, 0x00000000, - 0x00000001, 0x00001b38, 0x00000002, 0x00000000, 0x00000001, 0x00001b44, 0x00001b50, 0x00000003, - 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001b54, 0x0000000b, 0x00000000, 0x00000001, - 0x00001ca4, 0x00000002, 0x00000000, 0x00000001, 0x00001cb0, 0x00001cbc, 0x00000003, 0x00000000, - 0x0000000a, 0x00000000, 0x00000006, 0x00001cc0, 0x0000000b, 0x00000000, 0x00000001, 0x00001e10, - 0x00000002, 0x00000000, 0x00000001, 0x00001e1c, 0x00001e28, 0x00000003, 0x00000000, 0x0000000a, - 0x00000000, 0x00000006, 0x00001e2c, 0x0000000b, 0x00000000, 0x00000001, 0x00001fac, 0x00000002, - 0x00000000, 0x00000001, 0x00001fb8, 0x00001fc4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, - 0x00000006, 0x00001fc8, 0x0000000b, 0x00000000, 0x00000001, 0x0000229c, 0x00000002, 0x00000000, - 0x00000001, 0x000022a8, 0x000022b4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, - 0x000022b8, 0x0000000b, 0x00000000, 0x00000001, 0x0000259c, 0x00000002, 0x00000000, 0x00000001, - 0x000025a8, 0x000025b4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000025b8, - 0x0000000b, 0x00000000, 0x00000001, 0x00002808, 0x00000002, 0x00000000, 0x00000001, 0x00002814, - 0x00002820, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002824, 0x0000000b, - 0x00000000, 0x00000001, 0x00002914, 0x00000002, 0x00000000, 0x00000001, 0x00002920, 0x0000292c, - 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002930, 0x0000000b, 0x00000000, - 0x00000001, 0x00002a20, 0x00000002, 0x00000000, 0x00000001, 0x00002a2c, 0x00002a38, 0x00000003, - 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002a3c, 0x0000000b, 0x00000000, 0x00000001, - 0x00002be4, 0x00000002, 0x00000000, 0x00000001, 0x00002bf0, 0x00002bfc, 0x00000003, 0x00000000, - 0x0000000a, 0x00000000, 0x00000006, 0x00002c00, 0x0000000b, 0x00000000, 0x00000001, 0x00002da8, - 0x00000002, 0x00000000, 0x00000001, 0x00002db4, 0x00002dc0, 0x00000003, 0x00000000, 0x0000000a, - 0x00000000, 0x00000006, 0x00002dc4, 0x0000000b, 0x00000000, 0x00000001, 0x00002fb4, 0x00000002, - 0x00000000, 0x00000001, 0x00002fc0, 0x00002fcc, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, - 0x00000006, 0x00002fd0, 0x0000000b, 0x00000000, 0x00000001, 0x000031a8, 0x00000002, 0x00000000, - 0x00000001, 0x000031b4, 0x000031c0, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, - 0x000031c4, 0x0000000b, 0x00000000, 0x00000001, 0x00003340, 0x00000002, 0x00000000, 0x00000001, - 0x0000334c, 0x00003358, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000335c, - 0x0000000b, 0x00000000, 0x00000001, 0x0000344c, 0x00000002, 0x00000000, 0x00000001, 0x00003458, + 0x0000ffff, 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00303370, + 0x0000014c, 0x43425844, 0x36d77f1e, 0xfb12f04e, 0x9c616c93, 0x0ab9004d, 0x00000001, 0x0000014c, + 0x00000003, 0x0000002c, 0x000000a8, 0x000000b4, 0x42415443, 0x00000074, 0x0000001c, 0x0000004b, + 0x46580400, 0x00000001, 0x0000001c, 0x00000100, 0x00000048, 0x00000030, 0x00000002, 0x00000001, + 0x00000038, 0x00000000, 0x61765f67, 0xabab0072, 0x00030001, 0x00040001, 0x00000001, 0x00000000, + 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, + 0x656c6970, 0x30312072, 0xab00312e, 0x34494c43, 0x00000004, 0x00000000, 0x434c5846, 0x00000090, + 0x00000004, 0x10700001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, + 0x00000000, 0x10700001, 0x00000001, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000004, + 0x00000001, 0x10700001, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004, + 0x00000002, 0x10700001, 0x00000001, 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000004, + 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000001, 0x00000002, 0x00000000, 0x00000001, + 0x00000002, 0x00000000, 0x00000004, 0x00000040, 0x00000000, 0x00000004, 0xffffffff, 0x00000000, + 0x00000030, 0x00000014, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000036, + 0x00000014, 0x00000000, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x0000005e, 0x00000042, + 0x00000000, 0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000087, 0x0000006b, 0x00000000, + 0x00000030, 0x00000000, 0x00000000, 0x00000000, 0x000000bc, 0x000000a0, 0x00000000, 0xffffffff, + 0x00000001, 0x00000019, 0x00000000, 0x00000006, 0x000000c5, 0x00000000, 0x000001b5, 0x0000001f, + 0x00000000, 0x000001ba, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000001bd, + 0x0000000b, 0x00000000, 0x00000001, 0x00000405, 0x00000002, 0x00000000, 0x00000001, 0x00000411, + 0x0000041d, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000420, 0x0000000b, + 0x00000000, 0x00000001, 0x00000574, 0x00000002, 0x00000000, 0x00000001, 0x00000580, 0x0000058c, + 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000058f, 0x0000000b, 0x00000000, + 0x00000001, 0x000007bf, 0x00000002, 0x00000000, 0x00000001, 0x000007cb, 0x000007d7, 0x00000003, + 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000007da, 0x0000000b, 0x00000000, 0x00000001, + 0x00000902, 0x00000002, 0x00000000, 0x00000001, 0x0000090e, 0x0000091a, 0x00000003, 0x00000000, + 0x0000000a, 0x00000000, 0x00000006, 0x0000091d, 0x0000000b, 0x00000000, 0x00000001, 0x00000a45, + 0x00000002, 0x00000000, 0x00000001, 0x00000a51, 0x00000a5d, 0x00000003, 0x00000000, 0x0000000a, + 0x00000000, 0x00000006, 0x00000a60, 0x0000000b, 0x00000000, 0x00000001, 0x00000b5c, 0x00000002, + 0x00000000, 0x00000001, 0x00000b68, 0x00000b74, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, + 0x00000006, 0x00000b77, 0x0000000b, 0x00000000, 0x00000001, 0x00000cc7, 0x00000002, 0x00000000, + 0x00000001, 0x00000cd3, 0x00000cdf, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, + 0x00000ce2, 0x0000000b, 0x00000000, 0x00000001, 0x00000dd2, 0x00000002, 0x00000000, 0x00000001, + 0x00000dde, 0x00000dea, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000ded, + 0x0000000b, 0x00000000, 0x00000001, 0x00000fe9, 0x00000002, 0x00000000, 0x00000001, 0x00000ff5, + 0x00001001, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001004, 0x0000000b, + 0x00000000, 0x00000001, 0x00001180, 0x00000002, 0x00000000, 0x00000001, 0x0000118c, 0x00001198, + 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000119c, 0x0000000b, 0x00000000, + 0x00000001, 0x0000136c, 0x00000002, 0x00000000, 0x00000001, 0x00001378, 0x00001384, 0x00000003, + 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001388, 0x0000000b, 0x00000000, 0x00000001, + 0x00001504, 0x00000002, 0x00000000, 0x00000001, 0x00001510, 0x0000151c, 0x00000003, 0x00000000, + 0x0000000a, 0x00000000, 0x00000006, 0x00001520, 0x0000000b, 0x00000000, 0x00000001, 0x0000169c, + 0x00000002, 0x00000000, 0x00000001, 0x000016a8, 0x000016b4, 0x00000003, 0x00000000, 0x0000000a, + 0x00000000, 0x00000006, 0x000016b8, 0x0000000b, 0x00000000, 0x00000001, 0x00001834, 0x00000002, + 0x00000000, 0x00000001, 0x00001840, 0x0000184c, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, + 0x00000006, 0x00001850, 0x0000000b, 0x00000000, 0x00000001, 0x000019cc, 0x00000002, 0x00000000, + 0x00000001, 0x000019d8, 0x000019e4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, + 0x000019e8, 0x0000000b, 0x00000000, 0x00000001, 0x00001b38, 0x00000002, 0x00000000, 0x00000001, + 0x00001b44, 0x00001b50, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001b54, + 0x0000000b, 0x00000000, 0x00000001, 0x00001ca4, 0x00000002, 0x00000000, 0x00000001, 0x00001cb0, + 0x00001cbc, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001cc0, 0x0000000b, + 0x00000000, 0x00000001, 0x00001e10, 0x00000002, 0x00000000, 0x00000001, 0x00001e1c, 0x00001e28, + 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001e2c, 0x0000000b, 0x00000000, + 0x00000001, 0x00001fac, 0x00000002, 0x00000000, 0x00000001, 0x00001fb8, 0x00001fc4, 0x00000003, + 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001fc8, 0x0000000b, 0x00000000, 0x00000001, + 0x0000229c, 0x00000002, 0x00000000, 0x00000001, 0x000022a8, 0x000022b4, 0x00000003, 0x00000000, + 0x0000000a, 0x00000000, 0x00000006, 0x000022b8, 0x0000000b, 0x00000000, 0x00000001, 0x0000259c, + 0x00000002, 0x00000000, 0x00000001, 0x000025a8, 0x000025b4, 0x00000003, 0x00000000, 0x0000000a, + 0x00000000, 0x00000006, 0x000025b8, 0x0000000b, 0x00000000, 0x00000001, 0x00002808, 0x00000002, + 0x00000000, 0x00000001, 0x00002814, 0x00002820, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, + 0x00000006, 0x00002824, 0x0000000b, 0x00000000, 0x00000001, 0x00002914, 0x00000002, 0x00000000, + 0x00000001, 0x00002920, 0x0000292c, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, + 0x00002930, 0x0000000b, 0x00000000, 0x00000001, 0x00002a20, 0x00000002, 0x00000000, 0x00000001, + 0x00002a2c, 0x00002a38, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002a3c, + 0x0000000b, 0x00000000, 0x00000001, 0x00002be4, 0x00000002, 0x00000000, 0x00000001, 0x00002bf0, + 0x00002bfc, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002c00, 0x0000000b, + 0x00000000, 0x00000001, 0x00002da8, 0x00000002, 0x00000000, 0x00000001, 0x00002db4, 0x00002dc0, + 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002dc4, 0x0000000b, 0x00000000, + 0x00000001, 0x00002fb4, 0x00000002, 0x00000000, 0x00000001, 0x00002fc0, 0x00002fcc, 0x00000003, + 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002fd0, 0x0000000b, 0x00000000, 0x00000001, + 0x000031a8, 0x00000002, 0x00000000, 0x00000001, 0x000031b4, 0x000031c0, 0x00000003, 0x00000000, + 0x0000000a, 0x00000000, 0x00000006, 0x000031c4, 0x0000000b, 0x00000000, 0x00000001, 0x00003340, + 0x00000002, 0x00000000, 0x00000001, 0x0000334c, 0x00003358, 0x00000003, 0x00000000, 0x0000000a, + 0x00000000, 0x00000006, 0x0000335c, 0x0000000b, 0x00000000, 0x00000001, 0x0000344c, 0x00000002, + 0x00000000, 0x00000001, 0x00003458, 0x00003464, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, + 0x00000006, 0x00003468, 0x0000000b, 0x00000000, 0x00000001, 0x000035b8, 0x00000002, 0x00000000, + 0x00000001, 0x000035c4, };
static float get_frc(float v) @@ -9477,6 +9495,25 @@ static void test_effect_value_expression(void) ok(blend_factor[3] == 8.0f, "Got unexpected blend_factor[3] %.8e.\n", blend_factor[3]); ok(!sample_mask, "Got unexpected sample_mask %#x.\n", sample_mask);
+ /* rsqrt() */ + pass = t->lpVtbl->GetPassByName(t, "p30"); + ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n"); + + set_vec4(f, 4.0f, 9.0f, 1.0f, 64.0f); + hr = g_var->lpVtbl->SetFloatVector(g_var, f); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = pass->lpVtbl->Apply(pass, 0); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + ID3D10Device_OMGetBlendState(device, &blend_state, blend_factor, &sample_mask); + ok(!blend_state, "Unexpected blend state %p.\n", blend_state); + ok(blend_factor[0] == 0.5f, "Got unexpected blend_factor[0] %.8e.\n", blend_factor[0]); + ok(blend_factor[1] == 1.0f / 3.0f, "Got unexpected blend_factor[1] %.8e.\n", blend_factor[1]); + ok(blend_factor[2] == 1.0f, "Got unexpected blend_factor[2] %.8e.\n", blend_factor[2]); + ok(blend_factor[3] == 0.125f, "Got unexpected blend_factor[3] %.8e.\n", blend_factor[3]); + ok(!sample_mask, "Got unexpected sample_mask %#x.\n", sample_mask); + effect->lpVtbl->Release(effect);
refcount = ID3D10Device_Release(device);
From: Nikolay Sivov nsivov@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/effect.c | 10 +++ dlls/d3d10/tests/effect.c | 174 +++++++++++++++++++++++--------------- 2 files changed, 116 insertions(+), 68 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index f409dae39cc..b847e21fb85 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -243,6 +243,15 @@ static void pres_frc(float **args, unsigned int n, const struct preshader_instr retval[i] = args[0][i] - floor(args[0][i]); }
+static void pres_log(float **args, unsigned int n, const struct preshader_instr *instr) +{ + float *retval = args[1]; + unsigned int i; + + for (i = 0; i < instr->comp_count; ++i) + retval[i] = (args[0][i] == 0.0f ? 0.0f : log2f(fabsf(args[0][i]))); +} + static void pres_rsq(float **args, unsigned int n, const struct preshader_instr *instr) { float *retval = args[1]; @@ -693,6 +702,7 @@ static const struct preshader_op_info preshader_ops[] = { 0x101, "neg", pres_neg }, { 0x103, "rcp", pres_rcp }, { 0x104, "frc", pres_frc }, + { 0x106, "log", pres_log }, { 0x107, "rsq", pres_rsq }, { 0x108, "sin", pres_sin }, { 0x109, "cos", pres_cos }, diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 3be40940873..0287a8b9eda 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -8316,13 +8316,17 @@ technique10 tech { SetBlendState( NULL, rsqrt(g_var), 0 ); } + pass p31 + { + SetBlendState( NULL, log(g_var), 0 ); + } } #endif static DWORD fx_test_value_expression[] = { - 0x43425844, 0xaab186c7, 0x133eb40a, 0x7e8c63f0, 0xd38ef6ac, 0x00000001, 0x00003e48, 0x00000001, - 0x00000024, 0x30315846, 0x00003e1c, 0xfeff1001, 0x00000001, 0x00000004, 0x00000001, 0x00000000, - 0x00000000, 0x00000000, 0x00000001, 0x000035d0, 0x00000000, 0x00000000, 0x00000001, 0x00000000, + 0x43425844, 0x67128dcb, 0x99bf8b86, 0xb43b8be1, 0x6e266d12, 0x00000001, 0x0000402c, 0x00000001, + 0x00000024, 0x30315846, 0x00004000, 0xfeff1001, 0x00000001, 0x00000004, 0x00000001, 0x00000000, + 0x00000000, 0x00000000, 0x00000001, 0x00003778, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x6f6c4724, 0x736c6162, 0x6f6c6600, 0x00347461, 0x0000000d, 0x00000001, 0x00000000, 0x00000010, 0x00000010, 0x00000010, 0x0000210a, 0x61765f67, 0x5f670072, 0x32726176, 0x746e6900, 0x003d0034, 0x00010000, @@ -8754,71 +8758,86 @@ static DWORD fx_test_value_expression[] = 0x00000001, 0x10700001, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004, 0x00000002, 0x10700001, 0x00000001, 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000001, 0x00000002, 0x00000000, 0x00000001, - 0x00000002, 0x00000000, 0x00000004, 0x00000040, 0x00000000, 0x00000004, 0xffffffff, 0x00000000, - 0x00000030, 0x00000014, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000036, - 0x00000014, 0x00000000, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x0000005e, 0x00000042, - 0x00000000, 0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000087, 0x0000006b, 0x00000000, - 0x00000030, 0x00000000, 0x00000000, 0x00000000, 0x000000bc, 0x000000a0, 0x00000000, 0xffffffff, - 0x00000001, 0x00000019, 0x00000000, 0x00000006, 0x000000c5, 0x00000000, 0x000001b5, 0x0000001f, - 0x00000000, 0x000001ba, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000001bd, - 0x0000000b, 0x00000000, 0x00000001, 0x00000405, 0x00000002, 0x00000000, 0x00000001, 0x00000411, - 0x0000041d, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000420, 0x0000000b, - 0x00000000, 0x00000001, 0x00000574, 0x00000002, 0x00000000, 0x00000001, 0x00000580, 0x0000058c, - 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000058f, 0x0000000b, 0x00000000, - 0x00000001, 0x000007bf, 0x00000002, 0x00000000, 0x00000001, 0x000007cb, 0x000007d7, 0x00000003, - 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000007da, 0x0000000b, 0x00000000, 0x00000001, - 0x00000902, 0x00000002, 0x00000000, 0x00000001, 0x0000090e, 0x0000091a, 0x00000003, 0x00000000, - 0x0000000a, 0x00000000, 0x00000006, 0x0000091d, 0x0000000b, 0x00000000, 0x00000001, 0x00000a45, - 0x00000002, 0x00000000, 0x00000001, 0x00000a51, 0x00000a5d, 0x00000003, 0x00000000, 0x0000000a, - 0x00000000, 0x00000006, 0x00000a60, 0x0000000b, 0x00000000, 0x00000001, 0x00000b5c, 0x00000002, - 0x00000000, 0x00000001, 0x00000b68, 0x00000b74, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, - 0x00000006, 0x00000b77, 0x0000000b, 0x00000000, 0x00000001, 0x00000cc7, 0x00000002, 0x00000000, - 0x00000001, 0x00000cd3, 0x00000cdf, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, - 0x00000ce2, 0x0000000b, 0x00000000, 0x00000001, 0x00000dd2, 0x00000002, 0x00000000, 0x00000001, - 0x00000dde, 0x00000dea, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000ded, - 0x0000000b, 0x00000000, 0x00000001, 0x00000fe9, 0x00000002, 0x00000000, 0x00000001, 0x00000ff5, - 0x00001001, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001004, 0x0000000b, - 0x00000000, 0x00000001, 0x00001180, 0x00000002, 0x00000000, 0x00000001, 0x0000118c, 0x00001198, - 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000119c, 0x0000000b, 0x00000000, - 0x00000001, 0x0000136c, 0x00000002, 0x00000000, 0x00000001, 0x00001378, 0x00001384, 0x00000003, - 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001388, 0x0000000b, 0x00000000, 0x00000001, - 0x00001504, 0x00000002, 0x00000000, 0x00000001, 0x00001510, 0x0000151c, 0x00000003, 0x00000000, - 0x0000000a, 0x00000000, 0x00000006, 0x00001520, 0x0000000b, 0x00000000, 0x00000001, 0x0000169c, - 0x00000002, 0x00000000, 0x00000001, 0x000016a8, 0x000016b4, 0x00000003, 0x00000000, 0x0000000a, - 0x00000000, 0x00000006, 0x000016b8, 0x0000000b, 0x00000000, 0x00000001, 0x00001834, 0x00000002, - 0x00000000, 0x00000001, 0x00001840, 0x0000184c, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, - 0x00000006, 0x00001850, 0x0000000b, 0x00000000, 0x00000001, 0x000019cc, 0x00000002, 0x00000000, - 0x00000001, 0x000019d8, 0x000019e4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, - 0x000019e8, 0x0000000b, 0x00000000, 0x00000001, 0x00001b38, 0x00000002, 0x00000000, 0x00000001, - 0x00001b44, 0x00001b50, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001b54, - 0x0000000b, 0x00000000, 0x00000001, 0x00001ca4, 0x00000002, 0x00000000, 0x00000001, 0x00001cb0, - 0x00001cbc, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001cc0, 0x0000000b, - 0x00000000, 0x00000001, 0x00001e10, 0x00000002, 0x00000000, 0x00000001, 0x00001e1c, 0x00001e28, - 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001e2c, 0x0000000b, 0x00000000, - 0x00000001, 0x00001fac, 0x00000002, 0x00000000, 0x00000001, 0x00001fb8, 0x00001fc4, 0x00000003, - 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001fc8, 0x0000000b, 0x00000000, 0x00000001, - 0x0000229c, 0x00000002, 0x00000000, 0x00000001, 0x000022a8, 0x000022b4, 0x00000003, 0x00000000, - 0x0000000a, 0x00000000, 0x00000006, 0x000022b8, 0x0000000b, 0x00000000, 0x00000001, 0x0000259c, - 0x00000002, 0x00000000, 0x00000001, 0x000025a8, 0x000025b4, 0x00000003, 0x00000000, 0x0000000a, - 0x00000000, 0x00000006, 0x000025b8, 0x0000000b, 0x00000000, 0x00000001, 0x00002808, 0x00000002, - 0x00000000, 0x00000001, 0x00002814, 0x00002820, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, - 0x00000006, 0x00002824, 0x0000000b, 0x00000000, 0x00000001, 0x00002914, 0x00000002, 0x00000000, - 0x00000001, 0x00002920, 0x0000292c, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, - 0x00002930, 0x0000000b, 0x00000000, 0x00000001, 0x00002a20, 0x00000002, 0x00000000, 0x00000001, - 0x00002a2c, 0x00002a38, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002a3c, - 0x0000000b, 0x00000000, 0x00000001, 0x00002be4, 0x00000002, 0x00000000, 0x00000001, 0x00002bf0, - 0x00002bfc, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002c00, 0x0000000b, - 0x00000000, 0x00000001, 0x00002da8, 0x00000002, 0x00000000, 0x00000001, 0x00002db4, 0x00002dc0, - 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002dc4, 0x0000000b, 0x00000000, - 0x00000001, 0x00002fb4, 0x00000002, 0x00000000, 0x00000001, 0x00002fc0, 0x00002fcc, 0x00000003, - 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002fd0, 0x0000000b, 0x00000000, 0x00000001, - 0x000031a8, 0x00000002, 0x00000000, 0x00000001, 0x000031b4, 0x000031c0, 0x00000003, 0x00000000, - 0x0000000a, 0x00000000, 0x00000006, 0x000031c4, 0x0000000b, 0x00000000, 0x00000001, 0x00003340, - 0x00000002, 0x00000000, 0x00000001, 0x0000334c, 0x00003358, 0x00000003, 0x00000000, 0x0000000a, - 0x00000000, 0x00000006, 0x0000335c, 0x0000000b, 0x00000000, 0x00000001, 0x0000344c, 0x00000002, - 0x00000000, 0x00000001, 0x00003458, 0x00003464, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, - 0x00000006, 0x00003468, 0x0000000b, 0x00000000, 0x00000001, 0x000035b8, 0x00000002, 0x00000000, - 0x00000001, 0x000035c4, + 0x00000002, 0x00000000, 0x00313370, 0x00000188, 0x43425844, 0xdadb15b4, 0x2d2e9c74, 0x5c105708, + 0x9218f7c5, 0x00000001, 0x00000188, 0x00000003, 0x0000002c, 0x000000a8, 0x000000c4, 0x42415443, + 0x00000074, 0x0000001c, 0x0000004b, 0x46580400, 0x00000001, 0x0000001c, 0x00000100, 0x00000048, + 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000000, 0x61765f67, 0xabab0072, 0x00030001, + 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, + 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x30312072, 0xab00312e, 0x34494c43, 0x00000014, + 0x00000004, 0x3f317218, 0x00000000, 0x00000000, 0x00000000, 0x434c5846, 0x000000bc, 0x00000005, + 0x10600001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000007, 0x00000000, + 0x10600001, 0x00000001, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000007, 0x00000001, + 0x10600001, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000007, 0x00000002, + 0x10600001, 0x00000001, 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000007, 0x00000003, + 0xa0500004, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000007, 0x00000000, + 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000001, 0x00000002, + 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00000004, 0x00000040, 0x00000000, 0x00000004, + 0xffffffff, 0x00000000, 0x00000030, 0x00000014, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000036, 0x00000014, 0x00000000, 0x00000010, 0x00000000, 0x00000000, 0x00000000, + 0x0000005e, 0x00000042, 0x00000000, 0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000087, + 0x0000006b, 0x00000000, 0x00000030, 0x00000000, 0x00000000, 0x00000000, 0x000000bc, 0x000000a0, + 0x00000000, 0xffffffff, 0x00000001, 0x00000019, 0x00000000, 0x00000006, 0x000000c5, 0x00000000, + 0x000001b5, 0x00000020, 0x00000000, 0x000001ba, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, + 0x00000006, 0x000001bd, 0x0000000b, 0x00000000, 0x00000001, 0x00000405, 0x00000002, 0x00000000, + 0x00000001, 0x00000411, 0x0000041d, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, + 0x00000420, 0x0000000b, 0x00000000, 0x00000001, 0x00000574, 0x00000002, 0x00000000, 0x00000001, + 0x00000580, 0x0000058c, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000058f, + 0x0000000b, 0x00000000, 0x00000001, 0x000007bf, 0x00000002, 0x00000000, 0x00000001, 0x000007cb, + 0x000007d7, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000007da, 0x0000000b, + 0x00000000, 0x00000001, 0x00000902, 0x00000002, 0x00000000, 0x00000001, 0x0000090e, 0x0000091a, + 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000091d, 0x0000000b, 0x00000000, + 0x00000001, 0x00000a45, 0x00000002, 0x00000000, 0x00000001, 0x00000a51, 0x00000a5d, 0x00000003, + 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000a60, 0x0000000b, 0x00000000, 0x00000001, + 0x00000b5c, 0x00000002, 0x00000000, 0x00000001, 0x00000b68, 0x00000b74, 0x00000003, 0x00000000, + 0x0000000a, 0x00000000, 0x00000006, 0x00000b77, 0x0000000b, 0x00000000, 0x00000001, 0x00000cc7, + 0x00000002, 0x00000000, 0x00000001, 0x00000cd3, 0x00000cdf, 0x00000003, 0x00000000, 0x0000000a, + 0x00000000, 0x00000006, 0x00000ce2, 0x0000000b, 0x00000000, 0x00000001, 0x00000dd2, 0x00000002, + 0x00000000, 0x00000001, 0x00000dde, 0x00000dea, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, + 0x00000006, 0x00000ded, 0x0000000b, 0x00000000, 0x00000001, 0x00000fe9, 0x00000002, 0x00000000, + 0x00000001, 0x00000ff5, 0x00001001, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, + 0x00001004, 0x0000000b, 0x00000000, 0x00000001, 0x00001180, 0x00000002, 0x00000000, 0x00000001, + 0x0000118c, 0x00001198, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000119c, + 0x0000000b, 0x00000000, 0x00000001, 0x0000136c, 0x00000002, 0x00000000, 0x00000001, 0x00001378, + 0x00001384, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001388, 0x0000000b, + 0x00000000, 0x00000001, 0x00001504, 0x00000002, 0x00000000, 0x00000001, 0x00001510, 0x0000151c, + 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001520, 0x0000000b, 0x00000000, + 0x00000001, 0x0000169c, 0x00000002, 0x00000000, 0x00000001, 0x000016a8, 0x000016b4, 0x00000003, + 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000016b8, 0x0000000b, 0x00000000, 0x00000001, + 0x00001834, 0x00000002, 0x00000000, 0x00000001, 0x00001840, 0x0000184c, 0x00000003, 0x00000000, + 0x0000000a, 0x00000000, 0x00000006, 0x00001850, 0x0000000b, 0x00000000, 0x00000001, 0x000019cc, + 0x00000002, 0x00000000, 0x00000001, 0x000019d8, 0x000019e4, 0x00000003, 0x00000000, 0x0000000a, + 0x00000000, 0x00000006, 0x000019e8, 0x0000000b, 0x00000000, 0x00000001, 0x00001b38, 0x00000002, + 0x00000000, 0x00000001, 0x00001b44, 0x00001b50, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, + 0x00000006, 0x00001b54, 0x0000000b, 0x00000000, 0x00000001, 0x00001ca4, 0x00000002, 0x00000000, + 0x00000001, 0x00001cb0, 0x00001cbc, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, + 0x00001cc0, 0x0000000b, 0x00000000, 0x00000001, 0x00001e10, 0x00000002, 0x00000000, 0x00000001, + 0x00001e1c, 0x00001e28, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001e2c, + 0x0000000b, 0x00000000, 0x00000001, 0x00001fac, 0x00000002, 0x00000000, 0x00000001, 0x00001fb8, + 0x00001fc4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001fc8, 0x0000000b, + 0x00000000, 0x00000001, 0x0000229c, 0x00000002, 0x00000000, 0x00000001, 0x000022a8, 0x000022b4, + 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000022b8, 0x0000000b, 0x00000000, + 0x00000001, 0x0000259c, 0x00000002, 0x00000000, 0x00000001, 0x000025a8, 0x000025b4, 0x00000003, + 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000025b8, 0x0000000b, 0x00000000, 0x00000001, + 0x00002808, 0x00000002, 0x00000000, 0x00000001, 0x00002814, 0x00002820, 0x00000003, 0x00000000, + 0x0000000a, 0x00000000, 0x00000006, 0x00002824, 0x0000000b, 0x00000000, 0x00000001, 0x00002914, + 0x00000002, 0x00000000, 0x00000001, 0x00002920, 0x0000292c, 0x00000003, 0x00000000, 0x0000000a, + 0x00000000, 0x00000006, 0x00002930, 0x0000000b, 0x00000000, 0x00000001, 0x00002a20, 0x00000002, + 0x00000000, 0x00000001, 0x00002a2c, 0x00002a38, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, + 0x00000006, 0x00002a3c, 0x0000000b, 0x00000000, 0x00000001, 0x00002be4, 0x00000002, 0x00000000, + 0x00000001, 0x00002bf0, 0x00002bfc, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, + 0x00002c00, 0x0000000b, 0x00000000, 0x00000001, 0x00002da8, 0x00000002, 0x00000000, 0x00000001, + 0x00002db4, 0x00002dc0, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002dc4, + 0x0000000b, 0x00000000, 0x00000001, 0x00002fb4, 0x00000002, 0x00000000, 0x00000001, 0x00002fc0, + 0x00002fcc, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002fd0, 0x0000000b, + 0x00000000, 0x00000001, 0x000031a8, 0x00000002, 0x00000000, 0x00000001, 0x000031b4, 0x000031c0, + 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000031c4, 0x0000000b, 0x00000000, + 0x00000001, 0x00003340, 0x00000002, 0x00000000, 0x00000001, 0x0000334c, 0x00003358, 0x00000003, + 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000335c, 0x0000000b, 0x00000000, 0x00000001, + 0x0000344c, 0x00000002, 0x00000000, 0x00000001, 0x00003458, 0x00003464, 0x00000003, 0x00000000, + 0x0000000a, 0x00000000, 0x00000006, 0x00003468, 0x0000000b, 0x00000000, 0x00000001, 0x000035b8, + 0x00000002, 0x00000000, 0x00000001, 0x000035c4, 0x000035d0, 0x00000003, 0x00000000, 0x0000000a, + 0x00000000, 0x00000006, 0x000035d4, 0x0000000b, 0x00000000, 0x00000001, 0x00003760, 0x00000002, + 0x00000000, 0x00000001, 0x0000376c, };
static float get_frc(float v) @@ -9514,6 +9533,25 @@ static void test_effect_value_expression(void) ok(blend_factor[3] == 0.125f, "Got unexpected blend_factor[3] %.8e.\n", blend_factor[3]); ok(!sample_mask, "Got unexpected sample_mask %#x.\n", sample_mask);
+ /* log() */ + pass = t->lpVtbl->GetPassByName(t, "p31"); + ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n"); + + set_vec4(f, 4.0f, 9.0f, 0.0f, -2.0f); + hr = g_var->lpVtbl->SetFloatVector(g_var, f); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = pass->lpVtbl->Apply(pass, 0); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + ID3D10Device_OMGetBlendState(device, &blend_state, blend_factor, &sample_mask); + ok(!blend_state, "Unexpected blend state %p.\n", blend_state); + ok(blend_factor[0] == logf(fabsf(f[0])), "Got unexpected blend_factor %.8e.\n", blend_factor[0]); + ok(blend_factor[1] == logf(fabsf(f[1])), "Got unexpected blend_factor %.8e.\n", blend_factor[1]); + ok(blend_factor[2] == 0.0f, "Got unexpected blend_factor %.8e.\n", blend_factor[2]); + ok(blend_factor[3] == logf(fabsf(f[3])), "Got unexpected blend_factor %.8e.\n", blend_factor[3]); + ok(!sample_mask, "Got unexpected sample_mask %#x.\n", sample_mask); + effect->lpVtbl->Release(effect);
refcount = ID3D10Device_Release(device);
From: Nikolay Sivov nsivov@codeweavers.com
--- dlls/d3d10/effect.c | 10 +++ dlls/d3d10/tests/effect.c | 176 +++++++++++++++++++++++--------------- 2 files changed, 116 insertions(+), 70 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index b847e21fb85..fbe9e696d2f 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -243,6 +243,15 @@ static void pres_frc(float **args, unsigned int n, const struct preshader_instr retval[i] = args[0][i] - floor(args[0][i]); }
+static void pres_exp(float **args, unsigned int n, const struct preshader_instr *instr) +{ + float *retval = args[1]; + unsigned int i; + + for (i = 0; i < instr->comp_count; ++i) + retval[i] = exp2f(args[0][i]); +} + static void pres_log(float **args, unsigned int n, const struct preshader_instr *instr) { float *retval = args[1]; @@ -702,6 +711,7 @@ static const struct preshader_op_info preshader_ops[] = { 0x101, "neg", pres_neg }, { 0x103, "rcp", pres_rcp }, { 0x104, "frc", pres_frc }, + { 0x105, "exp", pres_exp }, { 0x106, "log", pres_log }, { 0x107, "rsq", pres_rsq }, { 0x108, "sin", pres_sin }, diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 0287a8b9eda..24c18a362d2 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -8320,13 +8320,17 @@ technique10 tech { SetBlendState( NULL, log(g_var), 0 ); } + pass p32 + { + SetBlendState( NULL, exp(g_var), 0 ); + } } #endif static DWORD fx_test_value_expression[] = { - 0x43425844, 0x67128dcb, 0x99bf8b86, 0xb43b8be1, 0x6e266d12, 0x00000001, 0x0000402c, 0x00000001, - 0x00000024, 0x30315846, 0x00004000, 0xfeff1001, 0x00000001, 0x00000004, 0x00000001, 0x00000000, - 0x00000000, 0x00000000, 0x00000001, 0x00003778, 0x00000000, 0x00000000, 0x00000001, 0x00000000, + 0x43425844, 0x3539c704, 0x7d82909b, 0x0664cb0e, 0xe49dda4a, 0x00000001, 0x00004210, 0x00000001, + 0x00000024, 0x30315846, 0x000041e4, 0xfeff1001, 0x00000001, 0x00000004, 0x00000001, 0x00000000, + 0x00000000, 0x00000000, 0x00000001, 0x00003920, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x6f6c4724, 0x736c6162, 0x6f6c6600, 0x00347461, 0x0000000d, 0x00000001, 0x00000000, 0x00000010, 0x00000010, 0x00000010, 0x0000210a, 0x61765f67, 0x5f670072, 0x32726176, 0x746e6900, 0x003d0034, 0x00010000, @@ -8771,73 +8775,88 @@ static DWORD fx_test_value_expression[] = 0x10600001, 0x00000001, 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000007, 0x00000003, 0xa0500004, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000001, 0x00000002, - 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00000004, 0x00000040, 0x00000000, 0x00000004, - 0xffffffff, 0x00000000, 0x00000030, 0x00000014, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000036, 0x00000014, 0x00000000, 0x00000010, 0x00000000, 0x00000000, 0x00000000, - 0x0000005e, 0x00000042, 0x00000000, 0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000087, - 0x0000006b, 0x00000000, 0x00000030, 0x00000000, 0x00000000, 0x00000000, 0x000000bc, 0x000000a0, - 0x00000000, 0xffffffff, 0x00000001, 0x00000019, 0x00000000, 0x00000006, 0x000000c5, 0x00000000, - 0x000001b5, 0x00000020, 0x00000000, 0x000001ba, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, - 0x00000006, 0x000001bd, 0x0000000b, 0x00000000, 0x00000001, 0x00000405, 0x00000002, 0x00000000, - 0x00000001, 0x00000411, 0x0000041d, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, - 0x00000420, 0x0000000b, 0x00000000, 0x00000001, 0x00000574, 0x00000002, 0x00000000, 0x00000001, - 0x00000580, 0x0000058c, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000058f, - 0x0000000b, 0x00000000, 0x00000001, 0x000007bf, 0x00000002, 0x00000000, 0x00000001, 0x000007cb, - 0x000007d7, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000007da, 0x0000000b, - 0x00000000, 0x00000001, 0x00000902, 0x00000002, 0x00000000, 0x00000001, 0x0000090e, 0x0000091a, - 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000091d, 0x0000000b, 0x00000000, - 0x00000001, 0x00000a45, 0x00000002, 0x00000000, 0x00000001, 0x00000a51, 0x00000a5d, 0x00000003, - 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000a60, 0x0000000b, 0x00000000, 0x00000001, - 0x00000b5c, 0x00000002, 0x00000000, 0x00000001, 0x00000b68, 0x00000b74, 0x00000003, 0x00000000, - 0x0000000a, 0x00000000, 0x00000006, 0x00000b77, 0x0000000b, 0x00000000, 0x00000001, 0x00000cc7, - 0x00000002, 0x00000000, 0x00000001, 0x00000cd3, 0x00000cdf, 0x00000003, 0x00000000, 0x0000000a, - 0x00000000, 0x00000006, 0x00000ce2, 0x0000000b, 0x00000000, 0x00000001, 0x00000dd2, 0x00000002, - 0x00000000, 0x00000001, 0x00000dde, 0x00000dea, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, - 0x00000006, 0x00000ded, 0x0000000b, 0x00000000, 0x00000001, 0x00000fe9, 0x00000002, 0x00000000, - 0x00000001, 0x00000ff5, 0x00001001, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, - 0x00001004, 0x0000000b, 0x00000000, 0x00000001, 0x00001180, 0x00000002, 0x00000000, 0x00000001, - 0x0000118c, 0x00001198, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000119c, - 0x0000000b, 0x00000000, 0x00000001, 0x0000136c, 0x00000002, 0x00000000, 0x00000001, 0x00001378, - 0x00001384, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001388, 0x0000000b, - 0x00000000, 0x00000001, 0x00001504, 0x00000002, 0x00000000, 0x00000001, 0x00001510, 0x0000151c, - 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001520, 0x0000000b, 0x00000000, - 0x00000001, 0x0000169c, 0x00000002, 0x00000000, 0x00000001, 0x000016a8, 0x000016b4, 0x00000003, - 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000016b8, 0x0000000b, 0x00000000, 0x00000001, - 0x00001834, 0x00000002, 0x00000000, 0x00000001, 0x00001840, 0x0000184c, 0x00000003, 0x00000000, - 0x0000000a, 0x00000000, 0x00000006, 0x00001850, 0x0000000b, 0x00000000, 0x00000001, 0x000019cc, - 0x00000002, 0x00000000, 0x00000001, 0x000019d8, 0x000019e4, 0x00000003, 0x00000000, 0x0000000a, - 0x00000000, 0x00000006, 0x000019e8, 0x0000000b, 0x00000000, 0x00000001, 0x00001b38, 0x00000002, - 0x00000000, 0x00000001, 0x00001b44, 0x00001b50, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, - 0x00000006, 0x00001b54, 0x0000000b, 0x00000000, 0x00000001, 0x00001ca4, 0x00000002, 0x00000000, - 0x00000001, 0x00001cb0, 0x00001cbc, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, - 0x00001cc0, 0x0000000b, 0x00000000, 0x00000001, 0x00001e10, 0x00000002, 0x00000000, 0x00000001, - 0x00001e1c, 0x00001e28, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001e2c, - 0x0000000b, 0x00000000, 0x00000001, 0x00001fac, 0x00000002, 0x00000000, 0x00000001, 0x00001fb8, - 0x00001fc4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001fc8, 0x0000000b, - 0x00000000, 0x00000001, 0x0000229c, 0x00000002, 0x00000000, 0x00000001, 0x000022a8, 0x000022b4, - 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000022b8, 0x0000000b, 0x00000000, - 0x00000001, 0x0000259c, 0x00000002, 0x00000000, 0x00000001, 0x000025a8, 0x000025b4, 0x00000003, - 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000025b8, 0x0000000b, 0x00000000, 0x00000001, - 0x00002808, 0x00000002, 0x00000000, 0x00000001, 0x00002814, 0x00002820, 0x00000003, 0x00000000, - 0x0000000a, 0x00000000, 0x00000006, 0x00002824, 0x0000000b, 0x00000000, 0x00000001, 0x00002914, - 0x00000002, 0x00000000, 0x00000001, 0x00002920, 0x0000292c, 0x00000003, 0x00000000, 0x0000000a, - 0x00000000, 0x00000006, 0x00002930, 0x0000000b, 0x00000000, 0x00000001, 0x00002a20, 0x00000002, - 0x00000000, 0x00000001, 0x00002a2c, 0x00002a38, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, - 0x00000006, 0x00002a3c, 0x0000000b, 0x00000000, 0x00000001, 0x00002be4, 0x00000002, 0x00000000, - 0x00000001, 0x00002bf0, 0x00002bfc, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, - 0x00002c00, 0x0000000b, 0x00000000, 0x00000001, 0x00002da8, 0x00000002, 0x00000000, 0x00000001, - 0x00002db4, 0x00002dc0, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002dc4, - 0x0000000b, 0x00000000, 0x00000001, 0x00002fb4, 0x00000002, 0x00000000, 0x00000001, 0x00002fc0, - 0x00002fcc, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002fd0, 0x0000000b, - 0x00000000, 0x00000001, 0x000031a8, 0x00000002, 0x00000000, 0x00000001, 0x000031b4, 0x000031c0, - 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000031c4, 0x0000000b, 0x00000000, - 0x00000001, 0x00003340, 0x00000002, 0x00000000, 0x00000001, 0x0000334c, 0x00003358, 0x00000003, - 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000335c, 0x0000000b, 0x00000000, 0x00000001, - 0x0000344c, 0x00000002, 0x00000000, 0x00000001, 0x00003458, 0x00003464, 0x00000003, 0x00000000, - 0x0000000a, 0x00000000, 0x00000006, 0x00003468, 0x0000000b, 0x00000000, 0x00000001, 0x000035b8, - 0x00000002, 0x00000000, 0x00000001, 0x000035c4, 0x000035d0, 0x00000003, 0x00000000, 0x0000000a, - 0x00000000, 0x00000006, 0x000035d4, 0x0000000b, 0x00000000, 0x00000001, 0x00003760, 0x00000002, - 0x00000000, 0x00000001, 0x0000376c, + 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00323370, 0x00000188, 0x43425844, 0xcc3b2c7b, + 0x0ab3141b, 0xea88d5b8, 0x99b314cc, 0x00000001, 0x00000188, 0x00000003, 0x0000002c, 0x000000a8, + 0x000000c4, 0x42415443, 0x00000074, 0x0000001c, 0x0000004b, 0x46580400, 0x00000001, 0x0000001c, + 0x00000100, 0x00000048, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000000, 0x61765f67, + 0xabab0072, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, + 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x30312072, 0xab00312e, + 0x34494c43, 0x00000014, 0x00000004, 0x3fb8aa3b, 0x00000000, 0x00000000, 0x00000000, 0x434c5846, + 0x000000bc, 0x00000005, 0xa0500004, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, + 0x00000002, 0x00000000, 0x00000000, 0x00000007, 0x00000000, 0x10500001, 0x00000001, 0x00000000, + 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x10500001, 0x00000001, 0x00000000, + 0x00000007, 0x00000001, 0x00000000, 0x00000004, 0x00000001, 0x10500001, 0x00000001, 0x00000000, + 0x00000007, 0x00000002, 0x00000000, 0x00000004, 0x00000002, 0x10500001, 0x00000001, 0x00000000, + 0x00000007, 0x00000003, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, + 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00000004, 0x00000040, + 0x00000000, 0x00000004, 0xffffffff, 0x00000000, 0x00000030, 0x00000014, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000036, 0x00000014, 0x00000000, 0x00000010, 0x00000000, + 0x00000000, 0x00000000, 0x0000005e, 0x00000042, 0x00000000, 0x00000020, 0x00000000, 0x00000000, + 0x00000000, 0x00000087, 0x0000006b, 0x00000000, 0x00000030, 0x00000000, 0x00000000, 0x00000000, + 0x000000bc, 0x000000a0, 0x00000000, 0xffffffff, 0x00000001, 0x00000019, 0x00000000, 0x00000006, + 0x000000c5, 0x00000000, 0x000001b5, 0x00000021, 0x00000000, 0x000001ba, 0x00000003, 0x00000000, + 0x0000000a, 0x00000000, 0x00000006, 0x000001bd, 0x0000000b, 0x00000000, 0x00000001, 0x00000405, + 0x00000002, 0x00000000, 0x00000001, 0x00000411, 0x0000041d, 0x00000003, 0x00000000, 0x0000000a, + 0x00000000, 0x00000006, 0x00000420, 0x0000000b, 0x00000000, 0x00000001, 0x00000574, 0x00000002, + 0x00000000, 0x00000001, 0x00000580, 0x0000058c, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, + 0x00000006, 0x0000058f, 0x0000000b, 0x00000000, 0x00000001, 0x000007bf, 0x00000002, 0x00000000, + 0x00000001, 0x000007cb, 0x000007d7, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, + 0x000007da, 0x0000000b, 0x00000000, 0x00000001, 0x00000902, 0x00000002, 0x00000000, 0x00000001, + 0x0000090e, 0x0000091a, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000091d, + 0x0000000b, 0x00000000, 0x00000001, 0x00000a45, 0x00000002, 0x00000000, 0x00000001, 0x00000a51, + 0x00000a5d, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000a60, 0x0000000b, + 0x00000000, 0x00000001, 0x00000b5c, 0x00000002, 0x00000000, 0x00000001, 0x00000b68, 0x00000b74, + 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000b77, 0x0000000b, 0x00000000, + 0x00000001, 0x00000cc7, 0x00000002, 0x00000000, 0x00000001, 0x00000cd3, 0x00000cdf, 0x00000003, + 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000ce2, 0x0000000b, 0x00000000, 0x00000001, + 0x00000dd2, 0x00000002, 0x00000000, 0x00000001, 0x00000dde, 0x00000dea, 0x00000003, 0x00000000, + 0x0000000a, 0x00000000, 0x00000006, 0x00000ded, 0x0000000b, 0x00000000, 0x00000001, 0x00000fe9, + 0x00000002, 0x00000000, 0x00000001, 0x00000ff5, 0x00001001, 0x00000003, 0x00000000, 0x0000000a, + 0x00000000, 0x00000006, 0x00001004, 0x0000000b, 0x00000000, 0x00000001, 0x00001180, 0x00000002, + 0x00000000, 0x00000001, 0x0000118c, 0x00001198, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, + 0x00000006, 0x0000119c, 0x0000000b, 0x00000000, 0x00000001, 0x0000136c, 0x00000002, 0x00000000, + 0x00000001, 0x00001378, 0x00001384, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, + 0x00001388, 0x0000000b, 0x00000000, 0x00000001, 0x00001504, 0x00000002, 0x00000000, 0x00000001, + 0x00001510, 0x0000151c, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001520, + 0x0000000b, 0x00000000, 0x00000001, 0x0000169c, 0x00000002, 0x00000000, 0x00000001, 0x000016a8, + 0x000016b4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000016b8, 0x0000000b, + 0x00000000, 0x00000001, 0x00001834, 0x00000002, 0x00000000, 0x00000001, 0x00001840, 0x0000184c, + 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001850, 0x0000000b, 0x00000000, + 0x00000001, 0x000019cc, 0x00000002, 0x00000000, 0x00000001, 0x000019d8, 0x000019e4, 0x00000003, + 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000019e8, 0x0000000b, 0x00000000, 0x00000001, + 0x00001b38, 0x00000002, 0x00000000, 0x00000001, 0x00001b44, 0x00001b50, 0x00000003, 0x00000000, + 0x0000000a, 0x00000000, 0x00000006, 0x00001b54, 0x0000000b, 0x00000000, 0x00000001, 0x00001ca4, + 0x00000002, 0x00000000, 0x00000001, 0x00001cb0, 0x00001cbc, 0x00000003, 0x00000000, 0x0000000a, + 0x00000000, 0x00000006, 0x00001cc0, 0x0000000b, 0x00000000, 0x00000001, 0x00001e10, 0x00000002, + 0x00000000, 0x00000001, 0x00001e1c, 0x00001e28, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, + 0x00000006, 0x00001e2c, 0x0000000b, 0x00000000, 0x00000001, 0x00001fac, 0x00000002, 0x00000000, + 0x00000001, 0x00001fb8, 0x00001fc4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, + 0x00001fc8, 0x0000000b, 0x00000000, 0x00000001, 0x0000229c, 0x00000002, 0x00000000, 0x00000001, + 0x000022a8, 0x000022b4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000022b8, + 0x0000000b, 0x00000000, 0x00000001, 0x0000259c, 0x00000002, 0x00000000, 0x00000001, 0x000025a8, + 0x000025b4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000025b8, 0x0000000b, + 0x00000000, 0x00000001, 0x00002808, 0x00000002, 0x00000000, 0x00000001, 0x00002814, 0x00002820, + 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002824, 0x0000000b, 0x00000000, + 0x00000001, 0x00002914, 0x00000002, 0x00000000, 0x00000001, 0x00002920, 0x0000292c, 0x00000003, + 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002930, 0x0000000b, 0x00000000, 0x00000001, + 0x00002a20, 0x00000002, 0x00000000, 0x00000001, 0x00002a2c, 0x00002a38, 0x00000003, 0x00000000, + 0x0000000a, 0x00000000, 0x00000006, 0x00002a3c, 0x0000000b, 0x00000000, 0x00000001, 0x00002be4, + 0x00000002, 0x00000000, 0x00000001, 0x00002bf0, 0x00002bfc, 0x00000003, 0x00000000, 0x0000000a, + 0x00000000, 0x00000006, 0x00002c00, 0x0000000b, 0x00000000, 0x00000001, 0x00002da8, 0x00000002, + 0x00000000, 0x00000001, 0x00002db4, 0x00002dc0, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, + 0x00000006, 0x00002dc4, 0x0000000b, 0x00000000, 0x00000001, 0x00002fb4, 0x00000002, 0x00000000, + 0x00000001, 0x00002fc0, 0x00002fcc, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, + 0x00002fd0, 0x0000000b, 0x00000000, 0x00000001, 0x000031a8, 0x00000002, 0x00000000, 0x00000001, + 0x000031b4, 0x000031c0, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000031c4, + 0x0000000b, 0x00000000, 0x00000001, 0x00003340, 0x00000002, 0x00000000, 0x00000001, 0x0000334c, + 0x00003358, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000335c, 0x0000000b, + 0x00000000, 0x00000001, 0x0000344c, 0x00000002, 0x00000000, 0x00000001, 0x00003458, 0x00003464, + 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00003468, 0x0000000b, 0x00000000, + 0x00000001, 0x000035b8, 0x00000002, 0x00000000, 0x00000001, 0x000035c4, 0x000035d0, 0x00000003, + 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000035d4, 0x0000000b, 0x00000000, 0x00000001, + 0x00003760, 0x00000002, 0x00000000, 0x00000001, 0x0000376c, 0x00003778, 0x00000003, 0x00000000, + 0x0000000a, 0x00000000, 0x00000006, 0x0000377c, 0x0000000b, 0x00000000, 0x00000001, 0x00003908, + 0x00000002, 0x00000000, 0x00000001, 0x00003914, };
static float get_frc(float v) @@ -9552,6 +9571,23 @@ static void test_effect_value_expression(void) ok(blend_factor[3] == logf(fabsf(f[3])), "Got unexpected blend_factor %.8e.\n", blend_factor[3]); ok(!sample_mask, "Got unexpected sample_mask %#x.\n", sample_mask);
+ /* exp() */ + pass = t->lpVtbl->GetPassByName(t, "p32"); + ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n"); + + set_vec4(f, 4.0f, 1.0f, 0.0f, -2.0f); + hr = g_var->lpVtbl->SetFloatVector(g_var, f); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = pass->lpVtbl->Apply(pass, 0); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + ID3D10Device_OMGetBlendState(device, &blend_state, blend_factor, &sample_mask); + ok(!blend_state, "Unexpected blend state %p.\n", blend_state); + for (idx = 0; idx < ARRAY_SIZE(blend_factor); ++idx) + ok(blend_factor[idx] == expf(f[idx]), "Got unexpected blend_factor[%u] %.8e.\n", idx, blend_factor[idx]); + ok(!sample_mask, "Got unexpected sample_mask %#x.\n", sample_mask); + effect->lpVtbl->Release(effect);
refcount = ID3D10Device_Release(device);
From: Nikolay Sivov nsivov@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/effect.c | 14 +++ dlls/d3d10/tests/effect.c | 189 +++++++++++++++++++++++--------------- 2 files changed, 131 insertions(+), 72 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index fbe9e696d2f..342ad6bce53 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -337,6 +337,19 @@ static void pres_ineg(float **args, unsigned int n, const struct preshader_instr } }
+static void pres_not(float **args, unsigned int n, const struct preshader_instr *instr) +{ + int *arg1 = (int *)args[0]; + float *retval = args[1]; + unsigned int i; + + for (i = 0; i < instr->comp_count; ++i) + { + int v = ~arg1[0]; + retval[i] = *(float *)&v; + } +} + static void pres_itof(float **args, unsigned int n, const struct preshader_instr *instr) { float *retval = args[1]; @@ -721,6 +734,7 @@ static const struct preshader_op_info preshader_ops[] = { 0x10c, "atan", pres_atan }, { 0x112, "sqrt", pres_sqrt }, { 0x120, "ineg", pres_ineg }, + { 0x121, "not", pres_not }, { 0x130, "itof", pres_itof }, { 0x131, "utof", pres_utof }, { 0x133, "ftou", pres_ftou }, diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 24c18a362d2..75de5df2e0b 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -8324,13 +8324,17 @@ technique10 tech { SetBlendState( NULL, exp(g_var), 0 ); } + pass p33 + { + SetBlendState( NULL, ~g_var3, 0 ); + } } #endif static DWORD fx_test_value_expression[] = { - 0x43425844, 0x3539c704, 0x7d82909b, 0x0664cb0e, 0xe49dda4a, 0x00000001, 0x00004210, 0x00000001, - 0x00000024, 0x30315846, 0x000041e4, 0xfeff1001, 0x00000001, 0x00000004, 0x00000001, 0x00000000, - 0x00000000, 0x00000000, 0x00000001, 0x00003920, 0x00000000, 0x00000000, 0x00000001, 0x00000000, + 0x43425844, 0x897b5956, 0x2370a252, 0x2f6531e1, 0x8be201ef, 0x00000001, 0x00004378, 0x00000001, + 0x00000024, 0x30315846, 0x0000434c, 0xfeff1001, 0x00000001, 0x00000004, 0x00000001, 0x00000000, + 0x00000000, 0x00000000, 0x00000001, 0x00003a4c, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x6f6c4724, 0x736c6162, 0x6f6c6600, 0x00347461, 0x0000000d, 0x00000001, 0x00000000, 0x00000010, 0x00000010, 0x00000010, 0x0000210a, 0x61765f67, 0x5f670072, 0x32726176, 0x746e6900, 0x003d0034, 0x00010000, @@ -8788,75 +8792,86 @@ static DWORD fx_test_value_expression[] = 0x00000007, 0x00000001, 0x00000000, 0x00000004, 0x00000001, 0x10500001, 0x00000001, 0x00000000, 0x00000007, 0x00000002, 0x00000000, 0x00000004, 0x00000002, 0x10500001, 0x00000001, 0x00000000, 0x00000007, 0x00000003, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, - 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00000004, 0x00000040, - 0x00000000, 0x00000004, 0xffffffff, 0x00000000, 0x00000030, 0x00000014, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000036, 0x00000014, 0x00000000, 0x00000010, 0x00000000, - 0x00000000, 0x00000000, 0x0000005e, 0x00000042, 0x00000000, 0x00000020, 0x00000000, 0x00000000, - 0x00000000, 0x00000087, 0x0000006b, 0x00000000, 0x00000030, 0x00000000, 0x00000000, 0x00000000, - 0x000000bc, 0x000000a0, 0x00000000, 0xffffffff, 0x00000001, 0x00000019, 0x00000000, 0x00000006, - 0x000000c5, 0x00000000, 0x000001b5, 0x00000021, 0x00000000, 0x000001ba, 0x00000003, 0x00000000, - 0x0000000a, 0x00000000, 0x00000006, 0x000001bd, 0x0000000b, 0x00000000, 0x00000001, 0x00000405, - 0x00000002, 0x00000000, 0x00000001, 0x00000411, 0x0000041d, 0x00000003, 0x00000000, 0x0000000a, - 0x00000000, 0x00000006, 0x00000420, 0x0000000b, 0x00000000, 0x00000001, 0x00000574, 0x00000002, - 0x00000000, 0x00000001, 0x00000580, 0x0000058c, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, - 0x00000006, 0x0000058f, 0x0000000b, 0x00000000, 0x00000001, 0x000007bf, 0x00000002, 0x00000000, - 0x00000001, 0x000007cb, 0x000007d7, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, - 0x000007da, 0x0000000b, 0x00000000, 0x00000001, 0x00000902, 0x00000002, 0x00000000, 0x00000001, - 0x0000090e, 0x0000091a, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000091d, - 0x0000000b, 0x00000000, 0x00000001, 0x00000a45, 0x00000002, 0x00000000, 0x00000001, 0x00000a51, - 0x00000a5d, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000a60, 0x0000000b, - 0x00000000, 0x00000001, 0x00000b5c, 0x00000002, 0x00000000, 0x00000001, 0x00000b68, 0x00000b74, - 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000b77, 0x0000000b, 0x00000000, - 0x00000001, 0x00000cc7, 0x00000002, 0x00000000, 0x00000001, 0x00000cd3, 0x00000cdf, 0x00000003, - 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000ce2, 0x0000000b, 0x00000000, 0x00000001, - 0x00000dd2, 0x00000002, 0x00000000, 0x00000001, 0x00000dde, 0x00000dea, 0x00000003, 0x00000000, - 0x0000000a, 0x00000000, 0x00000006, 0x00000ded, 0x0000000b, 0x00000000, 0x00000001, 0x00000fe9, - 0x00000002, 0x00000000, 0x00000001, 0x00000ff5, 0x00001001, 0x00000003, 0x00000000, 0x0000000a, - 0x00000000, 0x00000006, 0x00001004, 0x0000000b, 0x00000000, 0x00000001, 0x00001180, 0x00000002, - 0x00000000, 0x00000001, 0x0000118c, 0x00001198, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, - 0x00000006, 0x0000119c, 0x0000000b, 0x00000000, 0x00000001, 0x0000136c, 0x00000002, 0x00000000, - 0x00000001, 0x00001378, 0x00001384, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, - 0x00001388, 0x0000000b, 0x00000000, 0x00000001, 0x00001504, 0x00000002, 0x00000000, 0x00000001, - 0x00001510, 0x0000151c, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001520, - 0x0000000b, 0x00000000, 0x00000001, 0x0000169c, 0x00000002, 0x00000000, 0x00000001, 0x000016a8, - 0x000016b4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000016b8, 0x0000000b, - 0x00000000, 0x00000001, 0x00001834, 0x00000002, 0x00000000, 0x00000001, 0x00001840, 0x0000184c, - 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001850, 0x0000000b, 0x00000000, - 0x00000001, 0x000019cc, 0x00000002, 0x00000000, 0x00000001, 0x000019d8, 0x000019e4, 0x00000003, - 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000019e8, 0x0000000b, 0x00000000, 0x00000001, - 0x00001b38, 0x00000002, 0x00000000, 0x00000001, 0x00001b44, 0x00001b50, 0x00000003, 0x00000000, - 0x0000000a, 0x00000000, 0x00000006, 0x00001b54, 0x0000000b, 0x00000000, 0x00000001, 0x00001ca4, - 0x00000002, 0x00000000, 0x00000001, 0x00001cb0, 0x00001cbc, 0x00000003, 0x00000000, 0x0000000a, - 0x00000000, 0x00000006, 0x00001cc0, 0x0000000b, 0x00000000, 0x00000001, 0x00001e10, 0x00000002, - 0x00000000, 0x00000001, 0x00001e1c, 0x00001e28, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, - 0x00000006, 0x00001e2c, 0x0000000b, 0x00000000, 0x00000001, 0x00001fac, 0x00000002, 0x00000000, - 0x00000001, 0x00001fb8, 0x00001fc4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, - 0x00001fc8, 0x0000000b, 0x00000000, 0x00000001, 0x0000229c, 0x00000002, 0x00000000, 0x00000001, - 0x000022a8, 0x000022b4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000022b8, - 0x0000000b, 0x00000000, 0x00000001, 0x0000259c, 0x00000002, 0x00000000, 0x00000001, 0x000025a8, - 0x000025b4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000025b8, 0x0000000b, - 0x00000000, 0x00000001, 0x00002808, 0x00000002, 0x00000000, 0x00000001, 0x00002814, 0x00002820, - 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002824, 0x0000000b, 0x00000000, - 0x00000001, 0x00002914, 0x00000002, 0x00000000, 0x00000001, 0x00002920, 0x0000292c, 0x00000003, - 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002930, 0x0000000b, 0x00000000, 0x00000001, - 0x00002a20, 0x00000002, 0x00000000, 0x00000001, 0x00002a2c, 0x00002a38, 0x00000003, 0x00000000, - 0x0000000a, 0x00000000, 0x00000006, 0x00002a3c, 0x0000000b, 0x00000000, 0x00000001, 0x00002be4, - 0x00000002, 0x00000000, 0x00000001, 0x00002bf0, 0x00002bfc, 0x00000003, 0x00000000, 0x0000000a, - 0x00000000, 0x00000006, 0x00002c00, 0x0000000b, 0x00000000, 0x00000001, 0x00002da8, 0x00000002, - 0x00000000, 0x00000001, 0x00002db4, 0x00002dc0, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, - 0x00000006, 0x00002dc4, 0x0000000b, 0x00000000, 0x00000001, 0x00002fb4, 0x00000002, 0x00000000, - 0x00000001, 0x00002fc0, 0x00002fcc, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, - 0x00002fd0, 0x0000000b, 0x00000000, 0x00000001, 0x000031a8, 0x00000002, 0x00000000, 0x00000001, - 0x000031b4, 0x000031c0, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000031c4, - 0x0000000b, 0x00000000, 0x00000001, 0x00003340, 0x00000002, 0x00000000, 0x00000001, 0x0000334c, - 0x00003358, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000335c, 0x0000000b, - 0x00000000, 0x00000001, 0x0000344c, 0x00000002, 0x00000000, 0x00000001, 0x00003458, 0x00003464, - 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00003468, 0x0000000b, 0x00000000, - 0x00000001, 0x000035b8, 0x00000002, 0x00000000, 0x00000001, 0x000035c4, 0x000035d0, 0x00000003, - 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000035d4, 0x0000000b, 0x00000000, 0x00000001, - 0x00003760, 0x00000002, 0x00000000, 0x00000001, 0x0000376c, 0x00003778, 0x00000003, 0x00000000, - 0x0000000a, 0x00000000, 0x00000006, 0x0000377c, 0x0000000b, 0x00000000, 0x00000001, 0x00003908, - 0x00000002, 0x00000000, 0x00000001, 0x00003914, + 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00333370, 0x0000010c, + 0x43425844, 0x13228b05, 0x212f3cde, 0x9538c252, 0xedacc5f2, 0x00000001, 0x0000010c, 0x00000003, + 0x0000002c, 0x000000a8, 0x000000b4, 0x42415443, 0x00000074, 0x0000001c, 0x0000004b, 0x46580400, + 0x00000001, 0x0000001c, 0x00000100, 0x00000048, 0x00000030, 0x00000002, 0x00000001, 0x00000038, + 0x00000000, 0x61765f67, 0xab003372, 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874, + 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, + 0x30312072, 0xab00312e, 0x34494c43, 0x00000004, 0x00000000, 0x434c5846, 0x00000050, 0x00000002, + 0x12100004, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000007, 0x00000000, + 0x13000004, 0x00000001, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000000, + 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002, + 0x00000000, 0x00000004, 0x00000040, 0x00000000, 0x00000004, 0xffffffff, 0x00000000, 0x00000030, + 0x00000014, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000036, 0x00000014, + 0x00000000, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x0000005e, 0x00000042, 0x00000000, + 0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000087, 0x0000006b, 0x00000000, 0x00000030, + 0x00000000, 0x00000000, 0x00000000, 0x000000bc, 0x000000a0, 0x00000000, 0xffffffff, 0x00000001, + 0x00000019, 0x00000000, 0x00000006, 0x000000c5, 0x00000000, 0x000001b5, 0x00000022, 0x00000000, + 0x000001ba, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000001bd, 0x0000000b, + 0x00000000, 0x00000001, 0x00000405, 0x00000002, 0x00000000, 0x00000001, 0x00000411, 0x0000041d, + 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000420, 0x0000000b, 0x00000000, + 0x00000001, 0x00000574, 0x00000002, 0x00000000, 0x00000001, 0x00000580, 0x0000058c, 0x00000003, + 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000058f, 0x0000000b, 0x00000000, 0x00000001, + 0x000007bf, 0x00000002, 0x00000000, 0x00000001, 0x000007cb, 0x000007d7, 0x00000003, 0x00000000, + 0x0000000a, 0x00000000, 0x00000006, 0x000007da, 0x0000000b, 0x00000000, 0x00000001, 0x00000902, + 0x00000002, 0x00000000, 0x00000001, 0x0000090e, 0x0000091a, 0x00000003, 0x00000000, 0x0000000a, + 0x00000000, 0x00000006, 0x0000091d, 0x0000000b, 0x00000000, 0x00000001, 0x00000a45, 0x00000002, + 0x00000000, 0x00000001, 0x00000a51, 0x00000a5d, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, + 0x00000006, 0x00000a60, 0x0000000b, 0x00000000, 0x00000001, 0x00000b5c, 0x00000002, 0x00000000, + 0x00000001, 0x00000b68, 0x00000b74, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, + 0x00000b77, 0x0000000b, 0x00000000, 0x00000001, 0x00000cc7, 0x00000002, 0x00000000, 0x00000001, + 0x00000cd3, 0x00000cdf, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000ce2, + 0x0000000b, 0x00000000, 0x00000001, 0x00000dd2, 0x00000002, 0x00000000, 0x00000001, 0x00000dde, + 0x00000dea, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000ded, 0x0000000b, + 0x00000000, 0x00000001, 0x00000fe9, 0x00000002, 0x00000000, 0x00000001, 0x00000ff5, 0x00001001, + 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001004, 0x0000000b, 0x00000000, + 0x00000001, 0x00001180, 0x00000002, 0x00000000, 0x00000001, 0x0000118c, 0x00001198, 0x00000003, + 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000119c, 0x0000000b, 0x00000000, 0x00000001, + 0x0000136c, 0x00000002, 0x00000000, 0x00000001, 0x00001378, 0x00001384, 0x00000003, 0x00000000, + 0x0000000a, 0x00000000, 0x00000006, 0x00001388, 0x0000000b, 0x00000000, 0x00000001, 0x00001504, + 0x00000002, 0x00000000, 0x00000001, 0x00001510, 0x0000151c, 0x00000003, 0x00000000, 0x0000000a, + 0x00000000, 0x00000006, 0x00001520, 0x0000000b, 0x00000000, 0x00000001, 0x0000169c, 0x00000002, + 0x00000000, 0x00000001, 0x000016a8, 0x000016b4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, + 0x00000006, 0x000016b8, 0x0000000b, 0x00000000, 0x00000001, 0x00001834, 0x00000002, 0x00000000, + 0x00000001, 0x00001840, 0x0000184c, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, + 0x00001850, 0x0000000b, 0x00000000, 0x00000001, 0x000019cc, 0x00000002, 0x00000000, 0x00000001, + 0x000019d8, 0x000019e4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000019e8, + 0x0000000b, 0x00000000, 0x00000001, 0x00001b38, 0x00000002, 0x00000000, 0x00000001, 0x00001b44, + 0x00001b50, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001b54, 0x0000000b, + 0x00000000, 0x00000001, 0x00001ca4, 0x00000002, 0x00000000, 0x00000001, 0x00001cb0, 0x00001cbc, + 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001cc0, 0x0000000b, 0x00000000, + 0x00000001, 0x00001e10, 0x00000002, 0x00000000, 0x00000001, 0x00001e1c, 0x00001e28, 0x00000003, + 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001e2c, 0x0000000b, 0x00000000, 0x00000001, + 0x00001fac, 0x00000002, 0x00000000, 0x00000001, 0x00001fb8, 0x00001fc4, 0x00000003, 0x00000000, + 0x0000000a, 0x00000000, 0x00000006, 0x00001fc8, 0x0000000b, 0x00000000, 0x00000001, 0x0000229c, + 0x00000002, 0x00000000, 0x00000001, 0x000022a8, 0x000022b4, 0x00000003, 0x00000000, 0x0000000a, + 0x00000000, 0x00000006, 0x000022b8, 0x0000000b, 0x00000000, 0x00000001, 0x0000259c, 0x00000002, + 0x00000000, 0x00000001, 0x000025a8, 0x000025b4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, + 0x00000006, 0x000025b8, 0x0000000b, 0x00000000, 0x00000001, 0x00002808, 0x00000002, 0x00000000, + 0x00000001, 0x00002814, 0x00002820, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, + 0x00002824, 0x0000000b, 0x00000000, 0x00000001, 0x00002914, 0x00000002, 0x00000000, 0x00000001, + 0x00002920, 0x0000292c, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002930, + 0x0000000b, 0x00000000, 0x00000001, 0x00002a20, 0x00000002, 0x00000000, 0x00000001, 0x00002a2c, + 0x00002a38, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002a3c, 0x0000000b, + 0x00000000, 0x00000001, 0x00002be4, 0x00000002, 0x00000000, 0x00000001, 0x00002bf0, 0x00002bfc, + 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002c00, 0x0000000b, 0x00000000, + 0x00000001, 0x00002da8, 0x00000002, 0x00000000, 0x00000001, 0x00002db4, 0x00002dc0, 0x00000003, + 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002dc4, 0x0000000b, 0x00000000, 0x00000001, + 0x00002fb4, 0x00000002, 0x00000000, 0x00000001, 0x00002fc0, 0x00002fcc, 0x00000003, 0x00000000, + 0x0000000a, 0x00000000, 0x00000006, 0x00002fd0, 0x0000000b, 0x00000000, 0x00000001, 0x000031a8, + 0x00000002, 0x00000000, 0x00000001, 0x000031b4, 0x000031c0, 0x00000003, 0x00000000, 0x0000000a, + 0x00000000, 0x00000006, 0x000031c4, 0x0000000b, 0x00000000, 0x00000001, 0x00003340, 0x00000002, + 0x00000000, 0x00000001, 0x0000334c, 0x00003358, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, + 0x00000006, 0x0000335c, 0x0000000b, 0x00000000, 0x00000001, 0x0000344c, 0x00000002, 0x00000000, + 0x00000001, 0x00003458, 0x00003464, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, + 0x00003468, 0x0000000b, 0x00000000, 0x00000001, 0x000035b8, 0x00000002, 0x00000000, 0x00000001, + 0x000035c4, 0x000035d0, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000035d4, + 0x0000000b, 0x00000000, 0x00000001, 0x00003760, 0x00000002, 0x00000000, 0x00000001, 0x0000376c, + 0x00003778, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000377c, 0x0000000b, + 0x00000000, 0x00000001, 0x00003908, 0x00000002, 0x00000000, 0x00000001, 0x00003914, 0x00003920, + 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00003924, 0x0000000b, 0x00000000, + 0x00000001, 0x00003a34, 0x00000002, 0x00000000, 0x00000001, 0x00003a40, };
static float get_frc(float v) @@ -9588,6 +9603,36 @@ static void test_effect_value_expression(void) ok(blend_factor[idx] == expf(f[idx]), "Got unexpected blend_factor[%u] %.8e.\n", idx, blend_factor[idx]); ok(!sample_mask, "Got unexpected sample_mask %#x.\n", sample_mask);
+ /* binary complement */ + pass = t->lpVtbl->GetPassByName(t, "p33"); + ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n"); + + set_int4(i, 0, 1, 2, 3); + hr = g_var3->lpVtbl->SetIntVector(g_var3, i); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = pass->lpVtbl->Apply(pass, 0); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + ID3D10Device_OMGetBlendState(device, &blend_state, blend_factor, &sample_mask); + ok(!blend_state, "Unexpected blend state %p.\n", blend_state); + for (idx = 0; idx < ARRAY_SIZE(blend_factor); ++idx) + ok(blend_factor[idx] == -1.0f, "Got unexpected blend_factor[%u] %.8e.\n", idx, blend_factor[idx]); + ok(!sample_mask, "Got unexpected sample_mask %#x.\n", sample_mask); + + set_int4(i, 1, 0, 2, 3); + hr = g_var3->lpVtbl->SetIntVector(g_var3, i); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = pass->lpVtbl->Apply(pass, 0); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + ID3D10Device_OMGetBlendState(device, &blend_state, blend_factor, &sample_mask); + ok(!blend_state, "Unexpected blend state %p.\n", blend_state); + for (idx = 0; idx < ARRAY_SIZE(blend_factor); ++idx) + ok(blend_factor[idx] == -2.0f, "Got unexpected blend_factor[%u] %.8e.\n", idx, blend_factor[idx]); + ok(!sample_mask, "Got unexpected sample_mask %#x.\n", sample_mask); + effect->lpVtbl->Release(effect);
refcount = ID3D10Device_Release(device);
From: Nikolay Sivov nsivov@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/effect.c | 15 +++ dlls/d3d10/tests/effect.c | 197 ++++++++++++++++++++++++-------------- 2 files changed, 139 insertions(+), 73 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 342ad6bce53..3e61fa608f0 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -660,6 +660,20 @@ static void pres_and(float **args, unsigned int n, const struct preshader_instr } }
+static void pres_or(float **args, unsigned int n, const struct preshader_instr *instr) +{ + unsigned int *arg1 = (unsigned int *)args[0]; + unsigned int *arg2 = (unsigned int *)args[1]; + float *retval = args[2]; + unsigned int i; + + for (i = 0; i < instr->comp_count; ++i) + { + unsigned int v = arg1[0] | arg2[0]; + retval[i] = *(float *)&v; + } +} + static void pres_xor(float **args, unsigned int n, const struct preshader_instr *instr) { unsigned int *arg1 = (unsigned int *)args[0]; @@ -761,6 +775,7 @@ static const struct preshader_op_info preshader_ops[] = { 0x21f, "umin", pres_umin }, { 0x220, "umax", pres_umax }, { 0x230, "and", pres_and }, + { 0x231, "or", pres_or }, { 0x233, "xor", pres_xor }, { 0x301, "movc", pres_movc }, { 0x500, "dot", pres_dot }, diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 75de5df2e0b..ceb0922dbc0 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -8328,13 +8328,17 @@ technique10 tech { SetBlendState( NULL, ~g_var3, 0 ); } + pass p34 + { + SetBlendState( NULL, g_var4 | g_var3, 0 ); + } } #endif static DWORD fx_test_value_expression[] = { - 0x43425844, 0x897b5956, 0x2370a252, 0x2f6531e1, 0x8be201ef, 0x00000001, 0x00004378, 0x00000001, - 0x00000024, 0x30315846, 0x0000434c, 0xfeff1001, 0x00000001, 0x00000004, 0x00000001, 0x00000000, - 0x00000000, 0x00000000, 0x00000001, 0x00003a4c, 0x00000000, 0x00000000, 0x00000001, 0x00000000, + 0x43425844, 0xedc09074, 0xd53294a2, 0x4c731a12, 0x3100c73e, 0x00000001, 0x00004518, 0x00000001, + 0x00000024, 0x30315846, 0x000044ec, 0xfeff1001, 0x00000001, 0x00000004, 0x00000001, 0x00000000, + 0x00000000, 0x00000000, 0x00000001, 0x00003bb0, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x6f6c4724, 0x736c6162, 0x6f6c6600, 0x00347461, 0x0000000d, 0x00000001, 0x00000000, 0x00000010, 0x00000010, 0x00000010, 0x0000210a, 0x61765f67, 0x5f670072, 0x32726176, 0x746e6900, 0x003d0034, 0x00010000, @@ -8802,76 +8806,89 @@ static DWORD fx_test_value_expression[] = 0x12100004, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000007, 0x00000000, 0x13000004, 0x00000001, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002, - 0x00000000, 0x00000004, 0x00000040, 0x00000000, 0x00000004, 0xffffffff, 0x00000000, 0x00000030, - 0x00000014, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000036, 0x00000014, - 0x00000000, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x0000005e, 0x00000042, 0x00000000, - 0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000087, 0x0000006b, 0x00000000, 0x00000030, - 0x00000000, 0x00000000, 0x00000000, 0x000000bc, 0x000000a0, 0x00000000, 0xffffffff, 0x00000001, - 0x00000019, 0x00000000, 0x00000006, 0x000000c5, 0x00000000, 0x000001b5, 0x00000022, 0x00000000, - 0x000001ba, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000001bd, 0x0000000b, - 0x00000000, 0x00000001, 0x00000405, 0x00000002, 0x00000000, 0x00000001, 0x00000411, 0x0000041d, - 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000420, 0x0000000b, 0x00000000, - 0x00000001, 0x00000574, 0x00000002, 0x00000000, 0x00000001, 0x00000580, 0x0000058c, 0x00000003, - 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000058f, 0x0000000b, 0x00000000, 0x00000001, - 0x000007bf, 0x00000002, 0x00000000, 0x00000001, 0x000007cb, 0x000007d7, 0x00000003, 0x00000000, - 0x0000000a, 0x00000000, 0x00000006, 0x000007da, 0x0000000b, 0x00000000, 0x00000001, 0x00000902, - 0x00000002, 0x00000000, 0x00000001, 0x0000090e, 0x0000091a, 0x00000003, 0x00000000, 0x0000000a, - 0x00000000, 0x00000006, 0x0000091d, 0x0000000b, 0x00000000, 0x00000001, 0x00000a45, 0x00000002, - 0x00000000, 0x00000001, 0x00000a51, 0x00000a5d, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, - 0x00000006, 0x00000a60, 0x0000000b, 0x00000000, 0x00000001, 0x00000b5c, 0x00000002, 0x00000000, - 0x00000001, 0x00000b68, 0x00000b74, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, - 0x00000b77, 0x0000000b, 0x00000000, 0x00000001, 0x00000cc7, 0x00000002, 0x00000000, 0x00000001, - 0x00000cd3, 0x00000cdf, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000ce2, - 0x0000000b, 0x00000000, 0x00000001, 0x00000dd2, 0x00000002, 0x00000000, 0x00000001, 0x00000dde, - 0x00000dea, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000ded, 0x0000000b, - 0x00000000, 0x00000001, 0x00000fe9, 0x00000002, 0x00000000, 0x00000001, 0x00000ff5, 0x00001001, - 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001004, 0x0000000b, 0x00000000, - 0x00000001, 0x00001180, 0x00000002, 0x00000000, 0x00000001, 0x0000118c, 0x00001198, 0x00000003, - 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000119c, 0x0000000b, 0x00000000, 0x00000001, - 0x0000136c, 0x00000002, 0x00000000, 0x00000001, 0x00001378, 0x00001384, 0x00000003, 0x00000000, - 0x0000000a, 0x00000000, 0x00000006, 0x00001388, 0x0000000b, 0x00000000, 0x00000001, 0x00001504, - 0x00000002, 0x00000000, 0x00000001, 0x00001510, 0x0000151c, 0x00000003, 0x00000000, 0x0000000a, - 0x00000000, 0x00000006, 0x00001520, 0x0000000b, 0x00000000, 0x00000001, 0x0000169c, 0x00000002, - 0x00000000, 0x00000001, 0x000016a8, 0x000016b4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, - 0x00000006, 0x000016b8, 0x0000000b, 0x00000000, 0x00000001, 0x00001834, 0x00000002, 0x00000000, - 0x00000001, 0x00001840, 0x0000184c, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, - 0x00001850, 0x0000000b, 0x00000000, 0x00000001, 0x000019cc, 0x00000002, 0x00000000, 0x00000001, - 0x000019d8, 0x000019e4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000019e8, - 0x0000000b, 0x00000000, 0x00000001, 0x00001b38, 0x00000002, 0x00000000, 0x00000001, 0x00001b44, - 0x00001b50, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001b54, 0x0000000b, - 0x00000000, 0x00000001, 0x00001ca4, 0x00000002, 0x00000000, 0x00000001, 0x00001cb0, 0x00001cbc, - 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001cc0, 0x0000000b, 0x00000000, - 0x00000001, 0x00001e10, 0x00000002, 0x00000000, 0x00000001, 0x00001e1c, 0x00001e28, 0x00000003, - 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001e2c, 0x0000000b, 0x00000000, 0x00000001, - 0x00001fac, 0x00000002, 0x00000000, 0x00000001, 0x00001fb8, 0x00001fc4, 0x00000003, 0x00000000, - 0x0000000a, 0x00000000, 0x00000006, 0x00001fc8, 0x0000000b, 0x00000000, 0x00000001, 0x0000229c, - 0x00000002, 0x00000000, 0x00000001, 0x000022a8, 0x000022b4, 0x00000003, 0x00000000, 0x0000000a, - 0x00000000, 0x00000006, 0x000022b8, 0x0000000b, 0x00000000, 0x00000001, 0x0000259c, 0x00000002, - 0x00000000, 0x00000001, 0x000025a8, 0x000025b4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, - 0x00000006, 0x000025b8, 0x0000000b, 0x00000000, 0x00000001, 0x00002808, 0x00000002, 0x00000000, - 0x00000001, 0x00002814, 0x00002820, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, - 0x00002824, 0x0000000b, 0x00000000, 0x00000001, 0x00002914, 0x00000002, 0x00000000, 0x00000001, - 0x00002920, 0x0000292c, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002930, - 0x0000000b, 0x00000000, 0x00000001, 0x00002a20, 0x00000002, 0x00000000, 0x00000001, 0x00002a2c, - 0x00002a38, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002a3c, 0x0000000b, - 0x00000000, 0x00000001, 0x00002be4, 0x00000002, 0x00000000, 0x00000001, 0x00002bf0, 0x00002bfc, - 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002c00, 0x0000000b, 0x00000000, - 0x00000001, 0x00002da8, 0x00000002, 0x00000000, 0x00000001, 0x00002db4, 0x00002dc0, 0x00000003, - 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002dc4, 0x0000000b, 0x00000000, 0x00000001, - 0x00002fb4, 0x00000002, 0x00000000, 0x00000001, 0x00002fc0, 0x00002fcc, 0x00000003, 0x00000000, - 0x0000000a, 0x00000000, 0x00000006, 0x00002fd0, 0x0000000b, 0x00000000, 0x00000001, 0x000031a8, - 0x00000002, 0x00000000, 0x00000001, 0x000031b4, 0x000031c0, 0x00000003, 0x00000000, 0x0000000a, - 0x00000000, 0x00000006, 0x000031c4, 0x0000000b, 0x00000000, 0x00000001, 0x00003340, 0x00000002, - 0x00000000, 0x00000001, 0x0000334c, 0x00003358, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, - 0x00000006, 0x0000335c, 0x0000000b, 0x00000000, 0x00000001, 0x0000344c, 0x00000002, 0x00000000, - 0x00000001, 0x00003458, 0x00003464, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, - 0x00003468, 0x0000000b, 0x00000000, 0x00000001, 0x000035b8, 0x00000002, 0x00000000, 0x00000001, - 0x000035c4, 0x000035d0, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000035d4, - 0x0000000b, 0x00000000, 0x00000001, 0x00003760, 0x00000002, 0x00000000, 0x00000001, 0x0000376c, - 0x00003778, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000377c, 0x0000000b, - 0x00000000, 0x00000001, 0x00003908, 0x00000002, 0x00000000, 0x00000001, 0x00003914, 0x00003920, - 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00003924, 0x0000000b, 0x00000000, - 0x00000001, 0x00003a34, 0x00000002, 0x00000000, 0x00000001, 0x00003a40, + 0x00000000, 0x00343370, 0x00000144, 0x43425844, 0x74c24633, 0x7c8b5796, 0x94f5cf48, 0x026f6022, + 0x00000001, 0x00000144, 0x00000003, 0x0000002c, 0x000000d4, 0x000000e0, 0x42415443, 0x000000a0, + 0x0000001c, 0x00000077, 0x46580400, 0x00000002, 0x0000001c, 0x00000100, 0x00000074, 0x00000044, + 0x00000002, 0x00000001, 0x0000004c, 0x00000000, 0x0000005c, 0x00010002, 0x00000001, 0x00000064, + 0x00000000, 0x61765f67, 0xab003372, 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x61765f67, + 0xab003472, 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, + 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x30312072, 0xab00312e, + 0x34494c43, 0x00000004, 0x00000000, 0x434c5846, 0x0000005c, 0x00000002, 0x23100004, 0x00000002, + 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000007, + 0x00000000, 0x13100004, 0x00000001, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004, + 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000001, 0x00000002, 0x00000000, 0x00000001, + 0x00000002, 0x00000000, 0x00000004, 0x00000040, 0x00000000, 0x00000004, 0xffffffff, 0x00000000, + 0x00000030, 0x00000014, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000036, + 0x00000014, 0x00000000, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x0000005e, 0x00000042, + 0x00000000, 0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000087, 0x0000006b, 0x00000000, + 0x00000030, 0x00000000, 0x00000000, 0x00000000, 0x000000bc, 0x000000a0, 0x00000000, 0xffffffff, + 0x00000001, 0x00000019, 0x00000000, 0x00000006, 0x000000c5, 0x00000000, 0x000001b5, 0x00000023, + 0x00000000, 0x000001ba, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000001bd, + 0x0000000b, 0x00000000, 0x00000001, 0x00000405, 0x00000002, 0x00000000, 0x00000001, 0x00000411, + 0x0000041d, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000420, 0x0000000b, + 0x00000000, 0x00000001, 0x00000574, 0x00000002, 0x00000000, 0x00000001, 0x00000580, 0x0000058c, + 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000058f, 0x0000000b, 0x00000000, + 0x00000001, 0x000007bf, 0x00000002, 0x00000000, 0x00000001, 0x000007cb, 0x000007d7, 0x00000003, + 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000007da, 0x0000000b, 0x00000000, 0x00000001, + 0x00000902, 0x00000002, 0x00000000, 0x00000001, 0x0000090e, 0x0000091a, 0x00000003, 0x00000000, + 0x0000000a, 0x00000000, 0x00000006, 0x0000091d, 0x0000000b, 0x00000000, 0x00000001, 0x00000a45, + 0x00000002, 0x00000000, 0x00000001, 0x00000a51, 0x00000a5d, 0x00000003, 0x00000000, 0x0000000a, + 0x00000000, 0x00000006, 0x00000a60, 0x0000000b, 0x00000000, 0x00000001, 0x00000b5c, 0x00000002, + 0x00000000, 0x00000001, 0x00000b68, 0x00000b74, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, + 0x00000006, 0x00000b77, 0x0000000b, 0x00000000, 0x00000001, 0x00000cc7, 0x00000002, 0x00000000, + 0x00000001, 0x00000cd3, 0x00000cdf, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, + 0x00000ce2, 0x0000000b, 0x00000000, 0x00000001, 0x00000dd2, 0x00000002, 0x00000000, 0x00000001, + 0x00000dde, 0x00000dea, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000ded, + 0x0000000b, 0x00000000, 0x00000001, 0x00000fe9, 0x00000002, 0x00000000, 0x00000001, 0x00000ff5, + 0x00001001, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001004, 0x0000000b, + 0x00000000, 0x00000001, 0x00001180, 0x00000002, 0x00000000, 0x00000001, 0x0000118c, 0x00001198, + 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000119c, 0x0000000b, 0x00000000, + 0x00000001, 0x0000136c, 0x00000002, 0x00000000, 0x00000001, 0x00001378, 0x00001384, 0x00000003, + 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001388, 0x0000000b, 0x00000000, 0x00000001, + 0x00001504, 0x00000002, 0x00000000, 0x00000001, 0x00001510, 0x0000151c, 0x00000003, 0x00000000, + 0x0000000a, 0x00000000, 0x00000006, 0x00001520, 0x0000000b, 0x00000000, 0x00000001, 0x0000169c, + 0x00000002, 0x00000000, 0x00000001, 0x000016a8, 0x000016b4, 0x00000003, 0x00000000, 0x0000000a, + 0x00000000, 0x00000006, 0x000016b8, 0x0000000b, 0x00000000, 0x00000001, 0x00001834, 0x00000002, + 0x00000000, 0x00000001, 0x00001840, 0x0000184c, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, + 0x00000006, 0x00001850, 0x0000000b, 0x00000000, 0x00000001, 0x000019cc, 0x00000002, 0x00000000, + 0x00000001, 0x000019d8, 0x000019e4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, + 0x000019e8, 0x0000000b, 0x00000000, 0x00000001, 0x00001b38, 0x00000002, 0x00000000, 0x00000001, + 0x00001b44, 0x00001b50, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001b54, + 0x0000000b, 0x00000000, 0x00000001, 0x00001ca4, 0x00000002, 0x00000000, 0x00000001, 0x00001cb0, + 0x00001cbc, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001cc0, 0x0000000b, + 0x00000000, 0x00000001, 0x00001e10, 0x00000002, 0x00000000, 0x00000001, 0x00001e1c, 0x00001e28, + 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001e2c, 0x0000000b, 0x00000000, + 0x00000001, 0x00001fac, 0x00000002, 0x00000000, 0x00000001, 0x00001fb8, 0x00001fc4, 0x00000003, + 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001fc8, 0x0000000b, 0x00000000, 0x00000001, + 0x0000229c, 0x00000002, 0x00000000, 0x00000001, 0x000022a8, 0x000022b4, 0x00000003, 0x00000000, + 0x0000000a, 0x00000000, 0x00000006, 0x000022b8, 0x0000000b, 0x00000000, 0x00000001, 0x0000259c, + 0x00000002, 0x00000000, 0x00000001, 0x000025a8, 0x000025b4, 0x00000003, 0x00000000, 0x0000000a, + 0x00000000, 0x00000006, 0x000025b8, 0x0000000b, 0x00000000, 0x00000001, 0x00002808, 0x00000002, + 0x00000000, 0x00000001, 0x00002814, 0x00002820, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, + 0x00000006, 0x00002824, 0x0000000b, 0x00000000, 0x00000001, 0x00002914, 0x00000002, 0x00000000, + 0x00000001, 0x00002920, 0x0000292c, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, + 0x00002930, 0x0000000b, 0x00000000, 0x00000001, 0x00002a20, 0x00000002, 0x00000000, 0x00000001, + 0x00002a2c, 0x00002a38, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002a3c, + 0x0000000b, 0x00000000, 0x00000001, 0x00002be4, 0x00000002, 0x00000000, 0x00000001, 0x00002bf0, + 0x00002bfc, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002c00, 0x0000000b, + 0x00000000, 0x00000001, 0x00002da8, 0x00000002, 0x00000000, 0x00000001, 0x00002db4, 0x00002dc0, + 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002dc4, 0x0000000b, 0x00000000, + 0x00000001, 0x00002fb4, 0x00000002, 0x00000000, 0x00000001, 0x00002fc0, 0x00002fcc, 0x00000003, + 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002fd0, 0x0000000b, 0x00000000, 0x00000001, + 0x000031a8, 0x00000002, 0x00000000, 0x00000001, 0x000031b4, 0x000031c0, 0x00000003, 0x00000000, + 0x0000000a, 0x00000000, 0x00000006, 0x000031c4, 0x0000000b, 0x00000000, 0x00000001, 0x00003340, + 0x00000002, 0x00000000, 0x00000001, 0x0000334c, 0x00003358, 0x00000003, 0x00000000, 0x0000000a, + 0x00000000, 0x00000006, 0x0000335c, 0x0000000b, 0x00000000, 0x00000001, 0x0000344c, 0x00000002, + 0x00000000, 0x00000001, 0x00003458, 0x00003464, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, + 0x00000006, 0x00003468, 0x0000000b, 0x00000000, 0x00000001, 0x000035b8, 0x00000002, 0x00000000, + 0x00000001, 0x000035c4, 0x000035d0, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, + 0x000035d4, 0x0000000b, 0x00000000, 0x00000001, 0x00003760, 0x00000002, 0x00000000, 0x00000001, + 0x0000376c, 0x00003778, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000377c, + 0x0000000b, 0x00000000, 0x00000001, 0x00003908, 0x00000002, 0x00000000, 0x00000001, 0x00003914, + 0x00003920, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00003924, 0x0000000b, + 0x00000000, 0x00000001, 0x00003a34, 0x00000002, 0x00000000, 0x00000001, 0x00003a40, 0x00003a4c, + 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00003a50, 0x0000000b, 0x00000000, + 0x00000001, 0x00003b98, 0x00000002, 0x00000000, 0x00000001, 0x00003ba4, };
static float get_frc(float v) @@ -9633,6 +9650,40 @@ static void test_effect_value_expression(void) ok(blend_factor[idx] == -2.0f, "Got unexpected blend_factor[%u] %.8e.\n", idx, blend_factor[idx]); ok(!sample_mask, "Got unexpected sample_mask %#x.\n", sample_mask);
+ /* bitwise 'or' */ + pass = t->lpVtbl->GetPassByName(t, "p34"); + ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n"); + + set_int4(i, 1, 2, 3, 4); + hr = g_var3->lpVtbl->SetIntVector(g_var3, i); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + set_int4(i, 0x10, 0x20, 0x30, 0x40); + hr = g_var4->lpVtbl->SetIntVector(g_var4, i); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = pass->lpVtbl->Apply(pass, 0); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + ID3D10Device_OMGetBlendState(device, &blend_state, blend_factor, &sample_mask); + ok(!blend_state, "Unexpected blend state %p.\n", blend_state); + for (idx = 0; idx < ARRAY_SIZE(blend_factor); ++idx) + ok(blend_factor[idx] == 17.0f, "Got unexpected blend_factor[%u] %.8e.\n", idx, blend_factor[idx]); + ok(!sample_mask, "Got unexpected sample_mask %#x.\n", sample_mask); + + set_int4(i, 0x20, 0x10, 0x30, 0x40); + hr = g_var4->lpVtbl->SetIntVector(g_var4, i); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = pass->lpVtbl->Apply(pass, 0); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + ID3D10Device_OMGetBlendState(device, &blend_state, blend_factor, &sample_mask); + ok(!blend_state, "Unexpected blend state %p.\n", blend_state); + for (idx = 0; idx < ARRAY_SIZE(blend_factor); ++idx) + ok(blend_factor[idx] == 33.0f, "Got unexpected blend_factor[%u] %.8e.\n", idx, blend_factor[idx]); + ok(!sample_mask, "Got unexpected sample_mask %#x.\n", sample_mask); + effect->lpVtbl->Release(effect);
refcount = ID3D10Device_Release(device);
On Wed Oct 4 15:11:21 2023 +0000, Nikolay Sivov wrote:
changed this line in [version 2 of the diff](/wine/wine/-/merge_requests/4007/diffs?diff_id=73820&start_sha=890bf145f4a054817bbf091dca3f621c17d27bd5#556d214f7365e7fa9e476ceb107a901b9f23e478_9606_9600)
Pushed that part.