diff options
author | rodri <rgl@antares-labs.eu> | 2024-09-08 14:31:19 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2024-09-08 14:31:19 +0000 |
commit | ef7b6cacac451015b7c3f0ed96eeeb002daab7db (patch) | |
tree | 4584d1420210e2b9c3e9c14a08473767b399a1b1 | |
parent | fb2c8083f028676d0c46e0d9a89de78b3f129552 (diff) | |
download | libgraphics-ef7b6cacac451015b7c3f0ed96eeeb002daab7db.tar.gz libgraphics-ef7b6cacac451015b7c3f0ed96eeeb002daab7db.tar.bz2 libgraphics-ef7b6cacac451015b7c3f0ed96eeeb002daab7db.zip |
allocate renderjob times dynamically for the parallel stages.
-rw-r--r-- | camera.c | 4 | ||||
-rw-r--r-- | graphics.h | 2 | ||||
-rw-r--r-- | render.c | 13 |
3 files changed, 10 insertions, 9 deletions
@@ -270,8 +270,8 @@ shootcamera(Camera *c, Shadertab *s) updatestats(c, t1-t0); printtimings(job); -// free(job->times.Tn); -// free(job->times.Rn); + free(job->times.Tn); + free(job->times.Rn); chanfree(job->donec); free(job->camera); @@ -256,7 +256,7 @@ struct Renderjob struct { /* renderer, entityproc, tilers, rasterizers */ - Rendertime R, E, Tn[20], Rn[20]; + Rendertime R, E, *Tn, *Rn; } times; Renderjob *next; @@ -642,12 +642,13 @@ entityproc(void *arg) params->job->times.E.t0 = t0; /* prof: initialize timing slots for the next stages */ -// if(params->job->times.Tn == nil){ -// params->job->times.Tn = emalloc(nproc*sizeof(Rendertime)); -// params->job->times.Rn = emalloc(nproc*sizeof(Rendertime)); -// memset(params->job->times.Tn, 0, nproc*sizeof(Rendertime)); -// memset(params->job->times.Rn, 0, nproc*sizeof(Rendertime)); -// } + if(params->job->times.Tn == nil){ + assert(params->job->times.Rn == nil); + params->job->times.Tn = emalloc(nproc*sizeof(Rendertime)); + params->job->times.Rn = emalloc(nproc*sizeof(Rendertime)); + memset(params->job->times.Tn, 0, nproc*sizeof(Rendertime)); + memset(params->job->times.Rn, 0, nproc*sizeof(Rendertime)); + } /* end of job */ if(params->entity == nil){ |