diff options
author | Alyssa Rosenzweig <[email protected]> | 2020-02-04 09:28:06 -0500 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2020-02-16 09:16:47 -0500 |
commit | a55a2e02a54cadcd9466d02021c2c7a0739c373f (patch) | |
tree | da6f3d30343b76824739e5df22d0cccb5ef9e9dc /src/panfrost | |
parent | 3f59098d1a7a00d51e2b15e06aba359835c7e1ea (diff) |
pan/midgard: Allow jumping out of a shader
This comes up as a `return;` instruction in a compute shader. We need to
use the special tag 1 to signify "break". Fixes numerous
INSTR_INVALID_ENC faults in dEQP-GLES31.functional.compute.basic.*
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3835>
Diffstat (limited to 'src/panfrost')
-rw-r--r-- | src/panfrost/midgard/midgard_compile.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c index 4bc494ca1be..30a81a4afd1 100644 --- a/src/panfrost/midgard/midgard_compile.c +++ b/src/panfrost/midgard/midgard_compile.c @@ -2690,19 +2690,19 @@ midgard_get_first_tag_from_block(compiler_context *ctx, unsigned block_idx) { midgard_block *initial_block = mir_get_block(ctx, block_idx); - unsigned first_tag = 0; - mir_foreach_block_from(ctx, initial_block, v) { if (v->quadword_count) { midgard_bundle *initial_bundle = util_dynarray_element(&v->bundles, midgard_bundle, 0); - first_tag = initial_bundle->tag; - break; + return initial_bundle->tag; } } - return first_tag; + /* Default to a tag 1 which will break from the shader, in case we jump + * to the exit block (i.e. `return` in a compute shader) */ + + return 1; } static unsigned |