d3d10/effect: Add 'neg' instruction support for expressions.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
Nikolay Sivov 2022-11-30 17:26:34 +03:00 committed by Alexandre Julliard
parent 854ecc773c
commit eb3e4b79ac
2 changed files with 30 additions and 19 deletions

View file

@ -207,6 +207,15 @@ struct preshader_instr
typedef void (*pres_op_func)(float **args, unsigned int n, const struct preshader_instr *instr);
static void pres_neg(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];
}
static void pres_ftou(float **args, unsigned int n, const struct preshader_instr *instr)
{
float *retval = args[1];
@ -255,6 +264,7 @@ struct preshader_op_info
static const struct preshader_op_info preshader_ops[] =
{
{ 0x101, "neg", pres_neg },
{ 0x133, "ftou", pres_ftou },
{ 0x200, "min", pres_min },
{ 0x201, "max", pres_max },

View file

@ -8142,7 +8142,7 @@ technique10 tech
{
pass p0
{
SetBlendState( NULL, g_var + 0.1f + g_var2, 0 );
SetBlendState( NULL, -g_var + 0.1f + g_var2, 0 );
}
pass p1
{
@ -8164,23 +8164,24 @@ technique10 tech
#endif
static DWORD fx_test_value_expression[] =
{
0x43425844, 0x20f6c3c9, 0x33c16d9f, 0xa04ed2e5, 0xf3d9ceb1, 0x00000001, 0x00000a01, 0x00000001,
0x00000024, 0x30315846, 0x000009d5, 0xfeff1001, 0x00000001, 0x00000002, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000001, 0x00000801, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x43425844, 0x88394383, 0x834c826b, 0xb85f55f9, 0xe141c400, 0x00000001, 0x00000a21, 0x00000001,
0x00000024, 0x30315846, 0x000009f5, 0xfeff1001, 0x00000001, 0x00000002, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000001, 0x00000821, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x6f6c4724,
0x736c6162, 0x6f6c6600, 0x00347461, 0x0000000d, 0x00000001, 0x00000000, 0x00000010, 0x00000010,
0x00000010, 0x0000210a, 0x61765f67, 0x5f670072, 0x32726176, 0x63657400, 0x30700068, 0x00016000,
0x42584400, 0x312ce543, 0xc3ebc897, 0xea47c0a2, 0x8a710323, 0x000001d2, 0x00016000, 0x00000300,
0x00000010, 0x0000210a, 0x61765f67, 0x5f670072, 0x32726176, 0x63657400, 0x30700068, 0x00018000,
0x42584400, 0x042b4d43, 0x89240778, 0x7627fdd4, 0xd3b7fecb, 0x0000014d, 0x00018000, 0x00000300,
0x00002c00, 0x0000d400, 0x0000f000, 0x41544300, 0x0000a042, 0x00001c00, 0x00007700, 0x58040000,
0x00000246, 0x00001c00, 0x00010000, 0x00007400, 0x00004400, 0x00000200, 0x00000100, 0x00004c00,
0x00000000, 0x00005c00, 0x01000200, 0x00000100, 0x00006400, 0x00000000, 0x765f6700, 0xab007261,
0x030001ab, 0x04000100, 0x00000100, 0x00000000, 0x765f6700, 0x00327261, 0x030001ab, 0x04000100,
0x00000100, 0x00000000, 0x00787400, 0x7263694d, 0x666f736f, 0x52282074, 0x4c482029, 0x53204c53,
0x65646168, 0x6f432072, 0x6c69706d, 0x31207265, 0x00312e30, 0x494c43ab, 0x00001434, 0x00000400,
0xcccccd00, 0x0000003d, 0x00000000, 0x00000000, 0x4c584600, 0x00006843, 0x00000200, 0x40000400,
0x00000220, 0x00000000, 0x00000200, 0x00000000, 0x00000000, 0x00000200, 0x00000400, 0x00000000,
0x00000700, 0x00000000, 0x40000400, 0x000002a0, 0x00000000, 0x00000100, 0x00000000, 0x00000000,
0x00000700, 0x00000000, 0x00000000, 0x00000400, 0x00000000, 0xf0f0f000, 0x0f0f0ff0, 0x00ffff0f,
0xcccccd00, 0x0000003d, 0x00000000, 0x00000000, 0x4c584600, 0x00008843, 0x00000300, 0x10000400,
0x00000110, 0x00000000, 0x00000200, 0x00000000, 0x00000000, 0x00000700, 0x00000000, 0x40000400,
0x00000220, 0x00000000, 0x00000700, 0x00000000, 0x00000000, 0x00000200, 0x00000400, 0x00000000,
0x00000700, 0x00000400, 0x40000400, 0x000002a0, 0x00000000, 0x00000100, 0x00000000, 0x00000000,
0x00000700, 0x00000400, 0x00000000, 0x00000400, 0x00000000, 0xf0f0f000, 0x0f0f0ff0, 0x00ffff0f,
0x00000100, 0x00000200, 0x00000000, 0x00000100, 0x00000200, 0x00000000, 0x00317000, 0x00000150,
0x43425844, 0xc6a29e4c, 0x6292ed35, 0xd90bb8cb, 0x50dcd25f, 0x00000001, 0x00000150, 0x00000003,
0x0000002c, 0x000000d4, 0x000000e0, 0x42415443, 0x000000a0, 0x0000001c, 0x00000077, 0x46580400,
@ -8235,15 +8236,15 @@ static DWORD fx_test_value_expression[] =
0x00000000, 0x00000200, 0xffffff00, 0x000000ff, 0x00003000, 0x00001400, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00003600, 0x00001400, 0x00000000, 0x00001000, 0x00000000,
0x00000000, 0x00000000, 0x00003d00, 0x00000500, 0x00000000, 0x00004200, 0x00000300, 0x00000000,
0x00000a00, 0x00000000, 0x00000600, 0x00004500, 0x00000b00, 0x00000000, 0x00000100, 0x0001a900,
0x00000200, 0x00000000, 0x00000100, 0x0001b500, 0x0001c100, 0x00000300, 0x00000000, 0x00000a00,
0x00000000, 0x00000600, 0x0001c400, 0x00000b00, 0x00000000, 0x00000100, 0x00031800, 0x00000200,
0x00000000, 0x00000100, 0x00032400, 0x00033000, 0x00000300, 0x00000000, 0x00000a00, 0x00000000,
0x00000600, 0x00033300, 0x00000b00, 0x00000000, 0x00000100, 0x00056300, 0x00000200, 0x00000000,
0x00000100, 0x00056f00, 0x00057b00, 0x00000300, 0x00000000, 0x00000a00, 0x00000000, 0x00000600,
0x00057e00, 0x00000b00, 0x00000000, 0x00000100, 0x0006a600, 0x00000200, 0x00000000, 0x00000100,
0x0006b200, 0x0006be00, 0x00000300, 0x00000000, 0x00000a00, 0x00000000, 0x00000600, 0x0006c100,
0x00000b00, 0x00000000, 0x00000100, 0x0007e900, 0x00000200, 0x00000000, 0x00000100, 0x0007f500,
0x00000a00, 0x00000000, 0x00000600, 0x00004500, 0x00000b00, 0x00000000, 0x00000100, 0x0001c900,
0x00000200, 0x00000000, 0x00000100, 0x0001d500, 0x0001e100, 0x00000300, 0x00000000, 0x00000a00,
0x00000000, 0x00000600, 0x0001e400, 0x00000b00, 0x00000000, 0x00000100, 0x00033800, 0x00000200,
0x00000000, 0x00000100, 0x00034400, 0x00035000, 0x00000300, 0x00000000, 0x00000a00, 0x00000000,
0x00000600, 0x00035300, 0x00000b00, 0x00000000, 0x00000100, 0x00058300, 0x00000200, 0x00000000,
0x00000100, 0x00058f00, 0x00059b00, 0x00000300, 0x00000000, 0x00000a00, 0x00000000, 0x00000600,
0x00059e00, 0x00000b00, 0x00000000, 0x00000100, 0x0006c600, 0x00000200, 0x00000000, 0x00000100,
0x0006d200, 0x0006de00, 0x00000300, 0x00000000, 0x00000a00, 0x00000000, 0x00000600, 0x0006e100,
0x00000b00, 0x00000000, 0x00000100, 0x00080900, 0x00000200, 0x00000000, 0x00000100, 0x00081500,
0x00000000,
};