summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video/powervr2.cpp
diff options
context:
space:
mode:
author snickerbockers <chimerasaurusrex@gmail.com>2018-07-31 04:46:29 -0700
committer snickerbockers <chimerasaurusrex@gmail.com>2018-07-31 11:42:44 -0700
commit13bdaf3b664be3d48d68db47d26f1245323423e5 (patch)
treef6117a02ccde66fbea93c45384715c7ac1089b4f /src/mame/video/powervr2.cpp
parent01b1422c26593576797e8a4bc22bfa3c54ede8e8 (diff)
powervr2.cpp: reduce number of divisions in render_hline
Diffstat (limited to 'src/mame/video/powervr2.cpp')
-rw-r--r--src/mame/video/powervr2.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/mame/video/powervr2.cpp b/src/mame/video/powervr2.cpp
index 370d48984a2..942a02a820d 100644
--- a/src/mame/video/powervr2.cpp
+++ b/src/mame/video/powervr2.cpp
@@ -2356,12 +2356,7 @@ inline void powervr2_device::render_hline(bitmap_rgb32 &bitmap, texinfo *ti, int
uint32_t *tdata;
float *wbufline;
- // untextured cases aren't handled
-// if (!ti->textured) return;
-
float bl[4], offl[4];
- memcpy(bl, bl_in, sizeof(bl));
- memcpy(offl, offl_in, sizeof(offl));
if(xr < 0 || xl >= 640)
return;
@@ -2372,23 +2367,28 @@ inline void powervr2_device::render_hline(bitmap_rgb32 &bitmap, texinfo *ti, int
if(xxl == xxr)
return;
+ memcpy(bl, bl_in, sizeof(bl));
+ memcpy(offl, offl_in, sizeof(offl));
+
dx = xr-xl;
- dudx = (ur-ul)/dx;
- dvdx = (vr-vl)/dx;
- dwdx = (wr-wl)/dx;
+ float dx_recip = 1.0f / dx;
+
+ dudx = (ur-ul) * dx_recip;
+ dvdx = (vr-vl) * dx_recip;
+ dwdx = (wr-wl) * dx_recip;
float dbdx[4] = {
- (br_in[0] - bl[0]) / dx,
- (br_in[1] - bl[1]) / dx,
- (br_in[2] - bl[2]) / dx,
- (br_in[3] - bl[3]) / dx
+ (br_in[0] - bl[0]) * dx_recip,
+ (br_in[1] - bl[1]) * dx_recip,
+ (br_in[2] - bl[2]) * dx_recip,
+ (br_in[3] - bl[3]) * dx_recip
};
float dodx[4] = {
- (offr_in[0] - offl[0]) / dx,
- (offr_in[1] - offl[1]) / dx,
- (offr_in[2] - offl[2]) / dx,
- (offr_in[3] - offl[3]) / dx
+ (offr_in[0] - offl[0]) * dx_recip,
+ (offr_in[1] - offl[1]) * dx_recip,
+ (offr_in[2] - offl[2]) * dx_recip,
+ (offr_in[3] - offl[3]) * dx_recip
};
if(xxl < 0)