diff options
author | rodri <rgl@antares-labs.eu> | 2024-09-10 14:26:35 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2024-09-10 14:26:35 +0000 |
commit | 8806aad87f7be2d2e82c7db2b9f0978246e5a747 (patch) | |
tree | ec1e040177c0e352331911664bba862bd50fddf3 /internal.h | |
parent | 6d137698282ca2c04eff4b52ac8e69ac10164a90 (diff) | |
download | libgraphics-8806aad87f7be2d2e82c7db2b9f0978246e5a747.tar.gz libgraphics-8806aad87f7be2d2e82c7db2b9f0978246e5a747.tar.bz2 libgraphics-8806aad87f7be2d2e82c7db2b9f0978246e5a747.zip |
fix a use-after-free when profiling rasterizer times.
this commit also includes the turbo drawing pool.
the experiment was successful in getting reasonable
drawing times to a fullhd image, but the process
causes glitches when moving the objects around,
which is unacceptable.
it's been commented out for now.
Diffstat (limited to 'internal.h')
-rw-r--r-- | internal.h | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -39,6 +39,27 @@ struct Rastertask Primitive p; }; +typedef struct Proctask Proctask; +typedef struct Procpool Procpool; + +struct Proctask +{ + void (*fn)(void*); + void *arg; +}; + +struct Procpool +{ + ulong nprocs; + Ref issued; + Ref complete; + + Channel *subq; /* task submission queue */ + Channel *done; /* task completion signal */ +}; + +extern Procpool *turbodrawingpool; + /* alloc */ void *emalloc(ulong); void *erealloc(void*, ulong); @@ -79,6 +100,12 @@ void memsetl(void*, ulong, usize); /* nanosec */ uvlong nanosec(void); +/* procpool */ +Procpool *mkprocpool(ulong); +void procpoolexec(Procpool*, void(*)(void*), void*); +void procpoolwait(Procpool*); +void rmprocpool(Procpool*); + #define getpixel(fb, p) rastergetcolor(fb, p) #define putpixel(fb, p, c) rasterputcolor(fb, p, c) #define getdepth(fb, p) rastergetfloat(fb, p) |