-- v4: d3d10/tests: Add some tests for trigonometric functions.
From: Nikolay Sivov nsivov@codeweavers.com
--- dlls/d3d10/effect.c | 11 ++++ dlls/d3d10/tests/effect.c | 117 ++++++++++++++++++++++++++++---------- 2 files changed, 99 insertions(+), 29 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index eb895c00866..2ce503c323b 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -379,6 +379,16 @@ static void pres_imax(float **args, unsigned int n, const struct preshader_instr } }
+static void pres_movc(float **args, unsigned int n, const struct preshader_instr *instr) +{ + float *arg1 = args[0], *arg2 = args[1], *arg3 = args[2]; + float *retval = args[3]; + unsigned int i; + + for (i = 0; i < instr->comp_count; ++i) + retval[i] = arg1[i] ? arg2[i] : arg3[i]; +} + struct preshader_op_info { int opcode; @@ -405,6 +415,7 @@ static const struct preshader_op_info preshader_ops[] = { 0x208, "div", pres_div }, { 0x21a, "udiv", pres_udiv }, { 0x21e, "imax", pres_imax }, + { 0x301, "movc", pres_movc }, };
static int __cdecl preshader_op_compare(const void *a, const void *b) diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index fc4c0e4615d..a0066bbf99d 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -8189,13 +8189,17 @@ technique10 tech { SetBlendState( NULL, g_var4.x / g_var4.y, 0 ); } + pass p10 + { + SetBlendState( NULL, g_var.x ? g_var.y : g_var.z, 0 ); + } } #endif static DWORD fx_test_value_expression[] = { - 0x43425844, 0xa05fa168, 0x4ae376c3, 0x7d2afd0a, 0x1f264749, 0x00000001, 0x00001524, 0x00000001, - 0x00000024, 0x30315846, 0x000014f8, 0xfeff1001, 0x00000001, 0x00000004, 0x00000001, 0x00000000, - 0x00000000, 0x00000000, 0x00000001, 0x00001198, 0x00000000, 0x00000000, 0x00000001, 0x00000000, + 0x43425844, 0x9a61208c, 0xd8ca913f, 0xafbac229, 0x5c5772ef, 0x00000001, 0x0000174c, 0x00000001, + 0x00000024, 0x30315846, 0x00001720, 0xfeff1001, 0x00000001, 0x00000004, 0x00000001, 0x00000000, + 0x00000000, 0x00000000, 0x00000001, 0x00001384, 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, @@ -8337,32 +8341,49 @@ static DWORD fx_test_value_expression[] = 0x00000000, 0x00000004, 0x00000001, 0x13100001, 0x00000001, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000002, 0x13100001, 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, 0x0000000a, 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, + 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00303170, 0x000001cc, 0x43425844, 0x18677c9b, + 0xf5e472af, 0x9ba288a2, 0xcca43bb2, 0x00000001, 0x000001cc, 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, 0x00000110, 0x00000005, 0x13700001, 0x00000001, + 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000007, 0x00000000, 0x30100001, 0x00000003, + 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000002, + 0x00000002, 0x00000000, 0x00000004, 0x00000000, 0x30100001, 0x00000003, 0x00000000, 0x00000007, + 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, + 0x00000004, 0x00000001, 0x30100001, 0x00000003, 0x00000000, 0x00000007, 0x00000000, 0x00000000, + 0x00000002, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004, 0x00000002, + 0x30100001, 0x00000003, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000002, 0x00000001, + 0x00000000, 0x00000002, 0x00000002, 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, 0x0000000b, 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, };
static float get_frc(float v) @@ -8566,6 +8587,44 @@ static void test_effect_value_expression(void) 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);
+ /* movc */ + 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; + 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.2f, "Got unexpected blend_factor[0] %.8e.\n", blend_factor[0]); + ok(blend_factor[1] == 2.2f, "Got unexpected blend_factor[1] %.8e.\n", blend_factor[1]); + ok(blend_factor[2] == 2.2f, "Got unexpected blend_factor[2] %.8e.\n", blend_factor[2]); + ok(blend_factor[3] == 2.2f, "Got unexpected blend_factor[3] %.8e.\n", blend_factor[3]); + ok(!sample_mask, "Got unexpected sample_mask %#x.\n", sample_mask); + + f[0] = 0.1f; + f[1] = 0.1f; + f[2] = 0.2f; + 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.1f, "Got unexpected blend_factor[0] %.8e.\n", blend_factor[0]); + ok(blend_factor[1] == 0.1f, "Got unexpected blend_factor[1] %.8e.\n", blend_factor[1]); + ok(blend_factor[2] == 0.1f, "Got unexpected blend_factor[2] %.8e.\n", blend_factor[2]); + ok(blend_factor[3] == 0.1f, "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 | 2 +- dlls/d3d10/tests/effect.c | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 2ce503c323b..e44c798aede 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -361,7 +361,7 @@ static void pres_udiv(float **args, unsigned int n, const struct preshader_instr
for (i = 0; i < instr->comp_count; ++i) { - unsigned int v = arg1[instr->scalar ? 0 : i] / arg2[i]; + unsigned int v = arg2[i] ? arg1[instr->scalar ? 0 : i] / arg2[i] : UINT_MAX; retval[i] = *(float *)&v; } } diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index a0066bbf99d..cd30e90490f 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -8587,6 +8587,26 @@ static void test_effect_value_expression(void) 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);
+ /* udiv */ + pass = t->lpVtbl->GetPassByName(t, "p9"); + ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n"); + + f[0] = 2.0f; + f[1] = 0.0f; + hr = g_var3->lpVtbl->SetFloatVector(g_var3, 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] == UINT_MAX, "Got unexpected blend_factor[0] %.8e.\n", blend_factor[0]); + ok(blend_factor[1] == UINT_MAX, "Got unexpected blend_factor[1] %.8e.\n", blend_factor[1]); + ok(blend_factor[2] == UINT_MAX, "Got unexpected blend_factor[2] %.8e.\n", blend_factor[2]); + ok(blend_factor[3] == UINT_MAX, "Got unexpected blend_factor[3] %.8e.\n", blend_factor[3]); + ok(!sample_mask, "Got unexpected sample_mask %#x.\n", sample_mask); + /* movc */ pass = t->lpVtbl->GetPassByName(t, "p10"); ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n");
From: Nikolay Sivov nsivov@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/effect.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index e44c798aede..991e03529f3 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -252,6 +252,33 @@ static void pres_cos(float **args, unsigned int n, const struct preshader_instr retval[i] = cos(args[0][i]); }
+static void pres_asin(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] = asinf(args[0][i]); +} + +static void pres_acos(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] = acosf(args[0][i]); +} + +static void pres_atan(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] = atanf(args[0][i]); +} + static void pres_ineg(float **args, unsigned int n, const struct preshader_instr *instr) { int *arg1 = (int *)args[0]; @@ -343,6 +370,15 @@ static void pres_mul(float **args, unsigned int n, const struct preshader_instr retval[i] = args[0][instr->scalar ? 0 : i] * args[1][i]; }
+static void pres_atan2(float **args, unsigned int n, const struct preshader_instr *instr) +{ + float *retval = args[2]; + unsigned int i; + + for (i = 0; i < instr->comp_count; ++i) + retval[i] = atan2f(args[0][instr->scalar ? 0 : i], args[1][i]); +} + static void pres_div(float **args, unsigned int n, const struct preshader_instr *instr) { float *retval = args[2]; @@ -403,6 +439,9 @@ static const struct preshader_op_info preshader_ops[] = { 0x104, "frc", pres_frc }, { 0x108, "sin", pres_sin }, { 0x109, "cos", pres_cos }, + { 0x10a, "asin", pres_asin }, + { 0x10b, "acos", pres_acos }, + { 0x10c, "atan", pres_atan }, { 0x120, "ineg", pres_ineg }, { 0x130, "itof", pres_itof }, { 0x131, "utof", pres_utof }, @@ -412,6 +451,7 @@ static const struct preshader_op_info preshader_ops[] = { 0x201, "max", pres_max }, { 0x204, "add", pres_add }, { 0x205, "mul", pres_mul }, + { 0x206, "atan2",pres_atan2}, { 0x208, "div", pres_div }, { 0x21a, "udiv", pres_udiv }, { 0x21e, "imax", pres_imax },
From: Nikolay Sivov nsivov@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/effect.c | 28 ++++++++ dlls/d3d10/tests/effect.c | 144 +++++++++++++++++++++++++++++--------- 2 files changed, 140 insertions(+), 32 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 991e03529f3..94192e7d0b3 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -415,6 +415,32 @@ static void pres_imax(float **args, unsigned int n, const struct preshader_instr } }
+static void pres_umin(float **args, unsigned int n, const struct preshader_instr *instr) +{ + unsigned int *arg1 = (unsigned int *)args[0], *arg2 = (unsigned int *)args[1]; + float *retval = args[2]; + unsigned int i; + + for (i = 0; i < instr->comp_count; ++i) + { + unsigned int v = min(arg1[instr->scalar ? 0 : i], arg2[i]); + retval[i] = *(float *)&v; + } +} + +static void pres_umax(float **args, unsigned int n, const struct preshader_instr *instr) +{ + unsigned int *arg1 = (unsigned int *)args[0], *arg2 = (unsigned int *)args[1]; + float *retval = args[2]; + unsigned int i; + + for (i = 0; i < instr->comp_count; ++i) + { + unsigned int v = max(arg1[instr->scalar ? 0 : i], arg2[i]); + retval[i] = *(float *)&v; + } +} + static void pres_movc(float **args, unsigned int n, const struct preshader_instr *instr) { float *arg1 = args[0], *arg2 = args[1], *arg3 = args[2]; @@ -455,6 +481,8 @@ static const struct preshader_op_info preshader_ops[] = { 0x208, "div", pres_div }, { 0x21a, "udiv", pres_udiv }, { 0x21e, "imax", pres_imax }, + { 0x21f, "umin", pres_umin }, + { 0x220, "umax", pres_umax }, { 0x301, "movc", pres_movc }, };
diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index cd30e90490f..1eb58f468e8 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -8193,13 +8193,21 @@ technique10 tech { SetBlendState( NULL, g_var.x ? g_var.y : g_var.z, 0 ); } + pass p11 + { + SetBlendState( NULL, min(g_var4.x, g_var4.y), 0 ); + } + pass p12 + { + SetBlendState( NULL, max(g_var4.x, g_var4.y), 0 ); + } } #endif static DWORD fx_test_value_expression[] = { - 0x43425844, 0x9a61208c, 0xd8ca913f, 0xafbac229, 0x5c5772ef, 0x00000001, 0x0000174c, 0x00000001, - 0x00000024, 0x30315846, 0x00001720, 0xfeff1001, 0x00000001, 0x00000004, 0x00000001, 0x00000000, - 0x00000000, 0x00000000, 0x00000001, 0x00001384, 0x00000000, 0x00000000, 0x00000001, 0x00000000, + 0x43425844, 0x54f34e21, 0x72cdbbec, 0xe1e35608, 0x72302d4b, 0x00000001, 0x00001af4, 0x00000001, + 0x00000024, 0x30315846, 0x00001ac8, 0xfeff1001, 0x00000001, 0x00000004, 0x00000001, 0x00000000, + 0x00000000, 0x00000000, 0x00000001, 0x000016b4, 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, @@ -8356,34 +8364,63 @@ static DWORD fx_test_value_expression[] = 0x00000002, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004, 0x00000002, 0x30100001, 0x00000003, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 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, 0x0000000b, 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, + 0x0000ffff, 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00313170, + 0x00000178, 0x43425844, 0xb2dec0d7, 0x6d936ace, 0x1e31a035, 0x7de038f5, 0x00000001, 0x00000178, + 0x00000003, 0x0000002c, 0x000000a8, 0x000000b4, 0x42415443, 0x00000074, 0x0000001c, 0x0000004b, + 0x46580400, 0x00000001, 0x0000001c, 0x00000100, 0x00000048, 0x00000030, 0x00000002, 0x00000001, + 0x00000038, 0x00000000, 0x61765f67, 0xab003472, 0x00020001, 0x00040001, 0x00000001, 0x00000000, + 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, + 0x656c6970, 0x30312072, 0xab00312e, 0x34494c43, 0x00000004, 0x00000000, 0x434c5846, 0x000000bc, + 0x00000005, 0x21f00001, 0x00000002, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000002, + 0x00000000, 0x00000000, 0x00000007, 0x00000000, 0x13100001, 0x00000001, 0x00000000, 0x00000007, + 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x13100001, 0x00000001, 0x00000000, 0x00000007, + 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x13100001, 0x00000001, 0x00000000, 0x00000007, + 0x00000000, 0x00000000, 0x00000004, 0x00000002, 0x13100001, 0x00000001, 0x00000000, 0x00000007, + 0x00000000, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000001, + 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00323170, 0x00000178, 0x43425844, + 0x0334f480, 0xa1c4caca, 0x9e1735e8, 0x1d8a5fb0, 0x00000001, 0x00000178, 0x00000003, 0x0000002c, + 0x000000a8, 0x000000b4, 0x42415443, 0x00000074, 0x0000001c, 0x0000004b, 0x46580400, 0x00000001, + 0x0000001c, 0x00000100, 0x00000048, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000000, + 0x61765f67, 0xab003472, 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, + 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x30312072, + 0xab00312e, 0x34494c43, 0x00000004, 0x00000000, 0x434c5846, 0x000000bc, 0x00000005, 0x22000001, + 0x00000002, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, + 0x00000007, 0x00000000, 0x13100001, 0x00000001, 0x00000000, 0x00000007, 0x00000000, 0x00000000, + 0x00000004, 0x00000000, 0x13100001, 0x00000001, 0x00000000, 0x00000007, 0x00000000, 0x00000000, + 0x00000004, 0x00000001, 0x13100001, 0x00000001, 0x00000000, 0x00000007, 0x00000000, 0x00000000, + 0x00000004, 0x00000002, 0x13100001, 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, + 0x0000000d, 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, };
static float get_frc(float v) @@ -8393,7 +8430,7 @@ static float get_frc(float v)
static void test_effect_value_expression(void) { - ID3D10EffectVectorVariable *g_var, *g_var2, *g_var3; + ID3D10EffectVectorVariable *g_var, *g_var2, *g_var3, *g_var4; ID3D10EffectDepthStencilVariable *ds; D3D10_DEPTH_STENCIL_DESC ds_desc; ID3D10BlendState *blend_state; @@ -8406,6 +8443,7 @@ static void test_effect_value_expression(void) UINT sample_mask; ULONG refcount; HRESULT hr; + int i[4];
if (!(device = create_device())) { @@ -8428,6 +8466,9 @@ static void test_effect_value_expression(void) v = effect->lpVtbl->GetVariableByName(effect, "g_var3"); g_var3 = v->lpVtbl->AsVector(v); ok(g_var3->lpVtbl->IsValid(g_var3), "Expected valid vector variable.\n"); + v = effect->lpVtbl->GetVariableByName(effect, "g_var4"); + g_var4 = v->lpVtbl->AsVector(v); + ok(g_var4->lpVtbl->IsValid(g_var4), "Expected valid vector variable.\n");
/* min/max */ pass = t->lpVtbl->GetPassByName(t, "p3"); @@ -8645,6 +8686,45 @@ static void test_effect_value_expression(void) ok(blend_factor[3] == 0.1f, "Got unexpected blend_factor[3] %.8e.\n", blend_factor[3]); ok(!sample_mask, "Got unexpected sample_mask %#x.\n", sample_mask);
+ /* umin/umax */ + pass = t->lpVtbl->GetPassByName(t, "p11"); + ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n"); + + i[0] = 3; + i[1] = 2; + 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); + ok(blend_factor[0] == 2.0f, "Got unexpected blend_factor[0] %.8e.\n", blend_factor[0]); + ok(blend_factor[1] == 2.0f, "Got unexpected blend_factor[1] %.8e.\n", blend_factor[1]); + ok(blend_factor[2] == 2.0f, "Got unexpected blend_factor[2] %.8e.\n", blend_factor[2]); + ok(blend_factor[3] == 2.0f, "Got unexpected blend_factor[3] %.8e.\n", blend_factor[3]); + ok(!sample_mask, "Got unexpected sample_mask %#x.\n", sample_mask); + + pass = t->lpVtbl->GetPassByName(t, "p12"); + ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n"); + + i[0] = 2; + i[1] = 5; + 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); + ok(blend_factor[0] == 5.0f, "Got unexpected blend_factor[0] %.8e.\n", blend_factor[0]); + ok(blend_factor[1] == 5.0f, "Got unexpected blend_factor[1] %.8e.\n", blend_factor[1]); + ok(blend_factor[2] == 5.0f, "Got unexpected blend_factor[2] %.8e.\n", blend_factor[2]); + ok(blend_factor[3] == 5.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 | 14 +++++ dlls/d3d10/tests/effect.c | 107 ++++++++++++++++++++++++++------------ 2 files changed, 87 insertions(+), 34 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 94192e7d0b3..f78b8eb4e3a 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -402,6 +402,19 @@ static void pres_udiv(float **args, unsigned int n, const struct preshader_instr } }
+static void pres_imin(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 = min(arg1[instr->scalar ? 0 : i], arg2[i]); + retval[i] = *(float *)&v; + } +} + static void pres_imax(float **args, unsigned int n, const struct preshader_instr *instr) { int *arg1 = (int *)args[0], *arg2 = (int *)args[1]; @@ -480,6 +493,7 @@ static const struct preshader_op_info preshader_ops[] = { 0x206, "atan2",pres_atan2}, { 0x208, "div", pres_div }, { 0x21a, "udiv", pres_udiv }, + { 0x21d, "imin", pres_imin }, { 0x21e, "imax", pres_imax }, { 0x21f, "umin", pres_umin }, { 0x220, "umax", pres_umax }, diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 1eb58f468e8..bee1ea363ec 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -8201,13 +8201,17 @@ technique10 tech { SetBlendState( NULL, max(g_var4.x, g_var4.y), 0 ); } + pass p13 + { + SetBlendState( NULL, min(g_var3.x, g_var3.y), 0 ); + } } #endif static DWORD fx_test_value_expression[] = { - 0x43425844, 0x54f34e21, 0x72cdbbec, 0xe1e35608, 0x72302d4b, 0x00000001, 0x00001af4, 0x00000001, - 0x00000024, 0x30315846, 0x00001ac8, 0xfeff1001, 0x00000001, 0x00000004, 0x00000001, 0x00000000, - 0x00000000, 0x00000000, 0x00000001, 0x000016b4, 0x00000000, 0x00000000, 0x00000001, 0x00000000, + 0x43425844, 0x8b2015a6, 0xacc21e49, 0x556e27b1, 0x6f2b1249, 0x00000001, 0x00001cc8, 0x00000001, + 0x00000024, 0x30315846, 0x00001c9c, 0xfeff1001, 0x00000001, 0x00000004, 0x00000001, 0x00000000, + 0x00000000, 0x00000000, 0x00000001, 0x0000184c, 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, @@ -8390,37 +8394,52 @@ static DWORD fx_test_value_expression[] = 0x00000004, 0x00000001, 0x13100001, 0x00000001, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000002, 0x13100001, 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, - 0x0000000d, 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, + 0x00000001, 0x00000002, 0x00000000, 0x00333170, 0x00000178, 0x43425844, 0x98cbead4, 0xa96cee69, + 0xfa67fbf6, 0x10832177, 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, 0x21d00001, 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, 0x0000000e, 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, };
static float get_frc(float v) @@ -8725,6 +8744,26 @@ static void test_effect_value_expression(void) ok(blend_factor[3] == 5.0f, "Got unexpected blend_factor[3] %.8e.\n", blend_factor[3]); ok(!sample_mask, "Got unexpected sample_mask %#x.\n", sample_mask);
+ /* imin */ + pass = t->lpVtbl->GetPassByName(t, "p13"); + ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n"); + + i[0] = 3; + i[1] = 5; + 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); + ok(blend_factor[0] == 3.0f, "Got unexpected blend_factor[0] %.8e.\n", blend_factor[0]); + ok(blend_factor[1] == 3.0f, "Got unexpected blend_factor[1] %.8e.\n", blend_factor[1]); + ok(blend_factor[2] == 3.0f, "Got unexpected blend_factor[2] %.8e.\n", blend_factor[2]); + ok(blend_factor[3] == 3.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 | 15 ++++++ dlls/d3d10/tests/effect.c | 110 +++++++++++++++++++++++++------------- 2 files changed, 89 insertions(+), 36 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index f78b8eb4e3a..61c76416273 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -388,6 +388,20 @@ 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_iadd(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_udiv(float **args, unsigned int n, const struct preshader_instr *instr) { unsigned int *arg1 = (unsigned int *)args[0]; @@ -492,6 +506,7 @@ static const struct preshader_op_info preshader_ops[] = { 0x205, "mul", pres_mul }, { 0x206, "atan2",pres_atan2}, { 0x208, "div", pres_div }, + { 0x216, "iadd", pres_iadd }, { 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 bee1ea363ec..bce8fd3f29e 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -8205,13 +8205,17 @@ technique10 tech { SetBlendState( NULL, min(g_var3.x, g_var3.y), 0 ); } + pass p14 + { + SetBlendState( NULL, g_var4.x + g_var4.y, 0 ); + } } #endif static DWORD fx_test_value_expression[] = { - 0x43425844, 0x8b2015a6, 0xacc21e49, 0x556e27b1, 0x6f2b1249, 0x00000001, 0x00001cc8, 0x00000001, - 0x00000024, 0x30315846, 0x00001c9c, 0xfeff1001, 0x00000001, 0x00000004, 0x00000001, 0x00000000, - 0x00000000, 0x00000000, 0x00000001, 0x0000184c, 0x00000000, 0x00000000, 0x00000001, 0x00000000, + 0x43425844, 0x42b9e7ac, 0xf8ca37f6, 0x483b59c1, 0x9cf9e2e6, 0x00000001, 0x00001e9c, 0x00000001, + 0x00000024, 0x30315846, 0x00001e70, 0xfeff1001, 0x00000001, 0x00000004, 0x00000001, 0x00000000, + 0x00000000, 0x00000000, 0x00000001, 0x000019e4, 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, @@ -8407,39 +8411,53 @@ static DWORD fx_test_value_expression[] = 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, 0x0000000e, 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, + 0x00000000, 0x00343170, 0x00000178, 0x43425844, 0xd7c8865b, 0xe0b95177, 0xcad7d001, 0x106ac5ac, + 0x00000001, 0x00000178, 0x00000003, 0x0000002c, 0x000000a8, 0x000000b4, 0x42415443, 0x00000074, + 0x0000001c, 0x0000004b, 0x46580400, 0x00000001, 0x0000001c, 0x00000100, 0x00000048, 0x00000030, + 0x00000002, 0x00000001, 0x00000038, 0x00000000, 0x61765f67, 0xab003472, 0x00020001, 0x00040001, + 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, + 0x72656461, 0x6d6f4320, 0x656c6970, 0x30312072, 0xab00312e, 0x34494c43, 0x00000004, 0x00000000, + 0x434c5846, 0x000000bc, 0x00000005, 0x21600001, 0x00000002, 0x00000000, 0x00000002, 0x00000001, + 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000007, 0x00000000, 0x13100001, 0x00000001, + 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x13100001, 0x00000001, + 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x13100001, 0x00000001, + 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000002, 0x13100001, 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, 0x0000000f, 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, };
static float get_frc(float v) @@ -8764,6 +8782,26 @@ static void test_effect_value_expression(void) ok(blend_factor[3] == 3.0f, "Got unexpected blend_factor[3] %.8e.\n", blend_factor[3]); ok(!sample_mask, "Got unexpected sample_mask %#x.\n", sample_mask);
+ /* iadd */ + pass = t->lpVtbl->GetPassByName(t, "p14"); + ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n"); + + i[0] = 3; + i[1] = 5; + 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); + ok(blend_factor[0] == 8.0f, "Got unexpected blend_factor[0] %.8e.\n", blend_factor[0]); + ok(blend_factor[1] == 8.0f, "Got unexpected blend_factor[1] %.8e.\n", blend_factor[1]); + ok(blend_factor[2] == 8.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
--- dlls/d3d10/tests/effect.c | 138 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 133 insertions(+), 5 deletions(-)
diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index bce8fd3f29e..7261ef2a80a 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -8209,13 +8209,29 @@ technique10 tech { SetBlendState( NULL, g_var4.x + g_var4.y, 0 ); } + pass p15 + { + SetBlendState( NULL, asin(g_var.x), 0 ); + } + pass p16 + { + SetBlendState( NULL, acos(g_var.x), 0 ); + } + pass p17 + { + SetBlendState( NULL, atan(g_var.x), 0 ); + } + pass p18 + { + SetBlendState( NULL, atan2(g_var.x, g_var.y), 0 ); + } } #endif static DWORD fx_test_value_expression[] = { - 0x43425844, 0x42b9e7ac, 0xf8ca37f6, 0x483b59c1, 0x9cf9e2e6, 0x00000001, 0x00001e9c, 0x00000001, - 0x00000024, 0x30315846, 0x00001e70, 0xfeff1001, 0x00000001, 0x00000004, 0x00000001, 0x00000000, - 0x00000000, 0x00000000, 0x00000001, 0x000019e4, 0x00000000, 0x00000000, 0x00000001, 0x00000000, + 0x43425844, 0x0e217d1d, 0x094ea593, 0x2f3d1951, 0x04709409, 0x00000001, 0x0000256c, 0x00000001, + 0x00000024, 0x30315846, 0x00002540, 0xfeff1001, 0x00000001, 0x00000004, 0x00000001, 0x00000000, + 0x00000000, 0x00000000, 0x00000001, 0x00001fc4, 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, @@ -8423,13 +8439,60 @@ static DWORD fx_test_value_expression[] = 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x13100001, 0x00000001, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000002, 0x13100001, 0x00000001, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, + 0x0000ffff, 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00353170, + 0x0000014c, 0x43425844, 0x858202fa, 0x6eea0ef1, 0x035697d7, 0x8937d809, 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, 0x10a00001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, + 0x00000000, 0x10a00001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, + 0x00000001, 0x10a00001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, + 0x00000002, 0x10a00001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, + 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000001, 0x00000002, 0x00000000, 0x00000001, + 0x00000002, 0x00000000, 0x00363170, 0x0000014c, 0x43425844, 0x27003e76, 0x45cf2121, 0x9b3336ae, + 0xca07856b, 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, 0x10b00001, 0x00000001, 0x00000000, 0x00000002, + 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x10b00001, 0x00000001, 0x00000000, 0x00000002, + 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x10b00001, 0x00000001, 0x00000000, 0x00000002, + 0x00000000, 0x00000000, 0x00000004, 0x00000002, 0x10b00001, 0x00000001, 0x00000000, 0x00000002, + 0x00000000, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000001, + 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00373170, 0x0000014c, 0x43425844, + 0x7a9aaef0, 0xcc3049d9, 0x1c45c020, 0xa01af792, 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, 0x10c00001, + 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x10c00001, + 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x10c00001, + 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000002, 0x10c00001, + 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, + 0x0f0f0f0f, 0x0000ffff, 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000000, + 0x00383170, 0x0000017c, 0x43425844, 0xb9755ca9, 0x574af4c2, 0x92daa707, 0xdab0053b, 0x00000001, + 0x0000017c, 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, + 0x000000c0, 0x00000004, 0x20600001, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, + 0x00000002, 0x00000001, 0x00000000, 0x00000004, 0x00000000, 0x20600001, 0x00000002, 0x00000000, + 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000004, 0x00000001, + 0x20600001, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000001, + 0x00000000, 0x00000004, 0x00000002, 0x20600001, 0x00000002, 0x00000000, 0x00000002, 0x00000000, + 0x00000000, 0x00000002, 0x00000001, 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, 0x0000000f, 0x00000000, 0x000001ba, 0x00000003, + 0x00000006, 0x000000c5, 0x00000000, 0x000001b5, 0x00000013, 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, @@ -8457,7 +8520,15 @@ static DWORD fx_test_value_expression[] = 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, + 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, };
static float get_frc(float v) @@ -8802,6 +8873,63 @@ 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);
+ /* asin */ + pass = t->lpVtbl->GetPassByName(t, "p15"); + ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n"); + + f[0] = 0.1234567f; + 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_factor[0] == asinf(f[0]), "Got unexpected blend_factor[0] %.8e.\n", blend_factor[0]); + + /* acos */ + pass = t->lpVtbl->GetPassByName(t, "p16"); + ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n"); + + f[0] = 0.1234567f; + 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_factor[0] == acosf(f[0]), "Got unexpected blend_factor[0] %.8e.\n", blend_factor[0]); + + /* atan */ + pass = t->lpVtbl->GetPassByName(t, "p17"); + ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n"); + + f[0] = 0.1234567f; + 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_factor[0] == atanf(f[0]), "Got unexpected blend_factor[0] %.8e.\n", blend_factor[0]); + + /* atan2 */ + pass = t->lpVtbl->GetPassByName(t, "p18"); + ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n"); + + f[0] = 0.1234567f; + f[1] = 0.7654321f; + 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_factor[0] == atan2f(f[0], f[1]), "Got unexpected blend_factor[0] %.8e.\n", blend_factor[0]); + effect->lpVtbl->Release(effect);
refcount = ID3D10Device_Release(device);
On Wed Mar 29 14:52:08 2023 +0000, Matteo Bruni wrote:
Cool. I think we want to try to upstream this kind of tests for now, if we start to see test failures we can make the tests laxer (e.g. introducing something like compare_float() from the d3d11 tests) or drop them selectively, depending. Thanks for looking into it :)
Okay, I pushed some tests for this.
This merge request was approved by Matteo Bruni.