From 57fdd82018e8f3449987cca19f3a41f630d7d62e Mon Sep 17 00:00:00 2001 From: Leonard Kugis Date: Mon, 5 Oct 2026 01:36:32 +0200 Subject: Implemented PuM pipeline --- WinQuake/r_surf.c | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'WinQuake/r_surf.c') diff --git a/WinQuake/r_surf.c b/WinQuake/r_surf.c index 00a1391..b63693e 100644 --- a/WinQuake/r_surf.c +++ b/WinQuake/r_surf.c @@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "quakedef.h" #include "r_local.h" +#include "pum_bridge.h" drawsurf_t r_drawsurf; @@ -133,6 +134,9 @@ void R_AddDynamicLights (void) } #else blocklights[t*smax + s] += (rad - dist)*256; +#ifdef RENDER_PUM + // TODO: Contribution accumulation +#endif #endif } } @@ -198,6 +202,17 @@ void R_BuildLightMap (void) if (t < (1 << 6)) t = (1 << 6); +#ifdef RENDER_PUM + // mux bitwise wia pum + if (PUM_Active ()) + { + byte v = (byte)t; + byte lo = (byte)(1 << 6); + PUM_LightMaskAndTexel (&v, &lo, &v, 1); + t = v; + } +#endif + blocklights[i] = t; } } @@ -368,8 +383,22 @@ void R_DrawSurfaceBlock8_mip0 (void) for (b=15; b>=0; b--) { pix = psource[b]; - prowdest[b] = ((unsigned char *)vid.colormap) - [(light & 0xFF00) + pix]; +#ifdef RENDER_PUM + // light lookup plus texel masking + // Later gather on main program + if (PUM_Active ()) + { + byte pumtex; + pumtex = pix; + PUM_LightMaskAndTexel (&pumtex, &pix, (const byte *)&light, + sizeof (pix)); + prowdest[b] = ((unsigned char *)vid.colormap) + [(light & 0xFF00) + pumtex]; + } + else +#endif + prowdest[b] = ((unsigned char *)vid.colormap) + [(light & 0xFF00) + pix]; light += lightstep; } -- cgit v1.2.3