Commit 8e2412fc authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

d3d10/effect: Add support for ineg instruction.

parent cbc25006
......@@ -252,6 +252,19 @@ static void pres_cos(float **args, unsigned int n, const struct preshader_instr
retval[i] = cos(args[0][i]);
}
static void pres_ineg(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[i];
retval[i] = *(float *)&v;
}
}
static void pres_itof(float **args, unsigned int n, const struct preshader_instr *instr)
{
float *retval = args[1];
......@@ -344,6 +357,7 @@ static const struct preshader_op_info preshader_ops[] =
{ 0x104, "frc", pres_frc },
{ 0x108, "sin", pres_sin },
{ 0x109, "cos", pres_cos },
{ 0x120, "ineg", pres_ineg },
{ 0x130, "itof", pres_itof },
{ 0x133, "ftou", pres_ftou },
{ 0x137, "ftob", pres_ftob },
......
......@@ -8182,15 +8182,15 @@ technique10 tech
}
pass p8
{
SetBlendState( NULL, 0.1 * g_var3.x, 0 );
SetBlendState( NULL, 0.1 * -g_var3.x, 0 );
}
}
#endif
static DWORD fx_test_value_expression[] =
{
0x43425844, 0xd57994e8, 0xc1f47b80, 0x5ab836c5, 0x02ff0a6e, 0x00000001, 0x000012c0, 0x00000001,
0x00000024, 0x30315846, 0x00001294, 0xfeff1001, 0x00000001, 0x00000003, 0x00000001, 0x00000000,
0x00000000, 0x00000000, 0x00000001, 0x00000f8c, 0x00000000, 0x00000000, 0x00000001, 0x00000000,
0x43425844, 0xa151a4d6, 0x36eec21c, 0xfbe6ea0f, 0xb267f68f, 0x00000001, 0x000012e0, 0x00000001,
0x00000024, 0x30315846, 0x000012b4, 0xfeff1001, 0x00000001, 0x00000003, 0x00000001, 0x00000000,
0x00000000, 0x00000000, 0x00000001, 0x00000fac, 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,
......@@ -8301,20 +8301,21 @@ static DWORD fx_test_value_expression[] =
0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, 0x6c69706d, 0x31207265, 0x00312e30, 0x494c43ab,
0x00000434, 0x00000000, 0x4c584600, 0x00003043, 0x00000100, 0x40000400, 0x00000110, 0x00000000,
0x00000200, 0x00000000, 0x00000000, 0x00000400, 0x00000000, 0xf0f0f000, 0x0f0f0ff0, 0x00ffff0f,
0x00000100, 0x00000200, 0x00000000, 0x00000100, 0x00000200, 0x00000000, 0x00387000, 0x000001ac,
0x43425844, 0x56d4ee7a, 0x14d0efda, 0x7f2a38e0, 0x183b28f2, 0x00000001, 0x000001ac, 0x00000003,
0x00000100, 0x00000200, 0x00000000, 0x00000100, 0x00000200, 0x00000000, 0x00387000, 0x000001cc,
0x43425844, 0xe22c15f6, 0xc12fca9e, 0x201275ad, 0x6952a463, 0x00000001, 0x000001cc, 0x00000003,
0x0000002c, 0x000000a8, 0x000000c4, 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, 0x00000014, 0x00000004, 0x3dcccccd, 0x00000000, 0x00000000,
0x00000000, 0x434c5846, 0x000000e0, 0x00000005, 0x13000001, 0x00000001, 0x00000000, 0x00000002,
0x00000000, 0x00000000, 0x00000007, 0x00000000, 0x20500001, 0x00000002, 0x00000000, 0x00000007,
0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x20500001,
0x00000002, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000,
0x00000004, 0x00000001, 0x20500001, 0x00000002, 0x00000000, 0x00000007, 0x00000000, 0x00000000,
0x00000000, 0x434c5846, 0x00000100, 0x00000006, 0x12000001, 0x00000001, 0x00000000, 0x00000002,
0x00000000, 0x00000000, 0x00000007, 0x00000000, 0x13000001, 0x00000001, 0x00000000, 0x00000007,
0x00000000, 0x00000000, 0x00000007, 0x00000004, 0x20500001, 0x00000002, 0x00000000, 0x00000007,
0x00000004, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x20500001,
0x00000002, 0x00000000, 0x00000007, 0x00000004, 0x00000000, 0x00000001, 0x00000000, 0x00000000,
0x00000004, 0x00000001, 0x20500001, 0x00000002, 0x00000000, 0x00000007, 0x00000004, 0x00000000,
0x00000001, 0x00000000, 0x00000000, 0x00000004, 0x00000002, 0x20500001, 0x00000002, 0x00000000,
0x00000007, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000004, 0x00000003,
0x00000007, 0x00000004, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000004, 0x00000003,
0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002,
0x00000000, 0x00000004, 0x00000030, 0x00000000, 0x00000003, 0xffffffff, 0x00000000, 0x00000030,
0x00000014, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000036, 0x00000014,
......@@ -8337,7 +8338,7 @@ static DWORD fx_test_value_expression[] =
0x00000001, 0x00000caa, 0x00000cb6, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006,
0x00000cb9, 0x0000000b, 0x00000000, 0x00000001, 0x00000da9, 0x00000002, 0x00000000, 0x00000001,
0x00000db5, 0x00000dc1, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000dc4,
0x0000000b, 0x00000000, 0x00000001, 0x00000f74, 0x00000002, 0x00000000, 0x00000001, 0x00000f80,
0x0000000b, 0x00000000, 0x00000001, 0x00000f94, 0x00000002, 0x00000000, 0x00000001, 0x00000fa0,
};
static float get_frc(float v)
......@@ -8525,7 +8526,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] = 2.0f;
f[0] = -2.0f;
hr = g_var3->lpVtbl->SetFloatVector(g_var3, f);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment