Commit 19b799fd authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

d3d10/effect: Add support for udiv instruction.

parent c96c6b98
......@@ -274,6 +274,15 @@ static void pres_itof(float **args, unsigned int n, const struct preshader_instr
retval[i] = *(int *)&args[0][i];
}
static void pres_utof(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] = *(unsigned int *)&args[0][i];
}
static void pres_ftou(float **args, unsigned int n, const struct preshader_instr *instr)
{
float *retval = args[1];
......@@ -343,6 +352,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_udiv(float **args, unsigned int n, const struct preshader_instr *instr)
{
unsigned int *arg1 = (unsigned int *)args[0];
unsigned int *arg2 = (unsigned int *)args[1];
float *retval = args[2];
unsigned int i;
for (i = 0; i < instr->comp_count; ++i)
{
unsigned int v = 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];
......@@ -372,6 +395,7 @@ static const struct preshader_op_info preshader_ops[] =
{ 0x109, "cos", pres_cos },
{ 0x120, "ineg", pres_ineg },
{ 0x130, "itof", pres_itof },
{ 0x131, "utof", pres_utof },
{ 0x133, "ftou", pres_ftou },
{ 0x137, "ftob", pres_ftob },
{ 0x200, "min", pres_min },
......@@ -379,6 +403,7 @@ static const struct preshader_op_info preshader_ops[] =
{ 0x204, "add", pres_add },
{ 0x205, "mul", pres_mul },
{ 0x208, "div", pres_div },
{ 0x21a, "udiv", pres_udiv },
{ 0x21e, "imax", pres_imax },
};
......
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