summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600_shader.c
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2013-11-30 06:26:13 +0000
committerDave Airlie <[email protected]>2014-02-05 10:49:38 +1000
commit461c463bb2cf324f34bf76562f9942ceb1d69dec (patch)
treef6b07537aacbc5f363acea70da3a94635c5b1800 /src/gallium/drivers/r600/r600_shader.c
parentc4782a58c30473e5f67c7361c6c57160f940a978 (diff)
r600g: emit NOPs at end of shaders in more cases
If the shader has no CF clauses at all emit an nop If the last instruction is an ENDLOOP add a NOP for the LOOP to go to if the last instruction is CALL_FS add a NOP These fix a bunch of hangs in the geometry shader tests. Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/r600_shader.c')
-rw-r--r--src/gallium/drivers/r600/r600_shader.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index 59fda7b7e54..5d3f7c89406 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -1931,10 +1931,13 @@ static int r600_shader_from_tgsi(struct r600_context *rctx,
if (ctx.bc->chip_class == CAYMAN)
cm_bytecode_add_cf_end(ctx.bc);
else {
- const struct cf_op_info *last = r600_isa_cf(ctx.bc->cf_last->op);
+ const struct cf_op_info *last = NULL;
+
+ if (ctx.bc->cf_last)
+ last = r600_isa_cf(ctx.bc->cf_last->op);
/* alu clause instructions don't have EOP bit, so add NOP */
- if (last->flags & CF_ALU)
+ if (!last || last->flags & CF_ALU || ctx.bc->cf_last->op == CF_OP_LOOP_END || ctx.bc->cf_last->op == CF_OP_CALL_FS)
r600_bytecode_add_cfinst(ctx.bc, CF_OP_NOP);
ctx.bc->cf_last->end_of_program = 1;