nv2a: Enable exclusive clip

This commit is contained in:
Matt Borgerson 2021-06-02 17:29:14 -07:00 committed by mborgerson
parent ebcc77c6c8
commit 6f477f02a6
2 changed files with 3 additions and 6 deletions

View File

@ -3747,7 +3747,6 @@ static void pgraph_bind_shaders(PGRAPHState *pg)
/* register combiner stuff */
state.psh.window_clip_exclusive = pg->regs[NV_PGRAPH_SETUPRASTER]
& NV_PGRAPH_SETUPRASTER_WINDOWCLIPTYPE;
assert(!state.psh.window_clip_exclusive); /* FIXME: Untested */
state.psh.combiner_control = pg->regs[NV_PGRAPH_COMBINECTL];
state.psh.shader_stage_program = pg->regs[NV_PGRAPH_SHADERPROG];
state.psh.other_stage_input = pg->regs[NV_PGRAPH_SHADERCTL];

View File

@ -621,19 +621,17 @@ static MString* psh_convert(struct PixelShader *ps)
" greaterThan(gl_FragCoord.xy-0.5, clipRegion[i].zw));\n"
" if (!any(clipTest)) {\n");
if (ps->state.window_clip_exclusive) {
/* Pixel in clip region = exclude by discarding */
mstring_append(clip, " discard;\n");
assert(false); /* Untested */
} else {
/* Pixel in clip region = mark pixel as contained and leave */
mstring_append(clip, " clipContained = true;\n"
" break;\n");
}
mstring_append(clip, " }\n"
"}\n");
/* Check for inclusive window clip */
if (!ps->state.window_clip_exclusive) {
mstring_append(clip, "if (!clipContained) { discard; }\n");
mstring_append(clip, "if (!clipContained) {\n"
" discard;\n"
"}\n");
}
/* calculate perspective-correct inputs */