Merge pull request #64 from JayFoxRox/forgotten-code

Fix alphakill and hopefully clip planes
This commit is contained in:
Jannik Vogel 2015-09-29 03:05:12 +02:00
commit a0c76c5b5b
1 changed files with 5 additions and 2 deletions

View File

@ -646,7 +646,6 @@ static QString* psh_convert(struct PixelShader *ps)
/* As this means a texture fetch does happen, do alphakill */ /* As this means a texture fetch does happen, do alphakill */
if (ps->alphakill[i]) { if (ps->alphakill[i]) {
assert(false); /* FIXME: Untested */
qstring_append_fmt(vars, "if (t%d.a == 0.0) { discard; };\n", qstring_append_fmt(vars, "if (t%d.a == 0.0) { discard; };\n",
i); i);
} }
@ -764,7 +763,7 @@ QString *psh_translate(uint32_t combiner_control, uint32_t shader_stage_program,
const bool alphakill[4], const bool alphakill[4],
bool alpha_test, enum PshAlphaFunc alpha_func) bool alpha_test, enum PshAlphaFunc alpha_func)
{ {
int i; int i, j;
struct PixelShader ps; struct PixelShader ps;
memset(&ps, 0, sizeof(ps)); memset(&ps, 0, sizeof(ps));
@ -773,6 +772,10 @@ QString *psh_translate(uint32_t combiner_control, uint32_t shader_stage_program,
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
ps.tex_modes[i] = (shader_stage_program >> (i * 5)) & 0x1F; ps.tex_modes[i] = (shader_stage_program >> (i * 5)) & 0x1F;
ps.rect_tex[i] = rect_tex[i]; ps.rect_tex[i] = rect_tex[i];
for (j = 0; j < 4; j++) {
ps.compare_mode[i][j] = compare_mode[i][j];
}
ps.alphakill[i] = alphakill[i];
} }
ps.alpha_test = alpha_test; ps.alpha_test = alpha_test;