Commit c96c6b98 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

d3d10/effect: Add support for imax instruction.

parent 8e2412fc
......@@ -343,6 +343,19 @@ static void pres_div(float **args, unsigned int n, const struct preshader_instr
retval[i] = args[0][instr->scalar ? 0 : i] / args[1][i];
}
static void pres_imax(float **args, unsigned int n, const struct preshader_instr *instr)
{
int *arg1 = (int *)args[0], *arg2 = (int *)args[1];
float *retval = args[2];
unsigned int i;
for (i = 0; i < instr->comp_count; ++i)
{
int v = max(arg1[instr->scalar ? 0 : i], arg2[i]);
retval[i] = *(float *)&v;
}
}
struct preshader_op_info
{
int opcode;
......@@ -366,6 +379,7 @@ static const struct preshader_op_info preshader_ops[] =
{ 0x204, "add", pres_add },
{ 0x205, "mul", pres_mul },
{ 0x208, "div", pres_div },
{ 0x21e, "imax", pres_imax },
};
static int __cdecl preshader_op_compare(const void *a, const void *b)
......
......@@ -8182,15 +8182,15 @@ technique10 tech
}
pass p8
{
SetBlendState( NULL, 0.1 * -g_var3.x, 0 );
SetBlendState( NULL, 0.1 * -max(g_var3.x, g_var3.y), 0 );
}
}
#endif
static DWORD fx_test_value_expression[] =
{
0x43425844, 0xa151a4d6, 0x36eec21c, 0xfbe6ea0f, 0xb267f68f, 0x00000001, 0x000012e0, 0x00000001,
0x00000024, 0x30315846, 0x000012b4, 0xfeff1001, 0x00000001, 0x00000003, 0x00000001, 0x00000000,
0x00000000, 0x00000000, 0x00000001, 0x00000fac, 0x00000000, 0x00000000, 0x00000001, 0x00000000,
0x43425844, 0xded44036, 0x7bec29fc, 0xc38ee283, 0x80c175ae, 0x00000001, 0x0000130c, 0x00000001,
0x00000024, 0x30315846, 0x000012e0, 0xfeff1001, 0x00000001, 0x00000003, 0x00000001, 0x00000000,
0x00000000, 0x00000000, 0x00000001, 0x00000fd8, 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,44 +8301,46 @@ 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, 0x000001cc,
0x43425844, 0xe22c15f6, 0xc12fca9e, 0x201275ad, 0x6952a463, 0x00000001, 0x000001cc, 0x00000003,
0x00000100, 0x00000200, 0x00000000, 0x00000100, 0x00000200, 0x00000000, 0x00387000, 0x000001f8,
0x43425844, 0x126df990, 0x80e623cb, 0x58b7d817, 0xba4894a5, 0x00000001, 0x000001f8, 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, 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, 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,
0x00000000, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x0000005e, 0x00000042, 0x00000000,
0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000093, 0x00000077, 0x00000000, 0xffffffff,
0x00000001, 0x00000019, 0x00000000, 0x00000006, 0x0000009c, 0x00000000, 0x0000018c, 0x00000009,
0x00000000, 0x00000191, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000194,
0x0000000b, 0x00000000, 0x00000001, 0x000003dc, 0x00000002, 0x00000000, 0x00000001, 0x000003e8,
0x000003f4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000003f7, 0x0000000b,
0x00000000, 0x00000001, 0x0000054b, 0x00000002, 0x00000000, 0x00000001, 0x00000557, 0x00000563,
0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000566, 0x0000000b, 0x00000000,
0x00000001, 0x00000796, 0x00000002, 0x00000000, 0x00000001, 0x000007a2, 0x000007ae, 0x00000003,
0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000007b1, 0x0000000b, 0x00000000, 0x00000001,
0x000008d9, 0x00000002, 0x00000000, 0x00000001, 0x000008e5, 0x000008f1, 0x00000003, 0x00000000,
0x0000000a, 0x00000000, 0x00000006, 0x000008f4, 0x0000000b, 0x00000000, 0x00000001, 0x00000a1c,
0x00000002, 0x00000000, 0x00000001, 0x00000a28, 0x00000a34, 0x00000003, 0x00000000, 0x0000000a,
0x00000000, 0x00000006, 0x00000a37, 0x0000000b, 0x00000000, 0x00000001, 0x00000b33, 0x00000002,
0x00000000, 0x00000001, 0x00000b3f, 0x00000b4b, 0x00000003, 0x00000000, 0x0000000a, 0x00000000,
0x00000006, 0x00000b4e, 0x0000000b, 0x00000000, 0x00000001, 0x00000c9e, 0x00000002, 0x00000000,
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, 0x00000f94, 0x00000002, 0x00000000, 0x00000001, 0x00000fa0,
0x00000000, 0x434c5846, 0x0000012c, 0x00000007, 0x21e00001, 0x00000002, 0x00000000, 0x00000002,
0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000007, 0x00000000, 0x12000001,
0x00000001, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000007, 0x00000004, 0x13000001,
0x00000001, 0x00000000, 0x00000007, 0x00000004, 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, 0x00000001, 0x00000000, 0x00000000, 0x00000004, 0x00000002,
0x20500001, 0x00000002, 0x00000000, 0x00000007, 0x00000000, 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, 0x00000000, 0x00000010, 0x00000000, 0x00000000, 0x00000000,
0x0000005e, 0x00000042, 0x00000000, 0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000093,
0x00000077, 0x00000000, 0xffffffff, 0x00000001, 0x00000019, 0x00000000, 0x00000006, 0x0000009c,
0x00000000, 0x0000018c, 0x00000009, 0x00000000, 0x00000191, 0x00000003, 0x00000000, 0x0000000a,
0x00000000, 0x00000006, 0x00000194, 0x0000000b, 0x00000000, 0x00000001, 0x000003dc, 0x00000002,
0x00000000, 0x00000001, 0x000003e8, 0x000003f4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000,
0x00000006, 0x000003f7, 0x0000000b, 0x00000000, 0x00000001, 0x0000054b, 0x00000002, 0x00000000,
0x00000001, 0x00000557, 0x00000563, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006,
0x00000566, 0x0000000b, 0x00000000, 0x00000001, 0x00000796, 0x00000002, 0x00000000, 0x00000001,
0x000007a2, 0x000007ae, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000007b1,
0x0000000b, 0x00000000, 0x00000001, 0x000008d9, 0x00000002, 0x00000000, 0x00000001, 0x000008e5,
0x000008f1, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000008f4, 0x0000000b,
0x00000000, 0x00000001, 0x00000a1c, 0x00000002, 0x00000000, 0x00000001, 0x00000a28, 0x00000a34,
0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000a37, 0x0000000b, 0x00000000,
0x00000001, 0x00000b33, 0x00000002, 0x00000000, 0x00000001, 0x00000b3f, 0x00000b4b, 0x00000003,
0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000b4e, 0x0000000b, 0x00000000, 0x00000001,
0x00000c9e, 0x00000002, 0x00000000, 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, 0x00000fc0, 0x00000002,
0x00000000, 0x00000001, 0x00000fcc,
};
static float get_frc(float v)
......@@ -8526,7 +8528,8 @@ 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] = -4.0f;
f[1] = -3.0f;
hr = g_var3->lpVtbl->SetFloatVector(g_var3, f);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
......@@ -8535,10 +8538,10 @@ static void test_effect_value_expression(void)
ID3D10Device_OMGetBlendState(device, &blend_state, blend_factor, &sample_mask);
ok(!blend_state, "Unexpected blend state %p.\n", blend_state);
ok(blend_factor[0] == 0.2f, "Got unexpected blend_factor[0] %.8e.\n", blend_factor[0]);
ok(blend_factor[1] == 0.2f, "Got unexpected blend_factor[1] %.8e.\n", blend_factor[1]);
ok(blend_factor[2] == 0.2f, "Got unexpected blend_factor[2] %.8e.\n", blend_factor[2]);
ok(blend_factor[3] == 0.2f, "Got unexpected blend_factor[3] %.8e.\n", blend_factor[3]);
ok(blend_factor[0] == 0.3f, "Got unexpected blend_factor[0] %.8e.\n", blend_factor[0]);
ok(blend_factor[1] == 0.3f, "Got unexpected blend_factor[1] %.8e.\n", blend_factor[1]);
ok(blend_factor[2] == 0.3f, "Got unexpected blend_factor[2] %.8e.\n", blend_factor[2]);
ok(blend_factor[3] == 0.3f, "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);
......
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