f
This commit is contained in:
parent
7389c9257b
commit
c8b78800a6
1 changed files with 5 additions and 4 deletions
|
@ -878,10 +878,9 @@ proc fillShapes(
|
||||||
|
|
||||||
let
|
let
|
||||||
coverageMask1 = cast[M128i]([0xffffffff, 0, 0, 0]) # First 32 bits
|
coverageMask1 = cast[M128i]([0xffffffff, 0, 0, 0]) # First 32 bits
|
||||||
coverageMask3 = mm_set1_epi32(cast[int32](0x000000ff)) # Only `r`
|
coverageMask2 = mm_set1_epi32(cast[int32](0x000000ff)) # Only `r`
|
||||||
oddMask = mm_set1_epi16(cast[int16](0xff00))
|
oddMask = mm_set1_epi16(cast[int16](0xff00))
|
||||||
div255 = mm_set1_epi16(cast[int16](0x8081))
|
div255 = mm_set1_epi16(cast[int16](0x8081))
|
||||||
zero = mm_set1_epi32(0)
|
|
||||||
v255 = mm_set1_epi32(255)
|
v255 = mm_set1_epi32(255)
|
||||||
vColor = mm_set1_epi32(cast[int32](color))
|
vColor = mm_set1_epi32(cast[int32](color))
|
||||||
|
|
||||||
|
@ -889,9 +888,11 @@ proc fillShapes(
|
||||||
var coverage = mm_loadu_si128(coverages[x].addr)
|
var coverage = mm_loadu_si128(coverages[x].addr)
|
||||||
coverage = mm_and_si128(coverage, coverageMask1)
|
coverage = mm_and_si128(coverage, coverageMask1)
|
||||||
|
|
||||||
if mm_movemask_epi8(mm_cmpeq_epi16(coverage, zero)) != 0xffff:
|
let eqZero = mm_cmpeq_epi16(coverage, mm_setzero_si128())
|
||||||
|
if mm_movemask_epi8(eqZero) != 0xffff:
|
||||||
# If the coverages are not all zero
|
# If the coverages are not all zero
|
||||||
var source = vColor
|
var source = vColor
|
||||||
|
|
||||||
coverage = mm_slli_si128(coverage, 2)
|
coverage = mm_slli_si128(coverage, 2)
|
||||||
coverage = mm_shuffle_epi32(coverage, MM_SHUFFLE(1, 1, 0, 0))
|
coverage = mm_shuffle_epi32(coverage, MM_SHUFFLE(1, 1, 0, 0))
|
||||||
|
|
||||||
|
@ -908,7 +909,7 @@ proc fillShapes(
|
||||||
|
|
||||||
coverage = mm_and_si128(
|
coverage = mm_and_si128(
|
||||||
mm_or_si128(mm_or_si128(a, b), mm_or_si128(c, d)),
|
mm_or_si128(mm_or_si128(a, b), mm_or_si128(c, d)),
|
||||||
coverageMask3
|
coverageMask2
|
||||||
)
|
)
|
||||||
|
|
||||||
if mm_movemask_epi8(mm_cmpeq_epi32(coverage, v255)) != 0xffff:
|
if mm_movemask_epi8(mm_cmpeq_epi32(coverage, v255)) != 0xffff:
|
||||||
|
|
Loading…
Reference in a new issue