mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-05 18:01:34 +00:00
wined3d: Mark instructions without a destination token.
There are a total of 17 instructions without a destination token. Of those 9 have num_params != 0, which means that we will not process any of them correctly, because we assume the first token (if present) is a destination token. Those are basically all the flow control instructions, which we plan to support very soon. They have source tokens, and no destination. Add a flag that marks them up to the ins table. Use this flag in the trace pass, and generation pass.
This commit is contained in:
parent
14a52e5c09
commit
8c6ee8df0d
4 changed files with 180 additions and 171 deletions
|
@ -867,30 +867,35 @@ void shader_generate_main(
|
|||
|
||||
hw_arg.opcode = curOpcode;
|
||||
|
||||
if (curOpcode->num_params > 0) {
|
||||
/* Destination token */
|
||||
if (curOpcode->dst_token) {
|
||||
|
||||
DWORD param, addr_token = 0;
|
||||
|
||||
pToken += shader_get_param(iface, pToken, ¶m, &addr_token);
|
||||
hw_arg.dst = param;
|
||||
hw_arg.dst_addr = addr_token;
|
||||
}
|
||||
|
||||
if (opcode_token & D3DSHADER_INSTRUCTION_PREDICATED)
|
||||
hw_arg.predicate = *pToken++;
|
||||
/* Predication token */
|
||||
if (opcode_token & D3DSHADER_INSTRUCTION_PREDICATED)
|
||||
hw_arg.predicate = *pToken++;
|
||||
|
||||
for (i = 1; i < curOpcode->num_params; i++) {
|
||||
/* DEF* instructions have constant src parameters, not registers */
|
||||
if (curOpcode->opcode == D3DSIO_DEF ||
|
||||
curOpcode->opcode == D3DSIO_DEFI ||
|
||||
curOpcode->opcode == D3DSIO_DEFB) {
|
||||
param = *pToken++;
|
||||
/* Other source tokens */
|
||||
for (i = curOpcode->dst_token; i < curOpcode->num_params; i++) {
|
||||
|
||||
} else
|
||||
pToken += shader_get_param(iface, pToken, ¶m, &addr_token);
|
||||
DWORD param, addr_token = 0;
|
||||
|
||||
hw_arg.src[i-1] = param;
|
||||
hw_arg.src_addr[i-1] = addr_token;
|
||||
}
|
||||
/* DEF* instructions have constant src parameters, not registers */
|
||||
if (curOpcode->opcode == D3DSIO_DEF ||
|
||||
curOpcode->opcode == D3DSIO_DEFI ||
|
||||
curOpcode->opcode == D3DSIO_DEFB) {
|
||||
param = *pToken++;
|
||||
|
||||
} else
|
||||
pToken += shader_get_param(iface, pToken, ¶m, &addr_token);
|
||||
|
||||
hw_arg.src[i-1] = param;
|
||||
hw_arg.src_addr[i-1] = addr_token;
|
||||
}
|
||||
|
||||
/* Call appropriate function for output target */
|
||||
|
@ -1052,7 +1057,9 @@ void shader_trace_init(
|
|||
}
|
||||
|
||||
TRACE("%s", curOpcode->name);
|
||||
if (curOpcode->num_params > 0) {
|
||||
|
||||
/* Destination token */
|
||||
if (curOpcode->dst_token) {
|
||||
|
||||
/* Destination token */
|
||||
tokens_read = shader_get_param(iface, pToken, ¶m, &addr_token);
|
||||
|
@ -1062,22 +1069,23 @@ void shader_trace_init(
|
|||
shader_dump_ins_modifiers(param);
|
||||
TRACE(" ");
|
||||
shader_dump_param(iface, param, addr_token, 0);
|
||||
}
|
||||
|
||||
/* Predication token - already printed out, just skip it */
|
||||
if (opcode_token & D3DSHADER_INSTRUCTION_PREDICATED) {
|
||||
pToken++;
|
||||
len++;
|
||||
}
|
||||
/* Other source tokens */
|
||||
for (i = 1; i < curOpcode->num_params; ++i) {
|
||||
/* Predication token - already printed out, just skip it */
|
||||
if (opcode_token & D3DSHADER_INSTRUCTION_PREDICATED) {
|
||||
pToken++;
|
||||
len++;
|
||||
}
|
||||
|
||||
tokens_read = shader_get_param(iface, pToken, ¶m, &addr_token);
|
||||
pToken += tokens_read;
|
||||
len += tokens_read;
|
||||
/* Other source tokens */
|
||||
for (i = curOpcode->dst_token; i < curOpcode->num_params; ++i) {
|
||||
|
||||
TRACE(", ");
|
||||
shader_dump_param(iface, param, addr_token, 1);
|
||||
}
|
||||
tokens_read = shader_get_param(iface, pToken, ¶m, &addr_token);
|
||||
pToken += tokens_read;
|
||||
len += tokens_read;
|
||||
|
||||
TRACE((i == 0)? " " : ", ");
|
||||
shader_dump_param(iface, param, addr_token, 1);
|
||||
}
|
||||
}
|
||||
TRACE("\n");
|
||||
|
|
|
@ -636,32 +636,32 @@ static void pshader_hw_texm3x3vspec(SHADER_OPCODE_ARG* arg);
|
|||
CONST SHADER_OPCODE IWineD3DPixelShaderImpl_shader_ins[] = {
|
||||
|
||||
/* Arithmethic */
|
||||
{D3DSIO_NOP, "nop", "NOP", 0, pshader_nop, pshader_hw_map2gl, NULL, 0, 0},
|
||||
{D3DSIO_MOV, "mov", "MOV", 2, pshader_mov, pshader_hw_map2gl, shader_glsl_mov, 0, 0},
|
||||
{D3DSIO_ADD, "add", "ADD", 3, pshader_add, pshader_hw_map2gl, shader_glsl_arith, 0, 0},
|
||||
{D3DSIO_SUB, "sub", "SUB", 3, pshader_sub, pshader_hw_map2gl, shader_glsl_arith, 0, 0},
|
||||
{D3DSIO_MAD, "mad", "MAD", 4, pshader_mad, pshader_hw_map2gl, shader_glsl_mad, 0, 0},
|
||||
{D3DSIO_MUL, "mul", "MUL", 3, pshader_mul, pshader_hw_map2gl, shader_glsl_arith, 0, 0},
|
||||
{D3DSIO_RCP, "rcp", "RCP", 2, pshader_rcp, pshader_hw_map2gl, shader_glsl_rcp, 0, 0},
|
||||
{D3DSIO_RSQ, "rsq", "RSQ", 2, pshader_rsq, pshader_hw_map2gl, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_DP3, "dp3", "DP3", 3, pshader_dp3, pshader_hw_map2gl, shader_glsl_dot, 0, 0},
|
||||
{D3DSIO_DP4, "dp4", "DP4", 3, pshader_dp4, pshader_hw_map2gl, shader_glsl_dot, 0, 0},
|
||||
{D3DSIO_MIN, "min", "MIN", 3, pshader_min, pshader_hw_map2gl, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_MAX, "max", "MAX", 3, pshader_max, pshader_hw_map2gl, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_SLT, "slt", "SLT", 3, pshader_slt, pshader_hw_map2gl, shader_glsl_compare, 0, 0},
|
||||
{D3DSIO_SGE, "sge", "SGE", 3, pshader_sge, pshader_hw_map2gl, shader_glsl_compare, 0, 0},
|
||||
{D3DSIO_ABS, "abs", "ABS", 2, pshader_abs, pshader_hw_map2gl, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_EXP, "exp", "EX2", 2, pshader_exp, pshader_hw_map2gl, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_LOG, "log", "LG2", 2, pshader_log, pshader_hw_map2gl, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_EXPP, "expp", "EXP", 2, pshader_expp, pshader_hw_map2gl, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_LOGP, "logp", "LOG", 2, pshader_logp, pshader_hw_map2gl, NULL, 0, 0},
|
||||
{D3DSIO_DST, "dst", "DST", 3, pshader_dst, pshader_hw_map2gl, NULL, 0, 0},
|
||||
{D3DSIO_LRP, "lrp", "LRP", 4, pshader_lrp, pshader_hw_map2gl, shader_glsl_lrp, 0, 0},
|
||||
{D3DSIO_FRC, "frc", "FRC", 2, pshader_frc, pshader_hw_map2gl, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_CND, "cnd", NULL, 4, pshader_cnd, pshader_hw_cnd, shader_glsl_cnd, D3DPS_VERSION(1,1), D3DPS_VERSION(1,4)},
|
||||
{D3DSIO_CMP, "cmp", NULL, 4, pshader_cmp, pshader_hw_cmp, shader_glsl_cmp, D3DPS_VERSION(1,2), D3DPS_VERSION(3,0)},
|
||||
{D3DSIO_POW, "pow", "POW", 3, pshader_pow, NULL, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_CRS, "crs", "XPS", 3, pshader_crs, NULL, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_NOP, "nop", "NOP", 0, 0, pshader_nop, pshader_hw_map2gl, NULL, 0, 0},
|
||||
{D3DSIO_MOV, "mov", "MOV", 1, 2, pshader_mov, pshader_hw_map2gl, shader_glsl_mov, 0, 0},
|
||||
{D3DSIO_ADD, "add", "ADD", 1, 3, pshader_add, pshader_hw_map2gl, shader_glsl_arith, 0, 0},
|
||||
{D3DSIO_SUB, "sub", "SUB", 1, 3, pshader_sub, pshader_hw_map2gl, shader_glsl_arith, 0, 0},
|
||||
{D3DSIO_MAD, "mad", "MAD", 1, 4, pshader_mad, pshader_hw_map2gl, shader_glsl_mad, 0, 0},
|
||||
{D3DSIO_MUL, "mul", "MUL", 1, 3, pshader_mul, pshader_hw_map2gl, shader_glsl_arith, 0, 0},
|
||||
{D3DSIO_RCP, "rcp", "RCP", 1, 2, pshader_rcp, pshader_hw_map2gl, shader_glsl_rcp, 0, 0},
|
||||
{D3DSIO_RSQ, "rsq", "RSQ", 1, 2, pshader_rsq, pshader_hw_map2gl, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_DP3, "dp3", "DP3", 1, 3, pshader_dp3, pshader_hw_map2gl, shader_glsl_dot, 0, 0},
|
||||
{D3DSIO_DP4, "dp4", "DP4", 1, 3, pshader_dp4, pshader_hw_map2gl, shader_glsl_dot, 0, 0},
|
||||
{D3DSIO_MIN, "min", "MIN", 1, 3, pshader_min, pshader_hw_map2gl, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_MAX, "max", "MAX", 1, 3, pshader_max, pshader_hw_map2gl, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_SLT, "slt", "SLT", 1, 3, pshader_slt, pshader_hw_map2gl, shader_glsl_compare, 0, 0},
|
||||
{D3DSIO_SGE, "sge", "SGE", 1, 3, pshader_sge, pshader_hw_map2gl, shader_glsl_compare, 0, 0},
|
||||
{D3DSIO_ABS, "abs", "ABS", 1, 2, pshader_abs, pshader_hw_map2gl, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_EXP, "exp", "EX2", 1, 2, pshader_exp, pshader_hw_map2gl, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_LOG, "log", "LG2", 1, 2, pshader_log, pshader_hw_map2gl, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_EXPP, "expp", "EXP", 1, 2, pshader_expp, pshader_hw_map2gl, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_LOGP, "logp", "LOG", 1, 2, pshader_logp, pshader_hw_map2gl, NULL, 0, 0},
|
||||
{D3DSIO_DST, "dst", "DST", 1, 3, pshader_dst, pshader_hw_map2gl, NULL, 0, 0},
|
||||
{D3DSIO_LRP, "lrp", "LRP", 1, 4, pshader_lrp, pshader_hw_map2gl, shader_glsl_lrp, 0, 0},
|
||||
{D3DSIO_FRC, "frc", "FRC", 1, 2, pshader_frc, pshader_hw_map2gl, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_CND, "cnd", NULL, 1, 4, pshader_cnd, pshader_hw_cnd, shader_glsl_cnd, D3DPS_VERSION(1,1), D3DPS_VERSION(1,4)},
|
||||
{D3DSIO_CMP, "cmp", NULL, 1, 4, pshader_cmp, pshader_hw_cmp, shader_glsl_cmp, D3DPS_VERSION(1,2), D3DPS_VERSION(3,0)},
|
||||
{D3DSIO_POW, "pow", "POW", 1, 3, pshader_pow, NULL, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_CRS, "crs", "XPS", 1, 3, pshader_crs, NULL, shader_glsl_map2gl, 0, 0},
|
||||
/* TODO: xyz normalise can be performed as VS_ARB using one temporary register,
|
||||
DP3 tmp , vec, vec;
|
||||
RSQ tmp, tmp.x;
|
||||
|
@ -672,77 +672,77 @@ CONST SHADER_OPCODE IWineD3DPixelShaderImpl_shader_ins[] = {
|
|||
MUL vec, vec, tmp;
|
||||
|
||||
*/
|
||||
{D3DSIO_NRM, "nrm", NULL, 2, pshader_nrm, NULL, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_SINCOS, "sincos", NULL, 4, pshader_sincos2, NULL, NULL, D3DPS_VERSION(2,0), D3DPS_VERSION(2,0)},
|
||||
{D3DSIO_SINCOS, "sincos", NULL, 2, pshader_sincos3, NULL, NULL, D3DPS_VERSION(3,0), -1},
|
||||
{D3DSIO_NRM, "nrm", NULL, 1, 2, pshader_nrm, NULL, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_SINCOS, "sincos", NULL, 1, 4, pshader_sincos2, NULL, NULL, D3DPS_VERSION(2,0), D3DPS_VERSION(2,0)},
|
||||
{D3DSIO_SINCOS, "sincos", NULL, 1, 2, pshader_sincos3, NULL, NULL, D3DPS_VERSION(3,0), -1},
|
||||
/* TODO: dp2add can be made out of multiple instuctions */
|
||||
{D3DSIO_DP2ADD, "dp2add", GLNAME_REQUIRE_GLSL, 2, pshader_dp2add, NULL, NULL, 0, 0},
|
||||
{D3DSIO_DP2ADD, "dp2add", GLNAME_REQUIRE_GLSL, 1, 2, pshader_dp2add, NULL, NULL, 0, 0},
|
||||
|
||||
/* Matrix */
|
||||
{D3DSIO_M4x4, "m4x4", "undefined", 3, pshader_m4x4, NULL, shader_glsl_mnxn, 0, 0},
|
||||
{D3DSIO_M4x3, "m4x3", "undefined", 3, pshader_m4x3, NULL, shader_glsl_mnxn, 0, 0},
|
||||
{D3DSIO_M3x4, "m3x4", "undefined", 3, pshader_m3x4, NULL, shader_glsl_mnxn, 0, 0},
|
||||
{D3DSIO_M3x3, "m3x3", "undefined", 3, pshader_m3x3, NULL, shader_glsl_mnxn, 0, 0},
|
||||
{D3DSIO_M3x2, "m3x2", "undefined", 3, pshader_m3x2, NULL, shader_glsl_mnxn, 0, 0},
|
||||
{D3DSIO_M4x4, "m4x4", "undefined", 1, 3, pshader_m4x4, NULL, shader_glsl_mnxn, 0, 0},
|
||||
{D3DSIO_M4x3, "m4x3", "undefined", 1, 3, pshader_m4x3, NULL, shader_glsl_mnxn, 0, 0},
|
||||
{D3DSIO_M3x4, "m3x4", "undefined", 1, 3, pshader_m3x4, NULL, shader_glsl_mnxn, 0, 0},
|
||||
{D3DSIO_M3x3, "m3x3", "undefined", 1, 3, pshader_m3x3, NULL, shader_glsl_mnxn, 0, 0},
|
||||
{D3DSIO_M3x2, "m3x2", "undefined", 1, 3, pshader_m3x2, NULL, shader_glsl_mnxn, 0, 0},
|
||||
|
||||
/* Register declarations */
|
||||
{D3DSIO_DCL, "dcl", NULL, 2, pshader_dcl, NULL, NULL, 0, 0},
|
||||
{D3DSIO_DCL, "dcl", NULL, 0, 2, pshader_dcl, NULL, NULL, 0, 0},
|
||||
|
||||
/* Flow control - requires GLSL or software shaders */
|
||||
{D3DSIO_REP , "rep", GLNAME_REQUIRE_GLSL, 1, pshader_rep, NULL, NULL, 0, 0},
|
||||
{D3DSIO_ENDREP, "endrep", GLNAME_REQUIRE_GLSL, 0, pshader_endrep, NULL, NULL, 0, 0},
|
||||
{D3DSIO_IF, "if", GLNAME_REQUIRE_GLSL, 1, pshader_if, NULL, NULL, 0, 0},
|
||||
{D3DSIO_IFC, "ifc", GLNAME_REQUIRE_GLSL, 2, pshader_ifc, NULL, NULL, 0, 0},
|
||||
{D3DSIO_ELSE, "else", GLNAME_REQUIRE_GLSL, 0, pshader_else, NULL, NULL, 0, 0},
|
||||
{D3DSIO_ENDIF, "endif", GLNAME_REQUIRE_GLSL, 0, pshader_endif, NULL, NULL, 0, 0},
|
||||
{D3DSIO_BREAK, "break", GLNAME_REQUIRE_GLSL, 0, pshader_break, NULL, NULL, 0, 0},
|
||||
{D3DSIO_BREAKC, "breakc", GLNAME_REQUIRE_GLSL, 2, pshader_breakc, NULL, NULL, 0, 0},
|
||||
{D3DSIO_BREAKP, "breakp", GLNAME_REQUIRE_GLSL, 1, pshader_breakp, NULL, NULL, 0, 0},
|
||||
{D3DSIO_CALL, "call", GLNAME_REQUIRE_GLSL, 1, pshader_call, NULL, NULL, 0, 0},
|
||||
{D3DSIO_CALLNZ, "callnz", GLNAME_REQUIRE_GLSL, 2, pshader_callnz, NULL, NULL, 0, 0},
|
||||
{D3DSIO_LOOP, "loop", GLNAME_REQUIRE_GLSL, 2, pshader_loop, NULL, NULL, 0, 0},
|
||||
{D3DSIO_RET, "ret", GLNAME_REQUIRE_GLSL, 0, pshader_ret, NULL, NULL, 0, 0},
|
||||
{D3DSIO_ENDLOOP, "endloop", GLNAME_REQUIRE_GLSL, 0, pshader_endloop, NULL, NULL, 0, 0},
|
||||
{D3DSIO_LABEL, "label", GLNAME_REQUIRE_GLSL, 1, pshader_label, NULL, NULL, 0, 0},
|
||||
{D3DSIO_REP , "rep", GLNAME_REQUIRE_GLSL, 0, 1, pshader_rep, NULL, NULL, 0, 0},
|
||||
{D3DSIO_ENDREP, "endrep", GLNAME_REQUIRE_GLSL, 0, 0, pshader_endrep, NULL, NULL, 0, 0},
|
||||
{D3DSIO_IF, "if", GLNAME_REQUIRE_GLSL, 0, 1, pshader_if, NULL, NULL, 0, 0},
|
||||
{D3DSIO_IFC, "ifc", GLNAME_REQUIRE_GLSL, 0, 2, pshader_ifc, NULL, NULL, 0, 0},
|
||||
{D3DSIO_ELSE, "else", GLNAME_REQUIRE_GLSL, 0, 0, pshader_else, NULL, NULL, 0, 0},
|
||||
{D3DSIO_ENDIF, "endif", GLNAME_REQUIRE_GLSL, 0, 0, pshader_endif, NULL, NULL, 0, 0},
|
||||
{D3DSIO_BREAK, "break", GLNAME_REQUIRE_GLSL, 0, 0, pshader_break, NULL, NULL, 0, 0},
|
||||
{D3DSIO_BREAKC, "breakc", GLNAME_REQUIRE_GLSL, 0, 2, pshader_breakc, NULL, NULL, 0, 0},
|
||||
{D3DSIO_BREAKP, "breakp", GLNAME_REQUIRE_GLSL, 0, 1, pshader_breakp, NULL, NULL, 0, 0},
|
||||
{D3DSIO_CALL, "call", GLNAME_REQUIRE_GLSL, 0, 1, pshader_call, NULL, NULL, 0, 0},
|
||||
{D3DSIO_CALLNZ, "callnz", GLNAME_REQUIRE_GLSL, 0, 2, pshader_callnz, NULL, NULL, 0, 0},
|
||||
{D3DSIO_LOOP, "loop", GLNAME_REQUIRE_GLSL, 0, 2, pshader_loop, NULL, NULL, 0, 0},
|
||||
{D3DSIO_RET, "ret", GLNAME_REQUIRE_GLSL, 0, 0, pshader_ret, NULL, NULL, 0, 0},
|
||||
{D3DSIO_ENDLOOP, "endloop", GLNAME_REQUIRE_GLSL, 0, 0, pshader_endloop, NULL, NULL, 0, 0},
|
||||
{D3DSIO_LABEL, "label", GLNAME_REQUIRE_GLSL, 0, 1, pshader_label, NULL, NULL, 0, 0},
|
||||
|
||||
/* Constant definitions */
|
||||
{D3DSIO_DEF, "def", "undefined", 5, pshader_def, shader_hw_def, shader_glsl_def, 0, 0},
|
||||
{D3DSIO_DEFB, "defb", GLNAME_REQUIRE_GLSL, 2, pshader_defb, NULL, NULL, 0, 0},
|
||||
{D3DSIO_DEFI, "defi", GLNAME_REQUIRE_GLSL, 5, pshader_defi, NULL, NULL, 0, 0},
|
||||
{D3DSIO_DEF, "def", "undefined", 1, 5, pshader_def, shader_hw_def, shader_glsl_def, 0, 0},
|
||||
{D3DSIO_DEFB, "defb", GLNAME_REQUIRE_GLSL, 1, 2, pshader_defb, NULL, NULL, 0, 0},
|
||||
{D3DSIO_DEFI, "defi", GLNAME_REQUIRE_GLSL, 1, 5, pshader_defi, NULL, NULL, 0, 0},
|
||||
|
||||
/* Texture */
|
||||
{D3DSIO_TEXCOORD, "texcoord", "undefined", 1, pshader_texcoord, pshader_hw_texcoord, pshader_glsl_texcoord, 0, D3DPS_VERSION(1,3)},
|
||||
{D3DSIO_TEXCOORD, "texcrd", "undefined", 2, pshader_texcoord, pshader_hw_texcoord, pshader_glsl_texcoord, D3DPS_VERSION(1,4), D3DPS_VERSION(1,4)},
|
||||
{D3DSIO_TEXKILL, "texkill", "KIL", 1, pshader_texkill, pshader_hw_map2gl, NULL, D3DPS_VERSION(1,0), D3DPS_VERSION(3,0)},
|
||||
{D3DSIO_TEX, "tex", "undefined", 1, pshader_tex, pshader_hw_tex, pshader_glsl_tex, 0, D3DPS_VERSION(1,3)},
|
||||
{D3DSIO_TEX, "texld", "undefined", 2, pshader_texld, pshader_hw_tex, pshader_glsl_tex, D3DPS_VERSION(1,4), D3DPS_VERSION(1,4)},
|
||||
{D3DSIO_TEX, "texld", "undefined", 3, pshader_texld, pshader_hw_tex, pshader_glsl_tex, D3DPS_VERSION(2,0), -1},
|
||||
{D3DSIO_TEXBEM, "texbem", "undefined", 2, pshader_texbem, pshader_hw_texbem, NULL, 0, D3DPS_VERSION(1,3)},
|
||||
{D3DSIO_TEXBEML, "texbeml", GLNAME_REQUIRE_GLSL, 2, pshader_texbeml, NULL, NULL, D3DPS_VERSION(1,0), D3DPS_VERSION(1,3)},
|
||||
{D3DSIO_TEXREG2AR,"texreg2ar","undefined", 2, pshader_texreg2ar, pshader_hw_texreg2ar, NULL, D3DPS_VERSION(1,1), D3DPS_VERSION(1,3)},
|
||||
{D3DSIO_TEXREG2GB,"texreg2gb","undefined", 2, pshader_texreg2gb, pshader_hw_texreg2gb, NULL, D3DPS_VERSION(1,1), D3DPS_VERSION(1,3)},
|
||||
{D3DSIO_TEXREG2RGB, "texreg2rgb", GLNAME_REQUIRE_GLSL, 2, pshader_texreg2rgb, NULL, NULL, D3DPS_VERSION(1,2), D3DPS_VERSION(1,3)},
|
||||
{D3DSIO_TEXM3x2PAD, "texm3x2pad", "undefined", 2, pshader_texm3x2pad, pshader_hw_texm3x2pad, pshader_glsl_texm3x2pad, D3DPS_VERSION(1,0), D3DPS_VERSION(1,3)},
|
||||
{D3DSIO_TEXM3x2TEX, "texm3x2tex", "undefined", 2, pshader_texm3x2tex, pshader_hw_texm3x2tex, pshader_glsl_texm3x2tex, D3DPS_VERSION(1,0), D3DPS_VERSION(1,3)},
|
||||
{D3DSIO_TEXM3x3PAD, "texm3x3pad", "undefined", 2, pshader_texm3x3pad, pshader_hw_texm3x3pad, NULL, D3DPS_VERSION(1,0), D3DPS_VERSION(1,3)},
|
||||
{D3DSIO_TEXM3x3DIFF, "texm3x3diff", GLNAME_REQUIRE_GLSL, 2, pshader_texm3x3diff, NULL, NULL, D3DPS_VERSION(0,0), D3DPS_VERSION(0,0)},
|
||||
{D3DSIO_TEXM3x3SPEC, "texm3x3spec", "undefined", 3, pshader_texm3x3spec, pshader_hw_texm3x3spec, NULL, D3DPS_VERSION(1,0), D3DPS_VERSION(1,3)},
|
||||
{D3DSIO_TEXM3x3VSPEC, "texm3x3vspe", "undefined", 2, pshader_texm3x3vspec, pshader_hw_texm3x3vspec, NULL, D3DPS_VERSION(1,0), D3DPS_VERSION(1,3)},
|
||||
{D3DSIO_TEXM3x3TEX, "texm3x3tex", "undefined", 2, pshader_texm3x3tex, pshader_hw_texm3x3tex, NULL, D3DPS_VERSION(1,0), D3DPS_VERSION(1,3)},
|
||||
{D3DSIO_TEXDP3TEX, "texdp3tex", GLNAME_REQUIRE_GLSL, 2, pshader_texdp3tex, NULL, NULL, D3DPS_VERSION(1,2), D3DPS_VERSION(1,3)},
|
||||
{D3DSIO_TEXM3x2DEPTH, "texm3x2depth", GLNAME_REQUIRE_GLSL, 2, pshader_texm3x2depth, NULL, NULL, D3DPS_VERSION(1,3), D3DPS_VERSION(1,3)},
|
||||
{D3DSIO_TEXDP3, "texdp3", GLNAME_REQUIRE_GLSL, 2, pshader_texdp3, NULL, NULL, D3DPS_VERSION(1,2), D3DPS_VERSION(1,3)},
|
||||
{D3DSIO_TEXM3x3, "texm3x3", GLNAME_REQUIRE_GLSL, 2, pshader_texm3x3, NULL, NULL, D3DPS_VERSION(1,2), D3DPS_VERSION(1,3)},
|
||||
{D3DSIO_TEXDEPTH, "texdepth", GLNAME_REQUIRE_GLSL, 1, pshader_texdepth, NULL, NULL, D3DPS_VERSION(1,4), D3DPS_VERSION(1,4)},
|
||||
{D3DSIO_BEM, "bem", GLNAME_REQUIRE_GLSL, 3, pshader_bem, NULL, NULL, D3DPS_VERSION(1,4), D3DPS_VERSION(1,4)},
|
||||
{D3DSIO_TEXCOORD, "texcoord", "undefined", 1, 1, pshader_texcoord, pshader_hw_texcoord, pshader_glsl_texcoord, 0, D3DPS_VERSION(1,3)},
|
||||
{D3DSIO_TEXCOORD, "texcrd", "undefined", 1, 2, pshader_texcoord, pshader_hw_texcoord, pshader_glsl_texcoord, D3DPS_VERSION(1,4), D3DPS_VERSION(1,4)},
|
||||
{D3DSIO_TEXKILL, "texkill", "KIL", 1, 1, pshader_texkill, pshader_hw_map2gl, NULL, D3DPS_VERSION(1,0), D3DPS_VERSION(3,0)},
|
||||
{D3DSIO_TEX, "tex", "undefined", 1, 1, pshader_tex, pshader_hw_tex, pshader_glsl_tex, 0, D3DPS_VERSION(1,3)},
|
||||
{D3DSIO_TEX, "texld", "undefined", 1, 2, pshader_texld, pshader_hw_tex, pshader_glsl_tex, D3DPS_VERSION(1,4), D3DPS_VERSION(1,4)},
|
||||
{D3DSIO_TEX, "texld", "undefined", 1, 3, pshader_texld, pshader_hw_tex, pshader_glsl_tex, D3DPS_VERSION(2,0), -1},
|
||||
{D3DSIO_TEXBEM, "texbem", "undefined", 1, 2, pshader_texbem, pshader_hw_texbem, NULL, 0, D3DPS_VERSION(1,3)},
|
||||
{D3DSIO_TEXBEML, "texbeml", GLNAME_REQUIRE_GLSL, 1, 2, pshader_texbeml, NULL, NULL, D3DPS_VERSION(1,0), D3DPS_VERSION(1,3)},
|
||||
{D3DSIO_TEXREG2AR,"texreg2ar","undefined", 1, 2, pshader_texreg2ar, pshader_hw_texreg2ar, NULL, D3DPS_VERSION(1,1), D3DPS_VERSION(1,3)},
|
||||
{D3DSIO_TEXREG2GB,"texreg2gb","undefined", 1, 2, pshader_texreg2gb, pshader_hw_texreg2gb, NULL, D3DPS_VERSION(1,1), D3DPS_VERSION(1,3)},
|
||||
{D3DSIO_TEXREG2RGB, "texreg2rgb", GLNAME_REQUIRE_GLSL, 1, 2, pshader_texreg2rgb, NULL, NULL, D3DPS_VERSION(1,2), D3DPS_VERSION(1,3)},
|
||||
{D3DSIO_TEXM3x2PAD, "texm3x2pad", "undefined", 1, 2, pshader_texm3x2pad, pshader_hw_texm3x2pad, pshader_glsl_texm3x2pad, D3DPS_VERSION(1,0), D3DPS_VERSION(1,3)},
|
||||
{D3DSIO_TEXM3x2TEX, "texm3x2tex", "undefined", 1, 2, pshader_texm3x2tex, pshader_hw_texm3x2tex, pshader_glsl_texm3x2tex, D3DPS_VERSION(1,0), D3DPS_VERSION(1,3)},
|
||||
{D3DSIO_TEXM3x3PAD, "texm3x3pad", "undefined", 1, 2, pshader_texm3x3pad, pshader_hw_texm3x3pad, NULL, D3DPS_VERSION(1,0), D3DPS_VERSION(1,3)},
|
||||
{D3DSIO_TEXM3x3DIFF, "texm3x3diff", GLNAME_REQUIRE_GLSL, 1, 2, pshader_texm3x3diff, NULL, NULL, D3DPS_VERSION(0,0), D3DPS_VERSION(0,0)},
|
||||
{D3DSIO_TEXM3x3SPEC, "texm3x3spec", "undefined", 1, 3, pshader_texm3x3spec, pshader_hw_texm3x3spec, NULL, D3DPS_VERSION(1,0), D3DPS_VERSION(1,3)},
|
||||
{D3DSIO_TEXM3x3VSPEC, "texm3x3vspe", "undefined", 1, 2, pshader_texm3x3vspec, pshader_hw_texm3x3vspec, NULL, D3DPS_VERSION(1,0), D3DPS_VERSION(1,3)},
|
||||
{D3DSIO_TEXM3x3TEX, "texm3x3tex", "undefined", 1, 2, pshader_texm3x3tex, pshader_hw_texm3x3tex, NULL, D3DPS_VERSION(1,0), D3DPS_VERSION(1,3)},
|
||||
{D3DSIO_TEXDP3TEX, "texdp3tex", GLNAME_REQUIRE_GLSL, 1, 2, pshader_texdp3tex, NULL, NULL, D3DPS_VERSION(1,2), D3DPS_VERSION(1,3)},
|
||||
{D3DSIO_TEXM3x2DEPTH, "texm3x2depth", GLNAME_REQUIRE_GLSL, 1, 2, pshader_texm3x2depth, NULL, NULL, D3DPS_VERSION(1,3), D3DPS_VERSION(1,3)},
|
||||
{D3DSIO_TEXDP3, "texdp3", GLNAME_REQUIRE_GLSL, 1, 2, pshader_texdp3, NULL, NULL, D3DPS_VERSION(1,2), D3DPS_VERSION(1,3)},
|
||||
{D3DSIO_TEXM3x3, "texm3x3", GLNAME_REQUIRE_GLSL, 1, 2, pshader_texm3x3, NULL, NULL, D3DPS_VERSION(1,2), D3DPS_VERSION(1,3)},
|
||||
{D3DSIO_TEXDEPTH, "texdepth", GLNAME_REQUIRE_GLSL, 1, 1, pshader_texdepth, NULL, NULL, D3DPS_VERSION(1,4), D3DPS_VERSION(1,4)},
|
||||
{D3DSIO_BEM, "bem", GLNAME_REQUIRE_GLSL, 1, 3, pshader_bem, NULL, NULL, D3DPS_VERSION(1,4), D3DPS_VERSION(1,4)},
|
||||
/* TODO: dp2add can be made out of multiple instuctions */
|
||||
{D3DSIO_DSX, "dsx", GLNAME_REQUIRE_GLSL, 2, pshader_dsx, NULL, NULL, 0, 0},
|
||||
{D3DSIO_DSY, "dsy", GLNAME_REQUIRE_GLSL, 2, pshader_dsy, NULL, NULL, 0, 0},
|
||||
{D3DSIO_TEXLDD, "texldd", GLNAME_REQUIRE_GLSL, 2, pshader_texldd, NULL, NULL, 0, 0},
|
||||
{D3DSIO_SETP, "setp", GLNAME_REQUIRE_GLSL, 3, pshader_setp, NULL, NULL, 0, 0},
|
||||
{D3DSIO_TEXLDL, "texdl", GLNAME_REQUIRE_GLSL, 2, pshader_texldl, NULL, NULL, 0, 0},
|
||||
{D3DSIO_PHASE, "phase", GLNAME_REQUIRE_GLSL, 0, pshader_nop, NULL, NULL, 0, 0},
|
||||
{0, NULL, NULL, 0, NULL, NULL, 0, 0}
|
||||
{D3DSIO_DSX, "dsx", GLNAME_REQUIRE_GLSL, 1, 2, pshader_dsx, NULL, NULL, 0, 0},
|
||||
{D3DSIO_DSY, "dsy", GLNAME_REQUIRE_GLSL, 1, 2, pshader_dsy, NULL, NULL, 0, 0},
|
||||
{D3DSIO_TEXLDD, "texldd", GLNAME_REQUIRE_GLSL, 1, 2, pshader_texldd, NULL, NULL, 0, 0},
|
||||
{D3DSIO_SETP, "setp", GLNAME_REQUIRE_GLSL, 1, 3, pshader_setp, NULL, NULL, 0, 0},
|
||||
{D3DSIO_TEXLDL, "texdl", GLNAME_REQUIRE_GLSL, 1, 2, pshader_texldl, NULL, NULL, 0, 0},
|
||||
{D3DSIO_PHASE, "phase", GLNAME_REQUIRE_GLSL, 0, 0, pshader_nop, NULL, NULL, 0, 0},
|
||||
{0, NULL, NULL, 0, 0, NULL, NULL, 0, 0}
|
||||
};
|
||||
|
||||
inline static void get_register_name(const DWORD param, char* regstr, CHAR *constants) {
|
||||
|
|
|
@ -483,35 +483,35 @@ static void vshader_hw_mnxn(SHADER_OPCODE_ARG* arg);
|
|||
CONST SHADER_OPCODE IWineD3DVertexShaderImpl_shader_ins[] = {
|
||||
|
||||
/* Arithmetic */
|
||||
{D3DSIO_NOP, "nop", "NOP", 0, vshader_nop, vshader_hw_map2gl, NULL, 0, 0},
|
||||
{D3DSIO_MOV, "mov", "MOV", 2, vshader_mov, vshader_hw_map2gl, shader_glsl_mov, 0, 0},
|
||||
{D3DSIO_ADD, "add", "ADD", 3, vshader_add, vshader_hw_map2gl, shader_glsl_arith, 0, 0},
|
||||
{D3DSIO_SUB, "sub", "SUB", 3, vshader_sub, vshader_hw_map2gl, shader_glsl_arith, 0, 0},
|
||||
{D3DSIO_MAD, "mad", "MAD", 4, vshader_mad, vshader_hw_map2gl, shader_glsl_mad, 0, 0},
|
||||
{D3DSIO_MUL, "mul", "MUL", 3, vshader_mul, vshader_hw_map2gl, shader_glsl_arith, 0, 0},
|
||||
{D3DSIO_RCP, "rcp", "RCP", 2, vshader_rcp, vshader_hw_map2gl, shader_glsl_rcp, 0, 0},
|
||||
{D3DSIO_RSQ, "rsq", "RSQ", 2, vshader_rsq, vshader_hw_map2gl, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_DP3, "dp3", "DP3", 3, vshader_dp3, vshader_hw_map2gl, shader_glsl_dot, 0, 0},
|
||||
{D3DSIO_DP4, "dp4", "DP4", 3, vshader_dp4, vshader_hw_map2gl, shader_glsl_dot, 0, 0},
|
||||
{D3DSIO_MIN, "min", "MIN", 3, vshader_min, vshader_hw_map2gl, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_MAX, "max", "MAX", 3, vshader_max, vshader_hw_map2gl, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_SLT, "slt", "SLT", 3, vshader_slt, vshader_hw_map2gl, shader_glsl_compare, 0, 0},
|
||||
{D3DSIO_SGE, "sge", "SGE", 3, vshader_sge, vshader_hw_map2gl, shader_glsl_compare, 0, 0},
|
||||
{D3DSIO_ABS, "abs", "ABS", 2, vshader_abs, vshader_hw_map2gl, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_EXP, "exp", "EX2", 2, vshader_exp, vshader_hw_map2gl, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_LOG, "log", "LG2", 2, vshader_log, vshader_hw_map2gl, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_EXPP, "expp", "EXP", 2, vshader_expp, vshader_hw_map2gl, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_LOGP, "logp", "LOG", 2, vshader_logp, vshader_hw_map2gl, NULL, 0, 0},
|
||||
{D3DSIO_LIT, "lit", "LIT", 2, vshader_lit, vshader_hw_map2gl, NULL, 0, 0},
|
||||
{D3DSIO_DST, "dst", "DST", 3, vshader_dst, vshader_hw_map2gl, NULL, 0, 0},
|
||||
{D3DSIO_LRP, "lrp", "LRP", 4, vshader_lrp, NULL, shader_glsl_lrp, 0, 0},
|
||||
{D3DSIO_FRC, "frc", "FRC", 2, vshader_frc, vshader_hw_map2gl, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_POW, "pow", "POW", 3, vshader_pow, NULL, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_CRS, "crs", "XPS", 3, vshader_crs, NULL, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_NOP, "nop", "NOP", 0, 0, vshader_nop, vshader_hw_map2gl, NULL, 0, 0},
|
||||
{D3DSIO_MOV, "mov", "MOV", 1, 2, vshader_mov, vshader_hw_map2gl, shader_glsl_mov, 0, 0},
|
||||
{D3DSIO_ADD, "add", "ADD", 1, 3, vshader_add, vshader_hw_map2gl, shader_glsl_arith, 0, 0},
|
||||
{D3DSIO_SUB, "sub", "SUB", 1, 3, vshader_sub, vshader_hw_map2gl, shader_glsl_arith, 0, 0},
|
||||
{D3DSIO_MAD, "mad", "MAD", 1, 4, vshader_mad, vshader_hw_map2gl, shader_glsl_mad, 0, 0},
|
||||
{D3DSIO_MUL, "mul", "MUL", 1, 3, vshader_mul, vshader_hw_map2gl, shader_glsl_arith, 0, 0},
|
||||
{D3DSIO_RCP, "rcp", "RCP", 1, 2, vshader_rcp, vshader_hw_map2gl, shader_glsl_rcp, 0, 0},
|
||||
{D3DSIO_RSQ, "rsq", "RSQ", 1, 2, vshader_rsq, vshader_hw_map2gl, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_DP3, "dp3", "DP3", 1, 3, vshader_dp3, vshader_hw_map2gl, shader_glsl_dot, 0, 0},
|
||||
{D3DSIO_DP4, "dp4", "DP4", 1, 3, vshader_dp4, vshader_hw_map2gl, shader_glsl_dot, 0, 0},
|
||||
{D3DSIO_MIN, "min", "MIN", 1, 3, vshader_min, vshader_hw_map2gl, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_MAX, "max", "MAX", 1, 3, vshader_max, vshader_hw_map2gl, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_SLT, "slt", "SLT", 1, 3, vshader_slt, vshader_hw_map2gl, shader_glsl_compare, 0, 0},
|
||||
{D3DSIO_SGE, "sge", "SGE", 1, 3, vshader_sge, vshader_hw_map2gl, shader_glsl_compare, 0, 0},
|
||||
{D3DSIO_ABS, "abs", "ABS", 1, 2, vshader_abs, vshader_hw_map2gl, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_EXP, "exp", "EX2", 1, 2, vshader_exp, vshader_hw_map2gl, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_LOG, "log", "LG2", 1, 2, vshader_log, vshader_hw_map2gl, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_EXPP, "expp", "EXP", 1, 2, vshader_expp, vshader_hw_map2gl, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_LOGP, "logp", "LOG", 1, 2, vshader_logp, vshader_hw_map2gl, NULL, 0, 0},
|
||||
{D3DSIO_LIT, "lit", "LIT", 1, 2, vshader_lit, vshader_hw_map2gl, NULL, 0, 0},
|
||||
{D3DSIO_DST, "dst", "DST", 1, 3, vshader_dst, vshader_hw_map2gl, NULL, 0, 0},
|
||||
{D3DSIO_LRP, "lrp", "LRP", 1, 4, vshader_lrp, NULL, shader_glsl_lrp, 0, 0},
|
||||
{D3DSIO_FRC, "frc", "FRC", 1, 2, vshader_frc, vshader_hw_map2gl, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_POW, "pow", "POW", 1, 3, vshader_pow, NULL, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_CRS, "crs", "XPS", 1, 3, vshader_crs, NULL, shader_glsl_map2gl, 0, 0},
|
||||
/* TODO: sng can possibly be performed a s
|
||||
RCP tmp, vec
|
||||
MUL out, tmp, vec*/
|
||||
{D3DSIO_SGN, "sng", NULL, 2, vshader_sng, NULL, NULL, 0, 0},
|
||||
{D3DSIO_SGN, "sng", NULL, 1, 2, vshader_sng, NULL, NULL, 0, 0},
|
||||
/* TODO: xyz normalise can be performed as VS_ARB using one temporary register,
|
||||
DP3 tmp , vec, vec;
|
||||
RSQ tmp, tmp.x;
|
||||
|
@ -522,46 +522,46 @@ CONST SHADER_OPCODE IWineD3DVertexShaderImpl_shader_ins[] = {
|
|||
MUL vec, vec, tmp;
|
||||
|
||||
*/
|
||||
{D3DSIO_NRM, "nrm", NULL, 2, vshader_nrm, NULL, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_SINCOS, "sincos", NULL, 4, vshader_sincos2, NULL, NULL, D3DVS_VERSION(2,0), D3DVS_VERSION(2,0)},
|
||||
{D3DSIO_SINCOS, "sincos", NULL, 2, vshader_sincos3, NULL, NULL, D3DVS_VERSION(3,0), -1},
|
||||
{D3DSIO_NRM, "nrm", NULL, 1, 2, vshader_nrm, NULL, shader_glsl_map2gl, 0, 0},
|
||||
{D3DSIO_SINCOS, "sincos", NULL, 1, 4, vshader_sincos2, NULL, NULL, D3DVS_VERSION(2,0), D3DVS_VERSION(2,0)},
|
||||
{D3DSIO_SINCOS, "sincos", NULL, 1, 2, vshader_sincos3, NULL, NULL, D3DVS_VERSION(3,0), -1},
|
||||
|
||||
/* Matrix */
|
||||
{D3DSIO_M4x4, "m4x4", "undefined", 3, vshader_m4x4, vshader_hw_mnxn, shader_glsl_mnxn, 0, 0},
|
||||
{D3DSIO_M4x3, "m4x3", "undefined", 3, vshader_m4x3, vshader_hw_mnxn, shader_glsl_mnxn, 0, 0},
|
||||
{D3DSIO_M3x4, "m3x4", "undefined", 3, vshader_m3x4, vshader_hw_mnxn, shader_glsl_mnxn, 0, 0},
|
||||
{D3DSIO_M3x3, "m3x3", "undefined", 3, vshader_m3x3, vshader_hw_mnxn, shader_glsl_mnxn, 0, 0},
|
||||
{D3DSIO_M3x2, "m3x2", "undefined", 3, vshader_m3x2, vshader_hw_mnxn, shader_glsl_mnxn, 0, 0},
|
||||
{D3DSIO_M4x4, "m4x4", "undefined", 1, 3, vshader_m4x4, vshader_hw_mnxn, shader_glsl_mnxn, 0, 0},
|
||||
{D3DSIO_M4x3, "m4x3", "undefined", 1, 3, vshader_m4x3, vshader_hw_mnxn, shader_glsl_mnxn, 0, 0},
|
||||
{D3DSIO_M3x4, "m3x4", "undefined", 1, 3, vshader_m3x4, vshader_hw_mnxn, shader_glsl_mnxn, 0, 0},
|
||||
{D3DSIO_M3x3, "m3x3", "undefined", 1, 3, vshader_m3x3, vshader_hw_mnxn, shader_glsl_mnxn, 0, 0},
|
||||
{D3DSIO_M3x2, "m3x2", "undefined", 1, 3, vshader_m3x2, vshader_hw_mnxn, shader_glsl_mnxn, 0, 0},
|
||||
|
||||
/* Declare registers */
|
||||
{D3DSIO_DCL, "dcl", NULL, 2, vshader_dcl, NULL, NULL, 0, 0},
|
||||
{D3DSIO_DCL, "dcl", NULL, 0, 2, vshader_dcl, NULL, NULL, 0, 0},
|
||||
|
||||
/* Constant definitions */
|
||||
{D3DSIO_DEF, "def", NULL, 5, vshader_def, shader_hw_def, shader_glsl_def, 0, 0},
|
||||
{D3DSIO_DEFB, "defb", GLNAME_REQUIRE_GLSL, 2, vshader_defb, NULL, NULL, 0, 0},
|
||||
{D3DSIO_DEFI, "defi", GLNAME_REQUIRE_GLSL, 5, vshader_defi, NULL, NULL, 0, 0},
|
||||
{D3DSIO_DEF, "def", NULL, 1, 5, vshader_def, shader_hw_def, shader_glsl_def, 0, 0},
|
||||
{D3DSIO_DEFB, "defb", GLNAME_REQUIRE_GLSL, 1, 2, vshader_defb, NULL, NULL, 0, 0},
|
||||
{D3DSIO_DEFI, "defi", GLNAME_REQUIRE_GLSL, 1, 5, vshader_defi, NULL, NULL, 0, 0},
|
||||
|
||||
/* Flow control - requires GLSL or software shaders */
|
||||
{D3DSIO_REP , "rep", GLNAME_REQUIRE_GLSL, 1, vshader_rep, NULL, NULL, 0, 0},
|
||||
{D3DSIO_ENDREP, "endrep", GLNAME_REQUIRE_GLSL, 0, vshader_endrep, NULL, NULL, 0, 0},
|
||||
{D3DSIO_IF, "if", GLNAME_REQUIRE_GLSL, 1, vshader_if, NULL, NULL, 0, 0},
|
||||
{D3DSIO_IFC, "ifc", GLNAME_REQUIRE_GLSL, 2, vshader_ifc, NULL, NULL, 0, 0},
|
||||
{D3DSIO_ELSE, "else", GLNAME_REQUIRE_GLSL, 0, vshader_else, NULL, NULL, 0, 0},
|
||||
{D3DSIO_ENDIF, "endif", GLNAME_REQUIRE_GLSL, 0, vshader_endif, NULL, NULL, 0, 0},
|
||||
{D3DSIO_BREAK, "break", GLNAME_REQUIRE_GLSL, 0, vshader_break, NULL, NULL, 0, 0},
|
||||
{D3DSIO_BREAKC, "breakc", GLNAME_REQUIRE_GLSL, 2, vshader_breakc, NULL, NULL, 0, 0},
|
||||
{D3DSIO_BREAKP, "breakp", GLNAME_REQUIRE_GLSL, 1, vshader_breakp, NULL, NULL, 0, 0},
|
||||
{D3DSIO_CALL, "call", GLNAME_REQUIRE_GLSL, 1, vshader_call, NULL, NULL, 0, 0},
|
||||
{D3DSIO_CALLNZ, "callnz", GLNAME_REQUIRE_GLSL, 2, vshader_callnz, NULL, NULL, 0, 0},
|
||||
{D3DSIO_LOOP, "loop", GLNAME_REQUIRE_GLSL, 2, vshader_loop, NULL, NULL, 0, 0},
|
||||
{D3DSIO_RET, "ret", GLNAME_REQUIRE_GLSL, 0, vshader_ret, NULL, NULL, 0, 0},
|
||||
{D3DSIO_ENDLOOP, "endloop", GLNAME_REQUIRE_GLSL, 0, vshader_endloop, NULL, NULL, 0, 0},
|
||||
{D3DSIO_LABEL, "label", GLNAME_REQUIRE_GLSL, 1, vshader_label, NULL, NULL, 0, 0},
|
||||
{D3DSIO_REP , "rep", GLNAME_REQUIRE_GLSL, 0, 1, vshader_rep, NULL, NULL, 0, 0},
|
||||
{D3DSIO_ENDREP, "endrep", GLNAME_REQUIRE_GLSL, 0, 0, vshader_endrep, NULL, NULL, 0, 0},
|
||||
{D3DSIO_IF, "if", GLNAME_REQUIRE_GLSL, 0, 1, vshader_if, NULL, NULL, 0, 0},
|
||||
{D3DSIO_IFC, "ifc", GLNAME_REQUIRE_GLSL, 0, 2, vshader_ifc, NULL, NULL, 0, 0},
|
||||
{D3DSIO_ELSE, "else", GLNAME_REQUIRE_GLSL, 0, 0, vshader_else, NULL, NULL, 0, 0},
|
||||
{D3DSIO_ENDIF, "endif", GLNAME_REQUIRE_GLSL, 0, 0, vshader_endif, NULL, NULL, 0, 0},
|
||||
{D3DSIO_BREAK, "break", GLNAME_REQUIRE_GLSL, 0, 0, vshader_break, NULL, NULL, 0, 0},
|
||||
{D3DSIO_BREAKC, "breakc", GLNAME_REQUIRE_GLSL, 0, 2, vshader_breakc, NULL, NULL, 0, 0},
|
||||
{D3DSIO_BREAKP, "breakp", GLNAME_REQUIRE_GLSL, 0, 1, vshader_breakp, NULL, NULL, 0, 0},
|
||||
{D3DSIO_CALL, "call", GLNAME_REQUIRE_GLSL, 0, 1, vshader_call, NULL, NULL, 0, 0},
|
||||
{D3DSIO_CALLNZ, "callnz", GLNAME_REQUIRE_GLSL, 0, 2, vshader_callnz, NULL, NULL, 0, 0},
|
||||
{D3DSIO_LOOP, "loop", GLNAME_REQUIRE_GLSL, 0, 2, vshader_loop, NULL, NULL, 0, 0},
|
||||
{D3DSIO_RET, "ret", GLNAME_REQUIRE_GLSL, 0, 0, vshader_ret, NULL, NULL, 0, 0},
|
||||
{D3DSIO_ENDLOOP, "endloop", GLNAME_REQUIRE_GLSL, 0, 0, vshader_endloop, NULL, NULL, 0, 0},
|
||||
{D3DSIO_LABEL, "label", GLNAME_REQUIRE_GLSL, 0, 1, vshader_label, NULL, NULL, 0, 0},
|
||||
|
||||
{D3DSIO_MOVA, "mova", GLNAME_REQUIRE_GLSL, 2, vshader_mova, NULL, shader_glsl_mov, 0, 0},
|
||||
{D3DSIO_SETP, "setp", GLNAME_REQUIRE_GLSL, 3, vshader_setp, NULL, NULL, 0, 0},
|
||||
{D3DSIO_TEXLDL, "texdl", GLNAME_REQUIRE_GLSL, 2, vshader_texldl, NULL, NULL, 0, 0},
|
||||
{0, NULL, NULL, 0, NULL, NULL, 0, 0}
|
||||
{D3DSIO_MOVA, "mova", GLNAME_REQUIRE_GLSL, 1, 2, vshader_mova, NULL, shader_glsl_mov, 0, 0},
|
||||
{D3DSIO_SETP, "setp", GLNAME_REQUIRE_GLSL, 1, 3, vshader_setp, NULL, NULL, 0, 0},
|
||||
{D3DSIO_TEXLDL, "texdl", GLNAME_REQUIRE_GLSL, 1, 2, vshader_texldl, NULL, NULL, 0, 0},
|
||||
{0, NULL, NULL, 0, 0, NULL, NULL, 0, 0}
|
||||
};
|
||||
|
||||
inline static void vshader_program_add_output_param_swizzle(const DWORD param, int is_color, char *hwLine) {
|
||||
|
|
|
@ -1290,6 +1290,7 @@ typedef struct SHADER_OPCODE {
|
|||
unsigned int opcode;
|
||||
const char* name;
|
||||
const char* glname;
|
||||
char dst_token;
|
||||
CONST UINT num_params;
|
||||
shader_fct_t soft_fct;
|
||||
SHADER_HANDLER hw_fct;
|
||||
|
|
Loading…
Reference in a new issue