diff options
author | Eric Anholt <[email protected]> | 2017-09-30 16:48:44 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2017-10-10 11:42:05 -0700 |
commit | ec5af12b5d54f65ab119ce6f4eecd3a9fee5407d (patch) | |
tree | eb04df11332bef68dac3f3abdb33088c21a4533b /src/gallium/drivers/vc5/vc5_job.c | |
parent | 361c5f28bdc6858618e9de85a340adce1b217e2c (diff) |
broadcom/vc5: Flush the job when mapping a transform feedback buffer.
We will want something fancier for reusing a TF output within the same
frame, but we at least need this in order for piglit tests to work.
Diffstat (limited to 'src/gallium/drivers/vc5/vc5_job.c')
-rw-r--r-- | src/gallium/drivers/vc5/vc5_job.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc5/vc5_job.c b/src/gallium/drivers/vc5/vc5_job.c index f90b449aca7..5b97e6bf72f 100644 --- a/src/gallium/drivers/vc5/vc5_job.c +++ b/src/gallium/drivers/vc5/vc5_job.c @@ -53,6 +53,16 @@ vc5_job_free(struct vc5_context *vc5, struct vc5_job *job) remove_from_ht(vc5->jobs, &job->key); + if (job->write_prscs) { + struct set_entry *entry; + + set_foreach(job->write_prscs, entry) { + const struct pipe_resource *prsc = entry->key; + + remove_from_ht(vc5->write_jobs, (void *)prsc); + } + } + for (int i = 0; i < VC5_MAX_DRAW_BUFFERS; i++) { if (job->cbufs[i]) { remove_from_ht(vc5->write_jobs, job->cbufs[i]->texture); @@ -121,6 +131,21 @@ vc5_job_add_bo(struct vc5_job *job, struct vc5_bo *bo) } void +vc5_job_add_write_resource(struct vc5_job *job, struct pipe_resource *prsc) +{ + struct vc5_context *vc5 = job->vc5; + + if (!job->write_prscs) { + job->write_prscs = _mesa_set_create(job, + _mesa_hash_pointer, + _mesa_key_pointer_equal); + } + + _mesa_set_add(job->write_prscs, prsc); + _mesa_hash_table_insert(vc5->write_jobs, prsc, job); +} + +void vc5_flush_jobs_writing_resource(struct vc5_context *vc5, struct pipe_resource *prsc) { |