wined3d: Don't use the opcode_token field in the ARB backend.

This commit is contained in:
Henri Verbeet 2009-04-01 12:23:00 +02:00 committed by Alexandre Julliard
parent ec43489e10
commit e44335585e
3 changed files with 13 additions and 16 deletions

View File

@ -827,7 +827,7 @@ static void pshader_hw_cnd(const SHADER_OPCODE_ARG *arg)
pshader_gen_input_modifier_line(arg->shader, buffer, arg->src[2], 2, src_name[2]); pshader_gen_input_modifier_line(arg->shader, buffer, arg->src[2], 2, src_name[2]);
/* The coissue flag changes the semantic of the cnd instruction in <= 1.3 shaders */ /* The coissue flag changes the semantic of the cnd instruction in <= 1.3 shaders */
if (arg->reg_maps->shader_version <= WINED3DPS_VERSION(1, 3) && arg->opcode_token & WINED3DSI_COISSUE) if (arg->reg_maps->shader_version <= WINED3DPS_VERSION(1, 3) && arg->coissue)
{ {
shader_addline(buffer, "MOV%s %s%s, %s;\n", sat ? "_SAT" : "", dst_name, dst_wmask, src_name[1]); shader_addline(buffer, "MOV%s %s%s, %s;\n", sat ? "_SAT" : "", dst_name, dst_wmask, src_name[1]);
} else { } else {
@ -1139,12 +1139,8 @@ static void pshader_hw_tex(const SHADER_OPCODE_ARG *arg)
projected = TRUE; projected = TRUE;
} }
} else { } else {
if(arg->opcode_token & WINED3DSI_TEXLD_PROJECT) { if (arg->flags & WINED3DSI_TEXLD_PROJECT) projected = TRUE;
projected = TRUE; if (arg->flags & WINED3DSI_TEXLD_BIAS) bias = TRUE;
}
if(arg->opcode_token & WINED3DSI_TEXLD_BIAS) {
bias = TRUE;
}
} }
shader_hw_sample(arg, reg_sampler_code, reg_dest, reg_coord, projected, bias); shader_hw_sample(arg, reg_sampler_code, reg_dest, reg_coord, projected, bias);
} }

View File

@ -785,6 +785,8 @@ void shader_generate_main(IWineD3DBaseShader *iface, SHADER_BUFFER* buffer,
while (WINED3DPS_END() != *pToken) while (WINED3DPS_END() != *pToken)
{ {
DWORD opcode_token;
/* Skip version token */ /* Skip version token */
if (shader_is_version_token(*pToken)) if (shader_is_version_token(*pToken))
{ {
@ -801,13 +803,13 @@ void shader_generate_main(IWineD3DBaseShader *iface, SHADER_BUFFER* buffer,
} }
/* Read opcode */ /* Read opcode */
hw_arg.opcode_token = *pToken++; opcode_token = *pToken++;
curOpcode = shader_get_opcode(opcode_table, shader_version, hw_arg.opcode_token); curOpcode = shader_get_opcode(opcode_table, shader_version, opcode_token);
/* Unknown opcode and its parameters */ /* Unknown opcode and its parameters */
if (!curOpcode) if (!curOpcode)
{ {
FIXME("Unrecognized opcode: token=0x%08x\n", hw_arg.opcode_token); FIXME("Unrecognized opcode: token=0x%08x\n", opcode_token);
pToken += shader_skip_unrecognized(pToken, shader_version); pToken += shader_skip_unrecognized(pToken, shader_version);
continue; continue;
} }
@ -821,7 +823,7 @@ void shader_generate_main(IWineD3DBaseShader *iface, SHADER_BUFFER* buffer,
|| WINED3DSIO_PHASE == curOpcode->opcode || WINED3DSIO_PHASE == curOpcode->opcode
|| WINED3DSIO_RET == curOpcode->opcode) || WINED3DSIO_RET == curOpcode->opcode)
{ {
pToken += shader_skip_opcode(curOpcode, hw_arg.opcode_token, shader_version); pToken += shader_skip_opcode(curOpcode, opcode_token, shader_version);
continue; continue;
} }
@ -832,14 +834,14 @@ void shader_generate_main(IWineD3DBaseShader *iface, SHADER_BUFFER* buffer,
if (!hw_fct) if (!hw_fct)
{ {
FIXME("Can't handle opcode %s in hwShader\n", curOpcode->name); FIXME("Can't handle opcode %s in hwShader\n", curOpcode->name);
pToken += shader_skip_opcode(curOpcode, hw_arg.opcode_token, shader_version); pToken += shader_skip_opcode(curOpcode, opcode_token, shader_version);
continue; continue;
} }
hw_arg.opcode = curOpcode; hw_arg.opcode = curOpcode;
hw_arg.flags = hw_arg.opcode_token & WINED3D_OPCODESPECIFICCONTROL_MASK; hw_arg.flags = opcode_token & WINED3D_OPCODESPECIFICCONTROL_MASK;
hw_arg.coissue = hw_arg.opcode_token & WINED3DSI_COISSUE; hw_arg.coissue = opcode_token & WINED3DSI_COISSUE;
/* Destination token */ /* Destination token */
if (curOpcode->dst_token) if (curOpcode->dst_token)
@ -851,7 +853,7 @@ void shader_generate_main(IWineD3DBaseShader *iface, SHADER_BUFFER* buffer,
} }
/* Predication token */ /* Predication token */
if (hw_arg.opcode_token & WINED3DSHADER_INSTRUCTION_PREDICATED) hw_arg.predicate = *pToken++; if (opcode_token & WINED3DSHADER_INSTRUCTION_PREDICATED) hw_arg.predicate = *pToken++;
/* Other source tokens */ /* Other source tokens */
for (i = 0; i < (curOpcode->num_params - curOpcode->dst_token); ++i) for (i = 0; i < (curOpcode->num_params - curOpcode->dst_token); ++i)

View File

@ -2243,7 +2243,6 @@ typedef struct SHADER_OPCODE_ARG {
IWineD3DBaseShader* shader; IWineD3DBaseShader* shader;
const shader_reg_maps *reg_maps; const shader_reg_maps *reg_maps;
CONST SHADER_OPCODE* opcode; CONST SHADER_OPCODE* opcode;
DWORD opcode_token;
DWORD flags; DWORD flags;
BOOL coissue; BOOL coissue;
DWORD dst; DWORD dst;