INLINE generateInputCoverage(const uint64_t *const coverageMask, uint32_t (&inputMask)[KNOB_SIMD_WIDTH], const uint32_t sampleMask)
{
- unsigned long index;
uint32_t simdCoverage = (coverageMask[0] & MASK);
static const uint32_t FullCoverageMask = (1 << T::MultisampleT::numSamples) - 1;
- while(_BitScanForward(&index, simdCoverage))
+ for(int i = 0; i < KNOB_SIMD_WIDTH; i++)
{
- // set all samples to covered
- inputMask[index] = FullCoverageMask;
+ // set all samples to covered if conservative coverage mask is set for that pixel
+ inputMask[i] = (((1 << i) & simdCoverage) > 0) ? FullCoverageMask : 0;
}
}
};
UnrollerLMask<0, NumEdges, 1, EdgeMaskT::value>::step(eval_lambda);
// update coverage mask
+ // if edge 0 is degenerate and will be skipped; init the mask
#define UPDATE_MASK(bit) \
- mask = edgeMask[0]; \
+ if(std::is_same<EdgeMaskT, E1E2ValidT>::value || std::is_same<EdgeMaskT, NoEdgesValidT>::value){\
+ mask = 0xf;\
+ }\
+ else{\
+ mask = edgeMask[0]; \
+ }\
UnrollerLMask<1, NumEdges, 1, EdgeMaskT::value>::step(update_lambda); \
coverageMask |= (mask << bit);