aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-12-31 11:51:01 -0800
committerEric Anholt <[email protected]>2019-01-02 14:12:29 -0800
commit3a81c753a3cfdcea215268c00f98ac87a09902e1 (patch)
tree27c051e8b959f8b506a91c0d072ef74bd473d997
parent3ae57957be0296eea6799655e5f945db714c2584 (diff)
v3d: Fix segfault when failing to compile a program.
We'll still fail at draw time, but this avoids a regression in shader-db execution once I enable TLB writes in precompiles. Fixes: b38e4d313fc2 ("v3d: Create a state uploader for packing our shaders together.")
-rw-r--r--src/gallium/drivers/v3d/v3d_program.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/drivers/v3d/v3d_program.c b/src/gallium/drivers/v3d/v3d_program.c
index 759fac117f2..ef80069baab 100644
--- a/src/gallium/drivers/v3d/v3d_program.c
+++ b/src/gallium/drivers/v3d/v3d_program.c
@@ -373,8 +373,10 @@ v3d_get_compiled_shader(struct v3d_context *v3d, struct v3d_key *key)
v3d_set_shader_uniform_dirty_flags(shader);
- u_upload_data(v3d->state_uploader, 0, shader_size, 8,
- qpu_insts, &shader->offset, &shader->resource);
+ if (shader_size) {
+ u_upload_data(v3d->state_uploader, 0, shader_size, 8,
+ qpu_insts, &shader->offset, &shader->resource);
+ }
free(qpu_insts);