This commit is contained in:
Ryan Oldenburg 2021-02-11 14:40:30 -06:00
parent 50a4687d67
commit abbcc717cd

View file

@ -668,21 +668,22 @@ proc drawUber(
else: else:
var x = xMin var x = xMin
when defined(amd64) and not defined(pixieNoSimd): when defined(amd64) and not defined(pixieNoSimd):
if dx.y == 0 and dy.x == 0 and blendMode.hasSimdBlender(): if blendMode.hasSimdBlender():
# Check we are not rotated before using SIMD blends if dx.x == 1 and dx.y == 0 and dy.x == 0 and dy.y == 1:
let blenderSimd = blendMode.blenderSimd() # Check we are not rotated before using SIMD blends
for _ in countup(x, xMax - 4, 4): let blenderSimd = blendMode.blenderSimd()
let for _ in countup(x, xMax - 4, 4):
srcPos = p + dx * x.float32 + dy * y.float32 let
sx = srcPos.x.int srcPos = p + dx * x.float32 + dy * y.float32
sy = srcPos.y.int sx = srcPos.x.int
backdrop = mm_loadu_si128(a.data[a.dataIndex(x, y)].addr) sy = srcPos.y.int
source = mm_loadu_si128(b.data[b.dataIndex(sx, sy)].addr) backdrop = mm_loadu_si128(a.data[a.dataIndex(x, y)].addr)
mm_storeu_si128( source = mm_loadu_si128(b.data[b.dataIndex(sx, sy)].addr)
a.data[a.dataIndex(x, y)].addr, mm_storeu_si128(
blenderSimd(backdrop, source) a.data[a.dataIndex(x, y)].addr,
) blenderSimd(backdrop, source)
x += 4 )
x += 4
for _ in x ..< xMax: for _ in x ..< xMax:
let let