renames
This commit is contained in:
parent
eae87b6c8a
commit
6363e6995c
1 changed files with 12 additions and 12 deletions
|
@ -1187,7 +1187,7 @@ iterator walk(
|
||||||
if prevAt != width and count != 0:
|
if prevAt != width and count != 0:
|
||||||
echo "Leak detected: ", count, " @ (", prevAt, ", ", y, ")"
|
echo "Leak detected: ", count, " @ (", prevAt, ", ", y, ")"
|
||||||
|
|
||||||
proc computeCoverages(
|
proc computeCoverage(
|
||||||
coverages: var seq[uint8],
|
coverages: var seq[uint8],
|
||||||
hits: var seq[(float32, int16)],
|
hits: var seq[(float32, int16)],
|
||||||
numHits: var int,
|
numHits: var int,
|
||||||
|
@ -1259,9 +1259,9 @@ proc computeCoverages(
|
||||||
when defined(amd64) and not defined(pixieNoSimd):
|
when defined(amd64) and not defined(pixieNoSimd):
|
||||||
let sampleCoverageVec = mm_set1_epi8(cast[int8](sampleCoverage))
|
let sampleCoverageVec = mm_set1_epi8(cast[int8](sampleCoverage))
|
||||||
for _ in 0 ..< fillLen div 16:
|
for _ in 0 ..< fillLen div 16:
|
||||||
var coverage = mm_loadu_si128(coverages[i - startX].addr)
|
var coverageVec = mm_loadu_si128(coverages[i - startX].addr)
|
||||||
coverage = mm_add_epi8(coverage, sampleCoverageVec)
|
coverageVec = mm_add_epi8(coverageVec, sampleCoverageVec)
|
||||||
mm_storeu_si128(coverages[i - startX].addr, coverage)
|
mm_storeu_si128(coverages[i - startX].addr, coverageVec)
|
||||||
i += 16
|
i += 16
|
||||||
for j in i ..< fillStart + fillLen:
|
for j in i ..< fillStart + fillLen:
|
||||||
coverages[j - startX] += sampleCoverage
|
coverages[j - startX] += sampleCoverage
|
||||||
|
@ -1299,11 +1299,11 @@ proc fillCoverage(
|
||||||
for _ in 0 ..< coverages.len div 16:
|
for _ in 0 ..< coverages.len div 16:
|
||||||
let
|
let
|
||||||
index = image.dataIndex(x, y)
|
index = image.dataIndex(x, y)
|
||||||
coverage = mm_loadu_si128(coverages[x - startX].unsafeAddr)
|
coverageVec = mm_loadu_si128(coverages[x - startX].unsafeAddr)
|
||||||
|
|
||||||
if mm_movemask_epi8(mm_cmpeq_epi16(coverage, zeroVec)) != 0xffff:
|
if mm_movemask_epi8(mm_cmpeq_epi16(coverageVec, zeroVec)) != 0xffff:
|
||||||
# If the coverages are not all zero
|
# If the coverages are not all zero
|
||||||
if mm_movemask_epi8(mm_cmpeq_epi32(coverage, vec255)) == 0xffff:
|
if mm_movemask_epi8(mm_cmpeq_epi32(coverageVec, vec255)) == 0xffff:
|
||||||
# If the coverages are all 255
|
# If the coverages are all 255
|
||||||
if blendMode == bmNormal and rgbx.a == 255:
|
if blendMode == bmNormal and rgbx.a == 255:
|
||||||
for i in 0 ..< 4:
|
for i in 0 ..< 4:
|
||||||
|
@ -1317,9 +1317,9 @@ proc fillCoverage(
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
# Coverages are not all 255
|
# Coverages are not all 255
|
||||||
var coverage = coverage
|
var coverageVec = coverageVec
|
||||||
for i in 0 ..< 4:
|
for i in 0 ..< 4:
|
||||||
var unpacked = unpackAlphaValues(coverage)
|
var unpacked = unpackAlphaValues(coverageVec)
|
||||||
# Shift the coverages from `a` to `g` and `a` for multiplying
|
# Shift the coverages from `a` to `g` and `a` for multiplying
|
||||||
unpacked = mm_or_si128(unpacked, mm_srli_epi32(unpacked, 16))
|
unpacked = mm_or_si128(unpacked, mm_srli_epi32(unpacked, 16))
|
||||||
|
|
||||||
|
@ -1342,7 +1342,7 @@ proc fillCoverage(
|
||||||
blenderSimd(backdrop, source)
|
blenderSimd(backdrop, source)
|
||||||
)
|
)
|
||||||
|
|
||||||
coverage = mm_srli_si128(coverage, 4)
|
coverageVec = mm_srli_si128(coverageVec, 4)
|
||||||
|
|
||||||
elif blendMode == bmMask:
|
elif blendMode == bmMask:
|
||||||
for i in 0 ..< 4:
|
for i in 0 ..< 4:
|
||||||
|
@ -1538,7 +1538,7 @@ proc fillShapes(
|
||||||
numHits: int
|
numHits: int
|
||||||
|
|
||||||
for y in startY ..< pathHeight:
|
for y in startY ..< pathHeight:
|
||||||
computeCoverages(
|
computeCoverage(
|
||||||
coverages,
|
coverages,
|
||||||
hits,
|
hits,
|
||||||
numHits,
|
numHits,
|
||||||
|
@ -1595,7 +1595,7 @@ proc fillShapes(
|
||||||
numHits: int
|
numHits: int
|
||||||
|
|
||||||
for y in startY ..< pathHeight:
|
for y in startY ..< pathHeight:
|
||||||
computeCoverages(
|
computeCoverage(
|
||||||
coverages,
|
coverages,
|
||||||
hits,
|
hits,
|
||||||
numHits,
|
numHits,
|
||||||
|
|
Loading…
Reference in a new issue