wined3d: Remove the opcode field from struct wined3d_shader_instruction.
This commit is contained in:
parent
29c9dc989d
commit
04b2e0b19b
|
@ -1541,9 +1541,6 @@ static void shader_hw_mnxn(const struct wined3d_shader_instruction *ins)
|
||||||
int i;
|
int i;
|
||||||
int nComponents = 0;
|
int nComponents = 0;
|
||||||
struct wined3d_shader_instruction tmp_ins;
|
struct wined3d_shader_instruction tmp_ins;
|
||||||
IWineD3DBaseShaderImpl *shader = (IWineD3DBaseShaderImpl *)ins->shader;
|
|
||||||
const SHADER_OPCODE *opcode_table = shader->baseShader.shader_ins;
|
|
||||||
DWORD shader_version = ins->reg_maps->shader_version;
|
|
||||||
|
|
||||||
memset(&tmp_ins, 0, sizeof(tmp_ins));
|
memset(&tmp_ins, 0, sizeof(tmp_ins));
|
||||||
|
|
||||||
|
@ -1554,36 +1551,36 @@ static void shader_hw_mnxn(const struct wined3d_shader_instruction *ins)
|
||||||
tmp_ins.src_addr[0] = ins->src_addr[0];
|
tmp_ins.src_addr[0] = ins->src_addr[0];
|
||||||
tmp_ins.src_addr[1] = ins->src_addr[1];
|
tmp_ins.src_addr[1] = ins->src_addr[1];
|
||||||
tmp_ins.reg_maps = ins->reg_maps;
|
tmp_ins.reg_maps = ins->reg_maps;
|
||||||
|
tmp_ins.dst_count = 1;
|
||||||
|
tmp_ins.src_count = 2;
|
||||||
|
|
||||||
switch(ins->handler_idx)
|
switch(ins->handler_idx)
|
||||||
{
|
{
|
||||||
case WINED3DSIH_M4x4:
|
case WINED3DSIH_M4x4:
|
||||||
nComponents = 4;
|
nComponents = 4;
|
||||||
tmp_ins.opcode = shader_get_opcode(opcode_table, shader_version, WINED3DSIO_DP4);
|
tmp_ins.handler_idx = WINED3DSIH_DP4;
|
||||||
break;
|
break;
|
||||||
case WINED3DSIH_M4x3:
|
case WINED3DSIH_M4x3:
|
||||||
nComponents = 3;
|
nComponents = 3;
|
||||||
tmp_ins.opcode = shader_get_opcode(opcode_table, shader_version, WINED3DSIO_DP4);
|
tmp_ins.handler_idx = WINED3DSIH_DP4;
|
||||||
break;
|
break;
|
||||||
case WINED3DSIH_M3x4:
|
case WINED3DSIH_M3x4:
|
||||||
nComponents = 4;
|
nComponents = 4;
|
||||||
tmp_ins.opcode = shader_get_opcode(opcode_table, shader_version, WINED3DSIO_DP3);
|
tmp_ins.handler_idx = WINED3DSIH_DP3;
|
||||||
break;
|
break;
|
||||||
case WINED3DSIH_M3x3:
|
case WINED3DSIH_M3x3:
|
||||||
nComponents = 3;
|
nComponents = 3;
|
||||||
tmp_ins.opcode = shader_get_opcode(opcode_table, shader_version, WINED3DSIO_DP3);
|
tmp_ins.handler_idx = WINED3DSIH_DP3;
|
||||||
break;
|
break;
|
||||||
case WINED3DSIH_M3x2:
|
case WINED3DSIH_M3x2:
|
||||||
nComponents = 2;
|
nComponents = 2;
|
||||||
tmp_ins.opcode = shader_get_opcode(opcode_table, shader_version, WINED3DSIO_DP3);
|
tmp_ins.handler_idx = WINED3DSIH_DP3;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
FIXME("Unhandled opcode %#x\n", ins->handler_idx);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp_ins.handler_idx = tmp_ins.opcode->handler_idx;
|
|
||||||
tmp_ins.dst_count = tmp_ins.opcode->dst_token ? 1 : 0;
|
|
||||||
tmp_ins.src_count = tmp_ins.opcode->num_params - tmp_ins.dst_count;
|
|
||||||
for (i = 0; i < nComponents; i++) {
|
for (i = 0; i < nComponents; i++) {
|
||||||
tmp_ins.dst = ((ins->dst) & ~WINED3DSP_WRITEMASK_ALL)|(WINED3DSP_WRITEMASK_0<<i);
|
tmp_ins.dst = ((ins->dst) & ~WINED3DSP_WRITEMASK_ALL)|(WINED3DSP_WRITEMASK_0<<i);
|
||||||
tmp_ins.src[1] = ins->src[1]+i;
|
tmp_ins.src[1] = ins->src[1]+i;
|
||||||
|
|
|
@ -838,8 +838,6 @@ void shader_generate_main(IWineD3DBaseShader *iface, SHADER_BUFFER* buffer,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
ins.opcode = curOpcode;
|
|
||||||
|
|
||||||
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;
|
||||||
ins.coissue = opcode_token & WINED3DSI_COISSUE;
|
ins.coissue = opcode_token & WINED3DSI_COISSUE;
|
||||||
|
|
|
@ -2032,9 +2032,6 @@ static void shader_glsl_mad(const struct wined3d_shader_instruction *ins)
|
||||||
Vertex shaders to GLSL codes */
|
Vertex shaders to GLSL codes */
|
||||||
static void shader_glsl_mnxn(const struct wined3d_shader_instruction *ins)
|
static void shader_glsl_mnxn(const struct wined3d_shader_instruction *ins)
|
||||||
{
|
{
|
||||||
IWineD3DBaseShaderImpl *shader = (IWineD3DBaseShaderImpl *)ins->shader;
|
|
||||||
const SHADER_OPCODE *opcode_table = shader->baseShader.shader_ins;
|
|
||||||
DWORD shader_version = ins->reg_maps->shader_version;
|
|
||||||
int i;
|
int i;
|
||||||
int nComponents = 0;
|
int nComponents = 0;
|
||||||
struct wined3d_shader_instruction tmp_ins;
|
struct wined3d_shader_instruction tmp_ins;
|
||||||
|
@ -2048,36 +2045,35 @@ static void shader_glsl_mnxn(const struct wined3d_shader_instruction *ins)
|
||||||
tmp_ins.src_addr[0] = ins->src_addr[0];
|
tmp_ins.src_addr[0] = ins->src_addr[0];
|
||||||
tmp_ins.src_addr[1] = ins->src_addr[1];
|
tmp_ins.src_addr[1] = ins->src_addr[1];
|
||||||
tmp_ins.reg_maps = ins->reg_maps;
|
tmp_ins.reg_maps = ins->reg_maps;
|
||||||
|
tmp_ins.dst_count = 1;
|
||||||
|
tmp_ins.src_count = 2;
|
||||||
|
|
||||||
switch(ins->handler_idx)
|
switch(ins->handler_idx)
|
||||||
{
|
{
|
||||||
case WINED3DSIH_M4x4:
|
case WINED3DSIH_M4x4:
|
||||||
nComponents = 4;
|
nComponents = 4;
|
||||||
tmp_ins.opcode = shader_get_opcode(opcode_table, shader_version, WINED3DSIO_DP4);
|
tmp_ins.handler_idx = WINED3DSIH_DP4;
|
||||||
break;
|
break;
|
||||||
case WINED3DSIH_M4x3:
|
case WINED3DSIH_M4x3:
|
||||||
nComponents = 3;
|
nComponents = 3;
|
||||||
tmp_ins.opcode = shader_get_opcode(opcode_table, shader_version, WINED3DSIO_DP4);
|
tmp_ins.handler_idx = WINED3DSIH_DP4;
|
||||||
break;
|
break;
|
||||||
case WINED3DSIH_M3x4:
|
case WINED3DSIH_M3x4:
|
||||||
nComponents = 4;
|
nComponents = 4;
|
||||||
tmp_ins.opcode = shader_get_opcode(opcode_table, shader_version, WINED3DSIO_DP3);
|
tmp_ins.handler_idx = WINED3DSIH_DP3;
|
||||||
break;
|
break;
|
||||||
case WINED3DSIH_M3x3:
|
case WINED3DSIH_M3x3:
|
||||||
nComponents = 3;
|
nComponents = 3;
|
||||||
tmp_ins.opcode = shader_get_opcode(opcode_table, shader_version, WINED3DSIO_DP3);
|
tmp_ins.handler_idx = WINED3DSIH_DP3;
|
||||||
break;
|
break;
|
||||||
case WINED3DSIH_M3x2:
|
case WINED3DSIH_M3x2:
|
||||||
nComponents = 2;
|
nComponents = 2;
|
||||||
tmp_ins.opcode = shader_get_opcode(opcode_table, shader_version, WINED3DSIO_DP3);
|
tmp_ins.handler_idx = WINED3DSIH_DP3;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp_ins.handler_idx = tmp_ins.opcode->handler_idx;
|
|
||||||
tmp_ins.dst_count = tmp_ins.opcode->dst_token ? 1 : 0;
|
|
||||||
tmp_ins.src_count = tmp_ins.opcode->num_params - tmp_ins.dst_count;
|
|
||||||
for (i = 0; i < nComponents; ++i)
|
for (i = 0; i < nComponents; ++i)
|
||||||
{
|
{
|
||||||
tmp_ins.dst = ((ins->dst) & ~WINED3DSP_WRITEMASK_ALL) | (WINED3DSP_WRITEMASK_0 << i);
|
tmp_ins.dst = ((ins->dst) & ~WINED3DSP_WRITEMASK_ALL) | (WINED3DSP_WRITEMASK_0 << i);
|
||||||
|
|
|
@ -454,7 +454,6 @@ struct wined3d_shader_instruction
|
||||||
{
|
{
|
||||||
IWineD3DBaseShader *shader;
|
IWineD3DBaseShader *shader;
|
||||||
const shader_reg_maps *reg_maps;
|
const shader_reg_maps *reg_maps;
|
||||||
CONST SHADER_OPCODE *opcode;
|
|
||||||
enum WINED3D_SHADER_INSTRUCTION_HANDLER handler_idx;
|
enum WINED3D_SHADER_INSTRUCTION_HANDLER handler_idx;
|
||||||
DWORD flags;
|
DWORD flags;
|
||||||
BOOL coissue;
|
BOOL coissue;
|
||||||
|
|
Loading…
Reference in New Issue