diff options
author | Eric Anholt <[email protected]> | 2016-11-10 17:28:20 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2016-11-12 19:21:46 -0800 |
commit | ace0d810e56a1e2978fc3ac237158918ebe2a23c (patch) | |
tree | 7f82646ddac47d8c3bf232795d2d1cccda29ae7c /src/gallium/drivers/vc4/vc4_program.c | |
parent | 67f72c5f5d8172be1bdb970e672202f0a47bac88 (diff) |
vc4: Flag the last thread switch in the program as the last.
We don't allow the last thread switch to be inside control flow, to be
sure that we hit the last state exactly once. If the last texturing was
in control flow, fall back to single threaded.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_program.c')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_program.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c index ad06d8558fe..d2281ce6bd3 100644 --- a/src/gallium/drivers/vc4/vc4_program.c +++ b/src/gallium/drivers/vc4/vc4_program.c @@ -2285,6 +2285,17 @@ vc4_shader_ntq(struct vc4_context *vc4, enum qstage stage, switch (stage) { case QSTAGE_FRAG: + /* FS threading requires that the thread execute + * QPU_SIG_LAST_THREAD_SWITCH exactly once before terminating + * (with no other THRSW afterwards, obviously). If we didn't + * fetch a texture at a top level block, this wouldn't be + * true. + */ + if (c->fs_threaded && !c->last_thrsw_at_top_level) { + c->failed = true; + return c; + } + emit_frag_end(c); break; case QSTAGE_VERT: |