wined3d: Make it more obvious the pshader path in shader_hw_map2gl() doesn't handle opcodes without parameters.

This commit is contained in:
Henri Verbeet 2008-11-19 11:49:13 +01:00 committed by Alexandre Julliard
parent 29f2fefc2b
commit bd427f58a0
1 changed files with 32 additions and 32 deletions

View File

@ -1095,11 +1095,21 @@ static void shader_hw_map2gl(SHADER_OPCODE_ARG* arg)
if (shader_is_pshader_version(shader->baseShader.hex_version))
{
/* Output token related */
char output_rname[256];
char output_wmask[20];
char operands[4][100];
BOOL saturate = FALSE;
BOOL centroid = FALSE;
BOOL partialprecision = FALSE;
DWORD shift;
if (!curOpcode->num_params)
{
ERR("Opcode \"%s\" has no parameters\n", curOpcode->name);
return;
}
strcpy(tmpLine, curOpcode->glname);
/* Process modifiers */
@ -1119,40 +1129,30 @@ static void shader_hw_map2gl(SHADER_OPCODE_ARG* arg)
}
shift = (dst & WINED3DSP_DSTSHIFT_MASK) >> WINED3DSP_DSTSHIFT_SHIFT;
/* Generate input and output registers */
if (curOpcode->num_params > 0)
/* Generate input register names (with modifiers) */
for (i = 1; i < curOpcode->num_params; ++i)
pshader_gen_input_modifier_line(arg->shader, buffer, src[i-1], i-1, operands[i]);
/* Handle output register */
pshader_get_register_name(arg->shader, dst, output_rname);
strcpy(operands[0], output_rname);
shader_arb_get_write_mask(arg, dst, output_wmask);
strcat(operands[0], output_wmask);
if (saturate && (shift == 0))
strcat(tmpLine, "_SAT");
strcat(tmpLine, " ");
strcat(tmpLine, operands[0]);
for (i = 1; i < curOpcode->num_params; i++)
{
/* Output token related */
char output_rname[256];
char output_wmask[20];
char operands[4][100];
/* Generate input register names (with modifiers) */
for (i = 1; i < curOpcode->num_params; ++i)
pshader_gen_input_modifier_line(arg->shader, buffer, src[i-1], i-1, operands[i]);
/* Handle output register */
pshader_get_register_name(arg->shader, dst, output_rname);
strcpy(operands[0], output_rname);
shader_arb_get_write_mask(arg, dst, output_wmask);
strcat(operands[0], output_wmask);
if (saturate && (shift == 0))
strcat(tmpLine, "_SAT");
strcat(tmpLine, " ");
strcat(tmpLine, operands[0]);
for (i = 1; i < curOpcode->num_params; i++)
{
strcat(tmpLine, ", ");
strcat(tmpLine, operands[i]);
}
strcat(tmpLine,";\n");
shader_addline(buffer, tmpLine);
/* A shift requires another line. */
if (shift != 0)
pshader_gen_output_modifier_line(buffer, saturate, output_wmask, shift, output_rname);
strcat(tmpLine, ", ");
strcat(tmpLine, operands[i]);
}
strcat(tmpLine,";\n");
shader_addline(buffer, tmpLine);
/* A shift requires another line. */
if (shift) pshader_gen_output_modifier_line(buffer, saturate, output_wmask, shift, output_rname);
} else {
if ((curOpcode->opcode == WINED3DSIO_MOV && shader_get_regtype(dst) == WINED3DSPR_ADDR)
|| curOpcode->opcode == WINED3DSIO_MOVA) {