wined3d: The "input" parameter to shader_dump_param() should be a BOOL.

It's used to determine if the token is a source or destination parameter. A
subsequent patch will split shader_dump_param() in two different functions.
This commit is contained in:
Henri Verbeet 2009-04-29 09:55:07 +02:00 committed by Alexandre Julliard
parent 42a8041cb8
commit 52644ab053
1 changed files with 17 additions and 15 deletions

View File

@ -94,7 +94,7 @@ typedef enum _WINED3DSHADER_ADDRESSMODE_TYPE
WINED3DSHADER_ADDRMODE_FORCE_DWORD = 0x7fffffff, WINED3DSHADER_ADDRMODE_FORCE_DWORD = 0x7fffffff,
} WINED3DSHADER_ADDRESSMODE_TYPE; } WINED3DSHADER_ADDRESSMODE_TYPE;
static void shader_dump_param(const DWORD param, const DWORD addr_token, int input, DWORD shader_version); static void shader_dump_param(const DWORD param, const DWORD addr_token, BOOL is_src, DWORD shader_version);
/* Read a parameter opcode from the input stream, /* Read a parameter opcode from the input stream,
* and possibly a relative addressing token. * and possibly a relative addressing token.
@ -902,7 +902,7 @@ static void shader_dump_decl_usage(DWORD decl, DWORD param, DWORD shader_version
} }
static void shader_dump_arr_entry(const DWORD param, const DWORD addr_token, static void shader_dump_arr_entry(const DWORD param, const DWORD addr_token,
unsigned int reg, int input, DWORD shader_version) unsigned int reg, BOOL is_src, DWORD shader_version)
{ {
char relative = char relative =
((param & WINED3DSHADER_ADDRESSMODE_MASK) == WINED3DSHADER_ADDRMODE_RELATIVE); ((param & WINED3DSHADER_ADDRESSMODE_MASK) == WINED3DSHADER_ADDRMODE_RELATIVE);
@ -910,7 +910,7 @@ static void shader_dump_arr_entry(const DWORD param, const DWORD addr_token,
if (relative) { if (relative) {
TRACE("["); TRACE("[");
if (addr_token) if (addr_token)
shader_dump_param(addr_token, 0, input, shader_version); shader_dump_param(addr_token, 0, is_src, shader_version);
else else
TRACE("a0.x"); TRACE("a0.x");
TRACE(" + "); TRACE(" + ");
@ -920,7 +920,7 @@ static void shader_dump_arr_entry(const DWORD param, const DWORD addr_token,
TRACE("]"); TRACE("]");
} }
static void shader_dump_param(const DWORD param, const DWORD addr_token, int input, DWORD shader_version) static void shader_dump_param(const DWORD param, const DWORD addr_token, BOOL is_src, DWORD shader_version)
{ {
static const char * const rastout_reg_names[] = { "oPos", "oFog", "oPts" }; static const char * const rastout_reg_names[] = { "oPos", "oFog", "oPts" };
static const char * const misctype_reg_names[] = { "vPos", "vFace"}; static const char * const misctype_reg_names[] = { "vPos", "vFace"};
@ -933,7 +933,8 @@ static void shader_dump_param(const DWORD param, const DWORD addr_token, int inp
/* There are some minor differences between pixel and vertex shaders */ /* There are some minor differences between pixel and vertex shaders */
char pshader = shader_is_pshader_version(shader_version); char pshader = shader_is_pshader_version(shader_version);
if (input) { if (is_src)
{
if ( (modifier == WINED3DSPSM_NEG) || if ( (modifier == WINED3DSPSM_NEG) ||
(modifier == WINED3DSPSM_BIASNEG) || (modifier == WINED3DSPSM_BIASNEG) ||
(modifier == WINED3DSPSM_SIGNNEG) || (modifier == WINED3DSPSM_SIGNNEG) ||
@ -955,14 +956,14 @@ static void shader_dump_param(const DWORD param, const DWORD addr_token, int inp
break; break;
case WINED3DSPR_INPUT: case WINED3DSPR_INPUT:
TRACE("v"); TRACE("v");
shader_dump_arr_entry(param, addr_token, reg, input, shader_version); shader_dump_arr_entry(param, addr_token, reg, is_src, shader_version);
break; break;
case WINED3DSPR_CONST: case WINED3DSPR_CONST:
case WINED3DSPR_CONST2: case WINED3DSPR_CONST2:
case WINED3DSPR_CONST3: case WINED3DSPR_CONST3:
case WINED3DSPR_CONST4: case WINED3DSPR_CONST4:
TRACE("c"); TRACE("c");
shader_dump_arr_entry(param, addr_token, shader_get_float_offset(param), input, shader_version); shader_dump_arr_entry(param, addr_token, shader_get_float_offset(param), is_src, shader_version);
break; break;
case WINED3DSPR_TEXTURE: /* vs: case D3DSPR_ADDR */ case WINED3DSPR_TEXTURE: /* vs: case D3DSPR_ADDR */
TRACE("%c%u", (pshader? 't':'a'), reg); TRACE("%c%u", (pshader? 't':'a'), reg);
@ -986,18 +987,18 @@ static void shader_dump_param(const DWORD param, const DWORD addr_token, int inp
if (WINED3DSHADER_VERSION_MAJOR(shader_version) >= 3) { if (WINED3DSHADER_VERSION_MAJOR(shader_version) >= 3) {
TRACE("o"); TRACE("o");
shader_dump_arr_entry(param, addr_token, reg, input, shader_version); shader_dump_arr_entry(param, addr_token, reg, is_src, shader_version);
} }
else else
TRACE("oT%u", reg); TRACE("oT%u", reg);
break; break;
case WINED3DSPR_CONSTINT: case WINED3DSPR_CONSTINT:
TRACE("i"); TRACE("i");
shader_dump_arr_entry(param, addr_token, reg, input, shader_version); shader_dump_arr_entry(param, addr_token, reg, is_src, shader_version);
break; break;
case WINED3DSPR_CONSTBOOL: case WINED3DSPR_CONSTBOOL:
TRACE("b"); TRACE("b");
shader_dump_arr_entry(param, addr_token, reg, input, shader_version); shader_dump_arr_entry(param, addr_token, reg, is_src, shader_version);
break; break;
case WINED3DSPR_LABEL: case WINED3DSPR_LABEL:
TRACE("l%u", reg); TRACE("l%u", reg);
@ -1023,7 +1024,8 @@ static void shader_dump_param(const DWORD param, const DWORD addr_token, int inp
break; break;
} }
if (!input) { if (!is_src)
{
/* operand output (for modifiers and shift, see dump_ins_modifiers) */ /* operand output (for modifiers and shift, see dump_ins_modifiers) */
if ((param & WINED3DSP_WRITEMASK_ALL) != WINED3DSP_WRITEMASK_ALL) { if ((param & WINED3DSP_WRITEMASK_ALL) != WINED3DSP_WRITEMASK_ALL) {
@ -1262,7 +1264,7 @@ void shader_trace_init(const DWORD *pFunction, const SHADER_OPCODE *opcode_table
shader_dump_decl_usage(usage, param, shader_version); shader_dump_decl_usage(usage, param, shader_version);
shader_dump_ins_modifiers(param); shader_dump_ins_modifiers(param);
TRACE(" "); TRACE(" ");
shader_dump_param(param, 0, 0, shader_version); shader_dump_param(param, 0, FALSE, shader_version);
pToken += 2; pToken += 2;
} }
else if (ins.handler_idx == WINED3DSIH_DEF) else if (ins.handler_idx == WINED3DSIH_DEF)
@ -1301,7 +1303,7 @@ void shader_trace_init(const DWORD *pFunction, const SHADER_OPCODE *opcode_table
if (ins.predicate) if (ins.predicate)
{ {
TRACE("("); TRACE("(");
shader_dump_param(*(pToken + 2), 0, 1, shader_version); shader_dump_param(*(pToken + 2), 0, TRUE, shader_version);
TRACE(") "); TRACE(") ");
} }
@ -1339,7 +1341,7 @@ void shader_trace_init(const DWORD *pFunction, const SHADER_OPCODE *opcode_table
shader_dump_ins_modifiers(param); shader_dump_ins_modifiers(param);
TRACE(" "); TRACE(" ");
shader_dump_param(param, addr_token, 0, shader_version); shader_dump_param(param, addr_token, FALSE, shader_version);
} }
/* Predication token - already printed out, just skip it */ /* Predication token - already printed out, just skip it */
@ -1352,7 +1354,7 @@ void shader_trace_init(const DWORD *pFunction, const SHADER_OPCODE *opcode_table
pToken += tokens_read; pToken += tokens_read;
TRACE((i == 0)? " " : ", "); TRACE((i == 0)? " " : ", ");
shader_dump_param(param, addr_token, 1, shader_version); shader_dump_param(param, addr_token, TRUE, shader_version);
} }
} }
TRACE("\n"); TRACE("\n");