wined3d: Handle the opcode specific control shift in the frontend rather than the backend.

This commit is contained in:
Henri Verbeet 2009-04-24 09:17:58 +02:00 committed by Alexandre Julliard
parent 234f167d9d
commit 35499d0c3c
4 changed files with 6 additions and 11 deletions

View File

@ -967,7 +967,7 @@ void shader_generate_main(IWineD3DBaseShader *iface, SHADER_BUFFER* buffer,
} }
ins.handler_idx = curOpcode->handler_idx; ins.handler_idx = curOpcode->handler_idx;
ins.flags = opcode_token & WINED3D_OPCODESPECIFICCONTROL_MASK; ins.flags = (opcode_token & WINED3D_OPCODESPECIFICCONTROL_MASK) >> WINED3D_OPCODESPECIFICCONTROL_SHIFT;
ins.coissue = opcode_token & WINED3DSI_COISSUE; ins.coissue = opcode_token & WINED3DSI_COISSUE;
/* Destination token */ /* Destination token */
@ -1146,7 +1146,7 @@ void shader_trace_init(const DWORD *pFunction, const SHADER_OPCODE *opcode_table
if (curOpcode->opcode == WINED3DSIO_IFC if (curOpcode->opcode == WINED3DSIO_IFC
|| curOpcode->opcode == WINED3DSIO_BREAKC) || curOpcode->opcode == WINED3DSIO_BREAKC)
{ {
DWORD op = (opcode_token & INST_CONTROLS_MASK) >> INST_CONTROLS_SHIFT; DWORD op = (opcode_token & WINED3D_OPCODESPECIFICCONTROL_MASK) >> WINED3D_OPCODESPECIFICCONTROL_SHIFT;
switch (op) switch (op)
{ {
@ -1161,7 +1161,7 @@ void shader_trace_init(const DWORD *pFunction, const SHADER_OPCODE *opcode_table
} }
else if (curOpcode->opcode == WINED3DSIO_TEX else if (curOpcode->opcode == WINED3DSIO_TEX
&& shader_version >= WINED3DPS_VERSION(2,0) && shader_version >= WINED3DPS_VERSION(2,0)
&& (opcode_token & WINED3DSI_TEXLD_PROJECT)) && (opcode_token & (WINED3DSI_TEXLD_PROJECT << WINED3D_OPCODESPECIFICCONTROL_SHIFT)))
{ {
TRACE("p"); TRACE("p");
} }

View File

@ -1351,9 +1351,8 @@ void shader_glsl_add_instruction_modifiers(const struct wined3d_shader_instructi
} }
} }
static inline const char *shader_get_comp_op(DWORD flags) static inline const char *shader_get_comp_op(DWORD op)
{ {
DWORD op = (flags & INST_CONTROLS_MASK) >> INST_CONTROLS_SHIFT;
switch (op) { switch (op) {
case COMPARISON_GT: return ">"; case COMPARISON_GT: return ">";
case COMPARISON_EQ: return "=="; case COMPARISON_EQ: return "==";

View File

@ -2253,10 +2253,6 @@ typedef struct local_constant {
DWORD value[4]; DWORD value[4];
} local_constant; } local_constant;
/* Undocumented opcode controls */
#define INST_CONTROLS_SHIFT 16
#define INST_CONTROLS_MASK 0x00ff0000
typedef enum COMPARISON_TYPE { typedef enum COMPARISON_TYPE {
COMPARISON_GT = 1, COMPARISON_GT = 1,
COMPARISON_EQ = 2, COMPARISON_EQ = 2,

View File

@ -213,8 +213,8 @@ typedef enum _WINED3DSHADER_INSTRUCTION_OPCODE_TYPE {
} WINED3DSHADER_INSTRUCTION_OPCODE_TYPE; } WINED3DSHADER_INSTRUCTION_OPCODE_TYPE;
/* Undocumented opcode control to identify projective texture lookups in ps 2.0 and later */ /* Undocumented opcode control to identify projective texture lookups in ps 2.0 and later */
#define WINED3DSI_TEXLD_PROJECT 0x00010000 #define WINED3DSI_TEXLD_PROJECT 1
#define WINED3DSI_TEXLD_BIAS 0x00020000 #define WINED3DSI_TEXLD_BIAS 2
/** Shader version tokens, and shader end tokens **/ /** Shader version tokens, and shader end tokens **/