From: Nikolay Sivov nsivov@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/effect.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index c62cb54bcd4..e1a0231c6c7 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -207,6 +207,11 @@ struct preshader_instr
typedef void (*pres_op_func)(float **args, unsigned int n, const struct preshader_instr *instr);
+static void pres_mov(float **args, unsigned int n, const struct preshader_instr *instr) +{ + *args[1] = *args[0]; +} + static void pres_neg(float **args, unsigned int n, const struct preshader_instr *instr) { float *retval = args[1]; @@ -632,15 +637,36 @@ static void pres_movc(float **args, unsigned int n, const struct preshader_instr retval[i] = src0[i] ? src1[i] : src2[i]; }
+static void pres_dot(float **args, unsigned int n, const struct preshader_instr *instr) +{ + float *retval = args[2]; + unsigned int i; + + *retval = 0.0f; + for (i = 0; i < instr->comp_count; ++i) + *retval += args[0][instr->scalar ? 0 : i] * args[1][i]; +} + +static void pres_dotswiz(float **args, unsigned int n, const struct preshader_instr *instr) +{ + float *retval = args[n]; + unsigned int i; + + *retval = 0.0f; + for (i = 0; i < n; ++i) + *retval += *args[i] * *args[i + n / 2]; +} + struct preshader_op_info { int opcode; - char name[8]; + char name[16]; pres_op_func func; };
static const struct preshader_op_info preshader_ops[] = { + { 0x100, "mov", pres_mov }, { 0x101, "neg", pres_neg }, { 0x103, "rcp", pres_rcp }, { 0x104, "frc", pres_frc }, @@ -678,6 +704,8 @@ static const struct preshader_op_info preshader_ops[] = { 0x235, "ishr", pres_ishr }, { 0x236, "ushr", pres_ushr }, { 0x301, "movc", pres_movc }, + { 0x500, "dot", pres_dot }, + { 0x70e, "d3ds_dotswiz", pres_dotswiz }, };
static int __cdecl preshader_op_compare(const void *a, const void *b)