summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Ted Green <tedgreen99@protonmail.com>2017-10-11 14:42:16 -0600
committer Ted Green <tedgreen99@protonmail.com>2017-10-11 14:47:14 -0600
commit30eabb4706cff4bd3251e45d417b54b15083ba3d (patch)
treef8c551d103a670b9a729a63bd482cd7b9ea3e1de
parent7851b3786c8d0438fc84d78c30c85a144b1dec8c (diff)
voodoo: Reorganize a few function calls to make profiling easier. (nw)
-rw-r--r--src/devices/video/vooddefs.h26
-rw-r--r--src/devices/video/voodoo.cpp14
2 files changed, 23 insertions, 17 deletions
diff --git a/src/devices/video/vooddefs.h b/src/devices/video/vooddefs.h
index 3725b281ac8..3ac63b27c61 100644
--- a/src/devices/video/vooddefs.h
+++ b/src/devices/video/vooddefs.h
@@ -2044,15 +2044,8 @@ inline bool ATTR_FORCE_INLINE voodoo_device::depthTest(uint16_t zaColorReg, stat
return true;
}
-#define PIXEL_PIPELINE_END(vd, STATS, DITHER, DITHER4, DITHER_LOOKUP, XX, dest, depth, FBZMODE, FBZCOLORPATH, ALPHAMODE, FOGMODE, ITERZ, ITERW, ITERAXXX, wfloat) \
- \
- /* perform fogging */ \
- preFog.set(color); \
- if (FOGMODE_ENABLE_FOG(FOGMODE)) \
- applyFogging(vd, FBZMODE, FOGMODE, FBZCOLORPATH, XX, DITHER4, wfloat, color, ITERZ, ITERW, ITERAXXX); \
- /* perform alpha blending */ \
- if (ALPHAMODE_ALPHABLEND(ALPHAMODE)) \
- alphaBlend(FBZMODE, ALPHAMODE, XX, DITHER, dest[XX], depth, preFog, color, vd->fbi.rgb565); \
+#define PIXEL_PIPELINE_END(STATS, DITHER_LOOKUP, XX, dest, depth, FBZMODE) \
+ \
r = color.get_r(); g = color.get_g(); b = color.get_b(); \
/* modify the pixel for debugging purposes */ \
MODIFY_PIXEL(VV); \
@@ -2769,10 +2762,17 @@ void voodoo_device::raster_##name(void *destbase, int32_t y, const poly_extent *
if (!combineColor(vd, stats, FBZCOLORPATH, FBZMODE, ALPHAMODE, texel, iterz, iterw, color)) \
goto skipdrawdepth; \
\
- /* pixel pipeline part 2 handles fog, alpha, and final output */ \
- PIXEL_PIPELINE_END(vd, stats, dither, dither4, dither_lookup, x, dest, depth, \
- FBZMODE, FBZCOLORPATH, ALPHAMODE, FOGMODE, \
- iterz, iterw, iterargb, wfloat); \
+ /* perform fogging */ \
+ preFog.set(color); \
+ if (FOGMODE_ENABLE_FOG(FOGMODE)) \
+ applyFogging(vd, FBZMODE, FOGMODE, FBZCOLORPATH, x, dither4, wfloat, color, iterz, iterw, iterargb); \
+ \
+ /* perform alpha blending */ \
+ if (ALPHAMODE_ALPHABLEND(ALPHAMODE)) \
+ alphaBlend(FBZMODE, ALPHAMODE, x, dither, dest[x], depth, preFog, color, vd->fbi.rgb565); \
+ \
+ /* pixel pipeline part 2 handles final output */ \
+ PIXEL_PIPELINE_END(stats, dither_lookup, x, dest, depth, FBZMODE); \
\
/* update the iterated parameters */ \
iterargb += iterargbDelta; \
diff --git a/src/devices/video/voodoo.cpp b/src/devices/video/voodoo.cpp
index 0881a1aa9a9..3b2e1a2f517 100644
--- a/src/devices/video/voodoo.cpp
+++ b/src/devices/video/voodoo.cpp
@@ -3379,14 +3379,20 @@ int32_t voodoo_device::lfb_w(voodoo_device* vd, offs_t offset, uint32_t data, ui
if (!alphaTest(vd, stats, vd->reg[alphaMode].u, color.get_a()))
goto nextpixel;
+ /* perform fogging */
+ preFog.set(color);
+ if (FOGMODE_ENABLE_FOG(vd->reg[fogMode].u))
+ applyFogging(vd, vd->reg[fbzMode].u, vd->reg[fogMode].u, vd->reg[fbzColorPath].u, x, dither4, biasdepth, color, iterz, iterw, iterargb);
/* wait for any outstanding work to finish */
poly_wait(vd->poly, "LFB Write");
- /* pixel pipeline part 2 handles color blending, fog, alpha, and final output */
- PIXEL_PIPELINE_END(vd, stats, dither, dither4, dither_lookup, x, dest, depth,
- vd->reg[fbzMode].u, vd->reg[fbzColorPath].u, vd->reg[alphaMode].u, vd->reg[fogMode].u,
- iterz, iterw, iterargb, biasdepth) { };
+ /* perform alpha blending */
+ if (ALPHAMODE_ALPHABLEND(vd->reg[alphaMode].u))
+ alphaBlend(vd->reg[fbzMode].u, vd->reg[alphaMode].u, x, dither, dest[x], depth, preFog, color, vd->fbi.rgb565);
+
+ /* pixel pipeline part 2 handles final output */
+ PIXEL_PIPELINE_END(stats, dither_lookup, x, dest, depth, vd->reg[fbzMode].u) { };
nextpixel:
/* advance our pointers */
x++;