mirror of https://github.com/xemu-project/xemu.git
Cleanup PSH and alphakill
This commit is contained in:
parent
939ad0121a
commit
71ad6234fa
|
@ -2975,14 +2975,12 @@ static void pgraph_bind_shaders(PGRAPHState *pg)
|
||||||
state.rect_tex[i] = true;
|
state.rect_tex[i] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int j;
|
for (j = 0; j < 4; j++) {
|
||||||
for(j = 0; j < 4; j++) {
|
|
||||||
/* compare_mode[i][j] = stage i, component j { s,t,r,q } */
|
|
||||||
state.compare_mode[i][j] =
|
state.compare_mode[i][j] =
|
||||||
(pg->regs[NV_PGRAPH_SHADERCLIPMODE] >> (4 * i + j)) & 1;
|
(pg->regs[NV_PGRAPH_SHADERCLIPMODE] >> (4 * i + j)) & 1;
|
||||||
}
|
}
|
||||||
state.alphakill[i] = GET_MASK(pg->regs[NV_PGRAPH_TEXCTL0_0 + i*4],
|
state.alphakill[i] = pg->regs[NV_PGRAPH_TEXCTL0_0 + i*4]
|
||||||
NV_PGRAPH_TEXCTL0_0_ALPHAKILLEN);
|
& NV_PGRAPH_TEXCTL0_0_ALPHAKILLEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
ShaderBinding* cached_shader = g_hash_table_lookup(pg->shader_cache, &state);
|
ShaderBinding* cached_shader = g_hash_table_lookup(pg->shader_cache, &state);
|
||||||
|
|
|
@ -597,16 +597,19 @@ static QString* psh_convert(struct PixelShader *ps)
|
||||||
case PS_TEXTUREMODES_PASSTHRU:
|
case PS_TEXTUREMODES_PASSTHRU:
|
||||||
qstring_append_fmt(vars, "vec4 t%d = pT%d;\n", i, i);
|
qstring_append_fmt(vars, "vec4 t%d = pT%d;\n", i, i);
|
||||||
break;
|
break;
|
||||||
|
case PS_TEXTUREMODES_DOT_RFLCT_SPEC:
|
||||||
|
assert(false);
|
||||||
|
break;
|
||||||
case PS_TEXTUREMODES_DPNDNT_AR:
|
case PS_TEXTUREMODES_DPNDNT_AR:
|
||||||
assert(!ps->rect_tex[i]);
|
assert(!ps->rect_tex[i]);
|
||||||
sampler_type = "sampler2D";
|
sampler_type = "sampler2D";
|
||||||
qstring_append_fmt(vars, " vec4 t%d = texture(texSamp%d, t%d.ar);\n",
|
qstring_append_fmt(vars, "vec4 t%d = texture(texSamp%d, t%d.ar);\n",
|
||||||
i, i, ps->input_tex[i]);
|
i, i, ps->input_tex[i]);
|
||||||
break;
|
break;
|
||||||
case PS_TEXTUREMODES_DPNDNT_GB:
|
case PS_TEXTUREMODES_DPNDNT_GB:
|
||||||
assert(!ps->rect_tex[i]);
|
assert(!ps->rect_tex[i]);
|
||||||
sampler_type = "sampler2D";
|
sampler_type = "sampler2D";
|
||||||
qstring_append_fmt(vars, " vec4 t%d = texture(texSamp%d, t%d.gb);\n",
|
qstring_append_fmt(vars, "vec4 t%d = texture(texSamp%d, t%d.gb);\n",
|
||||||
i, i, ps->input_tex[i]);
|
i, i, ps->input_tex[i]);
|
||||||
break;
|
break;
|
||||||
case PS_TEXTUREMODES_BUMPENVMAP_LUM:
|
case PS_TEXTUREMODES_BUMPENVMAP_LUM:
|
||||||
|
@ -626,8 +629,7 @@ static QString* psh_convert(struct PixelShader *ps)
|
||||||
break;
|
break;
|
||||||
case PS_TEXTUREMODES_CLIPPLANE: {
|
case PS_TEXTUREMODES_CLIPPLANE: {
|
||||||
int j;
|
int j;
|
||||||
assert(false); /* FIXME: Untested */
|
qstring_append_fmt(vars, "vec4 t%d = vec4(0.0); /* PS_TEXTUREMODES_CLIPPLANE */\n",
|
||||||
qstring_append_fmt(vars, " vec4 t%d = vec4(0.0); /* PS_TEXTUREMODES_CLIPPLANE */\n",
|
|
||||||
i);
|
i);
|
||||||
for (j = 0; j < 4; j++) {
|
for (j = 0; j < 4; j++) {
|
||||||
qstring_append_fmt(vars, " if(pT%d.%c %s 0.0) { discard; };\n",
|
qstring_append_fmt(vars, " if(pT%d.%c %s 0.0) { discard; };\n",
|
||||||
|
@ -637,7 +639,7 @@ static QString* psh_convert(struct PixelShader *ps)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PS_TEXTUREMODES_DOTPRODUCT:
|
case PS_TEXTUREMODES_DOTPRODUCT:
|
||||||
qstring_append_fmt(vars, " vec4 t%d = vec4(dot(pT%d.xyz, t%d.rgb));\n",
|
qstring_append_fmt(vars, "vec4 t%d = vec4(dot(pT%d.xyz, t%d.rgb));\n",
|
||||||
i, i, ps->input_tex[i]);
|
i, i, ps->input_tex[i]);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in New Issue