diff options
author | Jason Ekstrand <[email protected]> | 2016-09-15 21:12:34 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-10-03 16:17:12 -0700 |
commit | 6ffbfc760da14fc710a05438b9fd9eff034128da (patch) | |
tree | d0d2f0d3f98c7a3a13e53e67d38426b2a520732b /src/compiler/spirv/vtn_private.h | |
parent | 7697b4b98b155c818811709becdb408772371538 (diff) |
nir/spirv/cfg: Use a nop intrinsic for tagging the ends of blocks
Previously, we were saving off the last nir_block in a vtn_block before
moving on so that we could find the nir_block again when it came time to
handle phi sources. Unfortunately, NIR's control flow modification code is
inconsistent when it comes to how it splits blocks so the block pointer we
saved off may point to a block somewhere else in the shader by the time we
get around to handling phi sources. In order to get around this, we insert
a nop instruction and use that as the logical end of our block. Since the
control flow manipulation code respects instructions, the nop will keeps
its place like any other instruction and we can easily find the end of our
block when we need it.
This fixes a bug triggered by a couple of vkQuake shaders.
Signed-off-by: Jason Ekstrand <[email protected]>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97233
Cc: "12.0" <[email protected]>
Tested-by: Dave Airlie <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler/spirv/vtn_private.h')
-rw-r--r-- | src/compiler/spirv/vtn_private.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/spirv/vtn_private.h b/src/compiler/spirv/vtn_private.h index 7f5444ee875..6f34f09ebd2 100644 --- a/src/compiler/spirv/vtn_private.h +++ b/src/compiler/spirv/vtn_private.h @@ -149,8 +149,8 @@ struct vtn_block { /** Points to the switch case started by this block (if any) */ struct vtn_case *switch_case; - /** The last block in this SPIR-V block. */ - nir_block *end_block; + /** Every block ends in a nop intrinsic so that we can find it again */ + nir_intrinsic_instr *end_nop; }; struct vtn_function { |