summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_program.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2016-11-07 09:05:59 -0800
committerEmil Velikov <emil.l.velikov@gmail.com>2016-11-23 13:07:00 +0000
commit9a4206379b0e36d440481ae89b98467ed53dc86b (patch)
tree6d9b1420beb64122d90d2e73b77c154dd9e97add /src/gallium/drivers/vc4/vc4_program.c
parent4685a724f5894a3426419b9b3d4f0ec129493ad1 (diff)
downloadexternal_mesa3d-9a4206379b0e36d440481ae89b98467ed53dc86b.zip
external_mesa3d-9a4206379b0e36d440481ae89b98467ed53dc86b.tar.gz
external_mesa3d-9a4206379b0e36d440481ae89b98467ed53dc86b.tar.bz2
vc4: Don't abort when a shader compile fails.
It's much better to just skip the draw call entirely. Getting this information out of register allocation will also be useful for implementing threaded fragment shaders, which will need to retry non-threaded if RA fails. Cc: <mesa-stable@lists.freedesktop.org> (cherry picked from commit 4d019bd703e7c20d56d5b858577607115b4926a3)
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_program.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_program.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c
index 0145488..fe07d91 100644
--- a/src/gallium/drivers/vc4/vc4_program.c
+++ b/src/gallium/drivers/vc4/vc4_program.c
@@ -2437,9 +2437,15 @@ vc4_get_compiled_shader(struct vc4_context *vc4, enum qstage stage,
}
}
- copy_uniform_state_to_shader(shader, c);
- shader->bo = vc4_bo_alloc_shader(vc4->screen, c->qpu_insts,
- c->qpu_inst_count * sizeof(uint64_t));
+ shader->failed = c->failed;
+ if (c->failed) {
+ shader->failed = true;
+ } else {
+ copy_uniform_state_to_shader(shader, c);
+ shader->bo = vc4_bo_alloc_shader(vc4->screen, c->qpu_insts,
+ c->qpu_inst_count *
+ sizeof(uint64_t));
+ }
/* Copy the compiler UBO range state to the compiled shader, dropping
* out arrays that were never referenced by an indirect load.
@@ -2642,11 +2648,15 @@ vc4_update_compiled_vs(struct vc4_context *vc4, uint8_t prim_mode)
}
}
-void
+bool
vc4_update_compiled_shaders(struct vc4_context *vc4, uint8_t prim_mode)
{
vc4_update_compiled_fs(vc4, prim_mode);
vc4_update_compiled_vs(vc4, prim_mode);
+
+ return !(vc4->prog.cs->failed ||
+ vc4->prog.vs->failed ||
+ vc4->prog.fs->failed);
}
static uint32_t