From d8f71404ffd54af08bc84dbb04e60cb07e83a021 Mon Sep 17 00:00:00 2001 From: rodri Date: Fri, 20 Sep 2024 21:44:07 +0000 Subject: implement clipped drawing. take branching out of the upscaler loop. the rasterizers now produce a bbox of used fragments/pixels that are unified at the end of every job/frame. we use that when drawing so only the part that was rasterized gets sent to devdraw. --- graphics.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'graphics.h') diff --git a/graphics.h b/graphics.h index bc18069..089156a 100644 --- a/graphics.h +++ b/graphics.h @@ -258,6 +258,8 @@ struct Renderjob Scene *scene; Shadertab *shaders; Channel *donec; + Rectangle *cliprects; /* one per rasterizer */ + int ncliprects; struct { /* renderer, entityproc, tilers, rasterizers */ @@ -302,6 +304,7 @@ struct Raster struct Framebuf { Rectangle r; + Rectangle clipr; Raster *rasters; /* [0] color, [1] depth, [n] user-defined */ Abuf abuf; /* A-buffer */ @@ -432,6 +435,8 @@ void freecubemap(Cubemap*); Color samplecubemap(Cubemap*, Point3, Color(*)(Texture*, Point2)); /* util */ +Point minpt(Point, Point); +Point maxpt(Point, Point); Point2 modulapt2(Point2, Point2); Point2 minpt2(Point2, Point2); Point2 maxpt2(Point2, Point2); -- cgit v1.2.3