summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2014-11-18 11:22:01 +1000
committerEmil Velikov <[email protected]>2014-11-19 00:53:00 +0000
commit7b62f0eb50ce4cecece40f66a40877f81c7bfac1 (patch)
tree3bc58a8d8bb76dc237acfd1d6894ad902f271385 /src
parentfa62619da56d87468018b6aacb625adcf275a741 (diff)
r600g/cayman: handle empty vertex shaders
Some of the geom shader tests produce an empty vertex shader, on cayman we'd crash in the finaliser because last_cf was NULL. cayman doesn't need the NOP workaround, so if the code arrives here with no last_cf, just emit an END. fixes crashes in a bunch of piglit geom shader tests. Cc: "10.3 10.4" <[email protected]> Reviewed-by: Glenn Kennard <[email protected]> Signed-off-by: Dave Airlie <[email protected]> (cherry picked from commit 4e520101e6a0b4fcd930323c32d1a8a6348c8417)
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/r600/sb/sb_bc_finalize.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gallium/drivers/r600/sb/sb_bc_finalize.cpp b/src/gallium/drivers/r600/sb/sb_bc_finalize.cpp
index 5c22f964690..f0849ca6b6b 100644
--- a/src/gallium/drivers/r600/sb/sb_bc_finalize.cpp
+++ b/src/gallium/drivers/r600/sb/sb_bc_finalize.cpp
@@ -83,14 +83,18 @@ int bc_finalizer::run() {
last_cf = c;
}
- if (last_cf->bc.op_ptr->flags & CF_ALU) {
+ if (!ctx.is_cayman() && last_cf->bc.op_ptr->flags & CF_ALU) {
last_cf = sh.create_cf(CF_OP_NOP);
sh.root->push_back(last_cf);
}
- if (ctx.is_cayman())
- last_cf->insert_after(sh.create_cf(CF_OP_CF_END));
- else
+ if (ctx.is_cayman()) {
+ if (!last_cf) {
+ cf_node *c = sh.create_cf(CF_OP_CF_END);
+ sh.root->push_back(c);
+ } else
+ last_cf->insert_after(sh.create_cf(CF_OP_CF_END));
+ } else
last_cf->bc.end_of_program = 1;
for (unsigned t = EXP_PIXEL; t < EXP_TYPE_COUNT; ++t) {